UB Sanitizer report:
lib/dp-packet.h:297:39: runtime error: applying zero offset to null pointer
#0 0x7946f5 in dp_packet_tail /root/ovs/./lib/dp-packet.h:297:39
#1 0x794331 in dp_packet_tailroom /root/ovs/./lib/dp-packet.h:325:49
#2 0x7942a0 in dp_packet_prealloc_tailroom
/root/ovs/lib/dp-packet.c:297:16
#3 0xc347cf in eth_compose /root/ovs/lib/packets.c:1061:5
[...]
Signed-off-by: Dumitru Ceara <[email protected]>
---
v3: Implement Aaron's suggestion instead and fix
dp_packet_prealloc_tailroom().
---
lib/dp-packet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index 72f6d09ac7f3..35c72542a2ad 100644
--- a/lib/dp-packet.c
+++ b/lib/dp-packet.c
@@ -294,7 +294,7 @@ dp_packet_resize(struct dp_packet *b, size_t new_headroom,
size_t new_tailroom)
void
dp_packet_prealloc_tailroom(struct dp_packet *b, size_t size)
{
- if (size > dp_packet_tailroom(b)) {
+ if ((size && !dp_packet_base(b)) || (size > dp_packet_tailroom(b))) {
dp_packet_resize(b, dp_packet_headroom(b), MAX(size, 64));
}
}
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev