summaryrefslogtreecommitdiff
path: root/fs/devfs/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorYucheng Lu <kanolyc@gmail.com>2026-03-31 16:00:21 +0800
committerJakub Kicinski <kuba@kernel.org>2026-04-01 19:24:20 -0700
commitd64cb81dcbd54927515a7f65e5e24affdc73c14b (patch)
tree8d995cc7f21c37b6d9ac48a8daa5cfb220c2d426 /fs/devfs/git@git.tavy.me:linux.git
parentaba53ccf05607d1116839a85415df9c07118bf4c (diff)
net/sched: sch_netem: fix out-of-bounds access in packet corruption
In netem_enqueue(), the packet corruption logic uses get_random_u32_below(skb_headlen(skb)) to select an index for modifying skb->data. When an AF_PACKET TX_RING sends fully non-linear packets over an IPIP tunnel, skb_headlen(skb) evaluates to 0. Passing 0 to get_random_u32_below() takes the variable-ceil slow path which returns an unconstrained 32-bit random integer. Using this unconstrained value as an offset into skb->data results in an out-of-bounds memory access. Fix this by verifying skb_headlen(skb) is non-zero before attempting to corrupt the linear data area. Fully non-linear packets will silently bypass the corruption logic. Fixes: c865e5d99e25 ("[PKT_SCHED] netem: packet corruption option") Reported-by: Yifan Wu <yifanwucs@gmail.com> Reported-by: Juefei Pu <tomapufckgml@gmail.com> Signed-off-by: Yuan Tan <tanyuan98@outlook.com> Signed-off-by: Xin Liu <bird@lzu.edu.cn> Signed-off-by: Yuhang Zheng <z1652074432@gmail.com> Signed-off-by: Yucheng Lu <kanolyc@gmail.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Link: https://patch.msgid.link/45435c0935df877853a81e6d06205ac738ec65fa.1774941614.git.kanolyc@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'fs/devfs/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions