]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: garp: reload skb header pointers after pskb_may_pull()
authorDavid Carlier <devnexen@gmail.com>
Thu, 4 Jun 2026 14:19:22 +0000 (15:19 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 9 Jun 2026 02:10:01 +0000 (19:10 -0700)
commitab71cf79e2f86012828bc1a3b8cf656a6a597a43
treea6fe248dcb568e1258035347731beeac2457b449
parent32fbe56b3f8a81383bc38d51e76edb74031d34c8
net: garp: reload skb header pointers after pskb_may_pull()

garp_pdu_parse_attr() keeps a pointer into the skb linear area across
pskb_may_pull(skb, ga->len), and garp_pdu_parse_msg() dereferences gm
on every loop iteration even though the nested parse may pull again.
pskb_may_pull() can reallocate the skb head, which would leave those
pointers stale.

This is not reachable today: GARP PDUs arrive via the 802.2 LLC SAP
path, where llc_fixup_skb() already pulls and trims the whole payload
into the linear area, so the inner pulls never reallocate. Reload ga
after the pull and snapshot gm->attrtype into a local anyway, to harden
the parser and match the skb_header_pointer() discipline used by mrp.c.

No functional change.

Signed-off-by: David Carlier <devnexen@gmail.com>
Link: https://patch.msgid.link/20260604141925.237746-1-devnexen@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/802/garp.c