diff options
author | Paolo Abeni | 2022-04-22 09:56:00 +0200 |
---|---|---|
committer | Paolo Abeni | 2022-04-22 09:56:00 +0200 |
commit | f70925bf99406150d8133e775e49c9c459f78733 (patch) | |
tree | 392dd3854bf229c0c94b481819e4a67551ba6895 /net/netlink | |
parent | 9c8774e629a1950c24b44e3c8fb93d76fb644b49 (diff) | |
parent | 59f0c2447e2553b0918b4a9fd38763a5c0587d02 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
d08ed852560e ("net: lan966x: Make sure to release ptp interrupt")
c8349639324a ("net: lan966x: Add FDMA functionality")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 9fa85bb36c0e..1b5a9c2e1c29 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2262,6 +2262,13 @@ static int netlink_dump(struct sock *sk) * single netdev. The outcome is MSG_TRUNC error. */ skb_reserve(skb, skb_tailroom(skb) - alloc_size); + + /* Make sure malicious BPF programs can not read unitialized memory + * from skb->head -> skb->data + */ + skb_reset_network_header(skb); + skb_reset_mac_header(skb); + netlink_skb_set_owner_r(skb, sk); if (nlk->dump_done_errno > 0) { |