aboutsummaryrefslogtreecommitdiff
path: root/include/linux/avf
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2023-01-24 13:13:28 +0200
committerDavid S. Miller <davem@davemloft.net>2023-01-25 09:57:41 +0000
commitf5be9caf7bf022ab550f62ea68f1c1bb8f5287ee (patch)
tree9b2be46fb3477e13f2d2b065e31d82f8f37a7fd3 /include/linux/avf
parentc96de136329b38172f21214021fc30d67f05c399 (diff)
net: ethtool: fix NULL pointer dereference in pause_prepare_data()
In the following call path: ethnl_default_dumpit -> ethnl_default_dump_one -> ctx->ops->prepare_data -> pause_prepare_data struct genl_info *info will be passed as NULL, and pause_prepare_data() dereferences it while getting the extended ack pointer. To avoid that, just set the extack to NULL if "info" is NULL, since the netlink extack handling messages know how to deal with that. The pattern "info ? info->extack : NULL" is present in quite a few other "prepare_data" implementations, so it's clear that it's a more general problem to be dealt with at a higher level, but the code should have at least adhered to the current conventions to avoid the NULL dereference. Fixes: 04692c9020b7 ("net: ethtool: netlink: retrieve stats from multiple sources (eMAC, pMAC)") Reported-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reported-by: syzbot+9d44aae2720fc40b8474@syzkaller.appspotmail.com Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/avf')
0 files changed, 0 insertions, 0 deletions