]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bridge: br_nd_send: validate ND option lengths
authorYang Yang <n05ec@lzu.edu.cn>
Thu, 26 Mar 2026 03:44:40 +0000 (03:44 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 28 Mar 2026 03:37:14 +0000 (20:37 -0700)
commit850837965af15707fd3142c1cf3c5bfaf022299b
tree4671d056d8a395fcedfb3f7102dd119c44d9934c
parenta01aee7cafc575bb82f5529e8734e7052f9b16ea
bridge: br_nd_send: validate ND option lengths

br_nd_send() walks ND options according to option-provided lengths.
A malformed option can make the parser advance beyond the computed
option span or use a too-short source LLADDR option payload.

Validate option lengths against the remaining NS option area before
advancing, and only read source LLADDR when the option is large enough
for an Ethernet address.

Fixes: ed842faeb2bd ("bridge: suppress nd pkts on BR_NEIGH_SUPPRESS ports")
Cc: stable@vger.kernel.org
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Tested-by: Ao Zhou <n05ec@lzu.edu.cn>
Co-developed-by: Yuan Tan <tanyuan98@outlook.com>
Signed-off-by: Yuan Tan <tanyuan98@outlook.com>
Suggested-by: Xin Liu <bird@lzu.edu.cn>
Signed-off-by: Yang Yang <n05ec@lzu.edu.cn>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260326034441.2037420-3-n05ec@lzu.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_arp_nd_proxy.c