summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorMark Amirkan <markdamirkan@gmail.com>2026-09-13 10:31:08 +0000
committerJakub Kicinski <kuba@kernel.org>2026-09-16 17:29:11 -0700
commit37213e61120297920ae4c937fcb326a360da5084 (patch)
tree3efe062c0655d0528447eba053a4c354b16baf39 /tools/perf/scripts/python/stackcollapse.py
parent60404266ef3e0a1cd8f7a164060e0c83efb72f4b (diff)
downloadlinux-next-37213e61120297920ae4c937fcb326a360da5084.tar.gz
linux-next-37213e61120297920ae4c937fcb326a360da5084.zip
net/packet: avoid truncating TPACKET_V3 private size
tpacket_req3.tp_sizeof_priv is an unsigned int, and packet_set_ring() validates the full value against the block size. init_prb_bdqc() then stores it in the unsigned short blk_sizeof_priv field. Commit 2b6867c2ce76 ("net/packet: fix overflow in check for priv area size") fixed the validation arithmetic, but an accepted value above USHRT_MAX still narrows when it is stored. For a 131072-byte block, tp_sizeof_priv=65536 is valid. The narrowing makes offset_to_first_pkt 48 instead of 65584, so packet records can be placed in the private area that userspace asked the kernel to preserve. blk_sizeof_priv is internal state, so widen it to hold the validated UAPI value. Fixes: f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation.") Cc: stable@vger.kernel.org Signed-off-by: Mark Amirkan <markdamirkan@gmail.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260913-b4-send-packet-private-v1-1-925eab2cd388@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions