amt: fix size calculation in amt_get_size()
authorEric Dumazet <edumazet@google.com>
Wed, 1 Jul 2026 12:23:29 +0000 (12:23 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 6 Jul 2026 11:01:24 +0000 (13:01 +0200)
commit9e05e91a9a847ed57926414bd7c2c5e54d6c56c6
treedf914cab2f1a384e66968724d2b5cd2b2d10f7ee
parent9d160b35cc34a2ba8229d07651468a7848325135
amt: fix size calculation in amt_get_size()

amt_get_size() incorrectly used sizeof(struct iphdr) for the sizes of
IFLA_AMT_DISCOVERY_IP, IFLA_AMT_REMOTE_IP, and IFLA_AMT_LOCAL_IP.
These attributes contain IPv4 addresses (__be32), not full IP headers.

Replace sizeof(struct iphdr) with sizeof(__be32) to avoid over-allocating
netlink message space.

Fixes: b9022b53adad ("amt: add control plane of amt interface")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260701122329.3562825-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/amt.c