I believe this patch is a fix for issue #937 where fortify causes a panic in tc_configure() due to a "detected buffer overflow in strcpy". The nlattr * is set to &nlreq.hdr which has a fixed size causing the overflow. By setting nlattr * to &nlreq instead, the code sees the 100 byte buf space and does not panic. I tested this on kernel 6.5.0-21 and verified the qdisc name was properly set by using tc. With the fix I could run pkt-gen on multiple emulated netmap interfaces without seeing a panic.
While here I removed a duplicate strcpy() in netmap_sink_init(). I assumed "nmsink" is preferred to "nmsink%d".
Hello,
I believe this patch is a fix for issue #937 where fortify causes a panic in
tc_configure()
due to a "detected buffer overflow in strcpy". Thenlattr *
is set to&nlreq.hdr
which has a fixed size causing the overflow. By settingnlattr *
to&nlreq
instead, the code sees the 100 bytebuf
space and does not panic. I tested this on kernel 6.5.0-21 and verified theqdisc
name was properly set by usingtc
. With the fix I could runpkt-gen
on multiple emulated netmap interfaces without seeing a panic.While here I removed a duplicate
strcpy()
innetmap_sink_init()
. I assumed "nmsink" is preferred to "nmsink%d".