]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 May 2019 10:22:21 +0000 (12:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 May 2019 10:22:21 +0000 (12:22 +0200)
added patches:
bnxt_en-improve-multicast-address-setup-logic.patch
ipv4-ip_do_fragment-preserve-skb_iif-during-fragmentation.patch
ipv6-flowlabel-wait-rcu-grace-period-before-put_pid.patch
ipv6-invert-flowlabel-sharing-check-in-process-and-user-mode.patch
net-phy-marvell-fix-buffer-overrun-with-stats-counters.patch
packet-validate-msg_namelen-in-send-directly.patch

queue-4.9/bnxt_en-improve-multicast-address-setup-logic.patch [new file with mode: 0644]
queue-4.9/ipv4-ip_do_fragment-preserve-skb_iif-during-fragmentation.patch [new file with mode: 0644]
queue-4.9/ipv6-flowlabel-wait-rcu-grace-period-before-put_pid.patch [new file with mode: 0644]
queue-4.9/ipv6-invert-flowlabel-sharing-check-in-process-and-user-mode.patch [new file with mode: 0644]
queue-4.9/net-phy-marvell-fix-buffer-overrun-with-stats-counters.patch [new file with mode: 0644]
queue-4.9/packet-validate-msg_namelen-in-send-directly.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/bnxt_en-improve-multicast-address-setup-logic.patch b/queue-4.9/bnxt_en-improve-multicast-address-setup-logic.patch
new file mode 100644 (file)
index 0000000..d87d71a
--- /dev/null
@@ -0,0 +1,43 @@
+From foo@baz Sat 04 May 2019 11:50:27 AM CEST
+From: Michael Chan <michael.chan@broadcom.com>
+Date: Thu, 25 Apr 2019 22:31:50 -0400
+Subject: bnxt_en: Improve multicast address setup logic.
+
+From: Michael Chan <michael.chan@broadcom.com>
+
+[ Upstream commit b4e30e8e7ea1d1e35ffd64ca46f7d9a7f227b4bf ]
+
+The driver builds a list of multicast addresses and sends it to the
+firmware when the driver's ndo_set_rx_mode() is called.  In rare
+cases, the firmware can fail this call if internal resources to
+add multicast addresses are exhausted.  In that case, we should
+try the call again by setting the ALL_MCAST flag which is more
+guaranteed to succeed.
+
+Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
+Signed-off-by: Michael Chan <michael.chan@broadcom.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/broadcom/bnxt/bnxt.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+@@ -5954,8 +5954,15 @@ static int bnxt_cfg_rx_mode(struct bnxt
+ skip_uc:
+       rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
++      if (rc && vnic->mc_list_count) {
++              netdev_info(bp->dev, "Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n",
++                          rc);
++              vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST;
++              vnic->mc_list_count = 0;
++              rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
++      }
+       if (rc)
+-              netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %x\n",
++              netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %d\n",
+                          rc);
+       return rc;
diff --git a/queue-4.9/ipv4-ip_do_fragment-preserve-skb_iif-during-fragmentation.patch b/queue-4.9/ipv4-ip_do_fragment-preserve-skb_iif-during-fragmentation.patch
new file mode 100644 (file)
index 0000000..fde6824
--- /dev/null
@@ -0,0 +1,42 @@
+From foo@baz Sat 04 May 2019 11:50:27 AM CEST
+From: Shmulik Ladkani <shmulik@metanetworks.com>
+Date: Mon, 29 Apr 2019 16:39:30 +0300
+Subject: ipv4: ip_do_fragment: Preserve skb_iif during fragmentation
+
+From: Shmulik Ladkani <shmulik@metanetworks.com>
+
+[ Upstream commit d2f0c961148f65bc73eda72b9fa3a4e80973cb49 ]
+
+Previously, during fragmentation after forwarding, skb->skb_iif isn't
+preserved, i.e. 'ip_copy_metadata' does not copy skb_iif from given
+'from' skb.
+
+As a result, ip_do_fragment's creates fragments with zero skb_iif,
+leading to inconsistent behavior.
+
+Assume for example an eBPF program attached at tc egress (post
+forwarding) that examines __sk_buff->ingress_ifindex:
+ - the correct iif is observed if forwarding path does not involve
+   fragmentation/refragmentation
+ - a bogus iif is observed if forwarding path involves
+   fragmentation/refragmentatiom
+
+Fix, by preserving skb_iif during 'ip_copy_metadata'.
+
+Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/ip_output.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/ipv4/ip_output.c
++++ b/net/ipv4/ip_output.c
+@@ -492,6 +492,7 @@ static void ip_copy_metadata(struct sk_b
+       to->pkt_type = from->pkt_type;
+       to->priority = from->priority;
+       to->protocol = from->protocol;
++      to->skb_iif = from->skb_iif;
+       skb_dst_drop(to);
+       skb_dst_copy(to, from);
+       to->dev = from->dev;
diff --git a/queue-4.9/ipv6-flowlabel-wait-rcu-grace-period-before-put_pid.patch b/queue-4.9/ipv6-flowlabel-wait-rcu-grace-period-before-put_pid.patch
new file mode 100644 (file)
index 0000000..b93bafa
--- /dev/null
@@ -0,0 +1,151 @@
+From foo@baz Sat 04 May 2019 11:50:27 AM CEST
+From: Eric Dumazet <edumazet@google.com>
+Date: Sat, 27 Apr 2019 16:49:06 -0700
+Subject: ipv6/flowlabel: wait rcu grace period before put_pid()
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 6c0afef5fb0c27758f4d52b2210c61b6bd8b4470 ]
+
+syzbot was able to catch a use-after-free read in pid_nr_ns() [1]
+
+ip6fl_seq_show() seems to use RCU protection, dereferencing fl->owner.pid
+but fl_free() releases fl->owner.pid before rcu grace period is started.
+
+[1]
+
+BUG: KASAN: use-after-free in pid_nr_ns+0x128/0x140 kernel/pid.c:407
+Read of size 4 at addr ffff888094012a04 by task syz-executor.0/18087
+
+CPU: 0 PID: 18087 Comm: syz-executor.0 Not tainted 5.1.0-rc6+ #89
+Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
+Call Trace:
+ __dump_stack lib/dump_stack.c:77 [inline]
+ dump_stack+0x172/0x1f0 lib/dump_stack.c:113
+ print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187
+ kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
+ __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131
+ pid_nr_ns+0x128/0x140 kernel/pid.c:407
+ ip6fl_seq_show+0x2f8/0x4f0 net/ipv6/ip6_flowlabel.c:794
+ seq_read+0xad3/0x1130 fs/seq_file.c:268
+ proc_reg_read+0x1fe/0x2c0 fs/proc/inode.c:227
+ do_loop_readv_writev fs/read_write.c:701 [inline]
+ do_loop_readv_writev fs/read_write.c:688 [inline]
+ do_iter_read+0x4a9/0x660 fs/read_write.c:922
+ vfs_readv+0xf0/0x160 fs/read_write.c:984
+ kernel_readv fs/splice.c:358 [inline]
+ default_file_splice_read+0x475/0x890 fs/splice.c:413
+ do_splice_to+0x12a/0x190 fs/splice.c:876
+ splice_direct_to_actor+0x2d2/0x970 fs/splice.c:953
+ do_splice_direct+0x1da/0x2a0 fs/splice.c:1062
+ do_sendfile+0x597/0xd00 fs/read_write.c:1443
+ __do_sys_sendfile64 fs/read_write.c:1498 [inline]
+ __se_sys_sendfile64 fs/read_write.c:1490 [inline]
+ __x64_sys_sendfile64+0x15a/0x220 fs/read_write.c:1490
+ do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+RIP: 0033:0x458da9
+Code: ad b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
+RSP: 002b:00007f300d24bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
+RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000458da9
+RDX: 00000000200000c0 RSI: 0000000000000008 RDI: 0000000000000007
+RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
+R10: 000000000000005a R11: 0000000000000246 R12: 00007f300d24c6d4
+R13: 00000000004c5fa3 R14: 00000000004da748 R15: 00000000ffffffff
+
+Allocated by task 17543:
+ save_stack+0x45/0xd0 mm/kasan/common.c:75
+ set_track mm/kasan/common.c:87 [inline]
+ __kasan_kmalloc mm/kasan/common.c:497 [inline]
+ __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470
+ kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505
+ slab_post_alloc_hook mm/slab.h:437 [inline]
+ slab_alloc mm/slab.c:3393 [inline]
+ kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3555
+ alloc_pid+0x55/0x8f0 kernel/pid.c:168
+ copy_process.part.0+0x3b08/0x7980 kernel/fork.c:1932
+ copy_process kernel/fork.c:1709 [inline]
+ _do_fork+0x257/0xfd0 kernel/fork.c:2226
+ __do_sys_clone kernel/fork.c:2333 [inline]
+ __se_sys_clone kernel/fork.c:2327 [inline]
+ __x64_sys_clone+0xbf/0x150 kernel/fork.c:2327
+ do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+
+Freed by task 7789:
+ save_stack+0x45/0xd0 mm/kasan/common.c:75
+ set_track mm/kasan/common.c:87 [inline]
+ __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459
+ kasan_slab_free+0xe/0x10 mm/kasan/common.c:467
+ __cache_free mm/slab.c:3499 [inline]
+ kmem_cache_free+0x86/0x260 mm/slab.c:3765
+ put_pid.part.0+0x111/0x150 kernel/pid.c:111
+ put_pid+0x20/0x30 kernel/pid.c:105
+ fl_free+0xbe/0xe0 net/ipv6/ip6_flowlabel.c:102
+ ip6_fl_gc+0x295/0x3e0 net/ipv6/ip6_flowlabel.c:152
+ call_timer_fn+0x190/0x720 kernel/time/timer.c:1325
+ expire_timers kernel/time/timer.c:1362 [inline]
+ __run_timers kernel/time/timer.c:1681 [inline]
+ __run_timers kernel/time/timer.c:1649 [inline]
+ run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694
+ __do_softirq+0x266/0x95a kernel/softirq.c:293
+
+The buggy address belongs to the object at ffff888094012a00
+ which belongs to the cache pid_2 of size 88
+The buggy address is located 4 bytes inside of
+ 88-byte region [ffff888094012a00, ffff888094012a58)
+The buggy address belongs to the page:
+page:ffffea0002500480 count:1 mapcount:0 mapping:ffff88809a483080 index:0xffff888094012980
+flags: 0x1fffc0000000200(slab)
+raw: 01fffc0000000200 ffffea00018a3508 ffffea0002524a88 ffff88809a483080
+raw: ffff888094012980 ffff888094012000 000000010000001b 0000000000000000
+page dumped because: kasan: bad access detected
+
+Memory state around the buggy address:
+ ffff888094012900: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
+ ffff888094012980: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
+>ffff888094012a00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
+                   ^
+ ffff888094012a80: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
+ ffff888094012b00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
+
+Fixes: 4f82f45730c6 ("net ip6 flowlabel: Make owner a union of struct pid * and kuid_t")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Cc: Eric W. Biederman <ebiederm@xmission.com>
+Reported-by: syzbot <syzkaller@googlegroups.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/ip6_flowlabel.c |   18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+--- a/net/ipv6/ip6_flowlabel.c
++++ b/net/ipv6/ip6_flowlabel.c
+@@ -94,15 +94,21 @@ static struct ip6_flowlabel *fl_lookup(s
+       return fl;
+ }
++static void fl_free_rcu(struct rcu_head *head)
++{
++      struct ip6_flowlabel *fl = container_of(head, struct ip6_flowlabel, rcu);
++
++      if (fl->share == IPV6_FL_S_PROCESS)
++              put_pid(fl->owner.pid);
++      kfree(fl->opt);
++      kfree(fl);
++}
++
+ static void fl_free(struct ip6_flowlabel *fl)
+ {
+-      if (fl) {
+-              if (fl->share == IPV6_FL_S_PROCESS)
+-                      put_pid(fl->owner.pid);
+-              kfree(fl->opt);
+-              kfree_rcu(fl, rcu);
+-      }
++      if (fl)
++              call_rcu(&fl->rcu, fl_free_rcu);
+ }
+ static void fl_release(struct ip6_flowlabel *fl)
diff --git a/queue-4.9/ipv6-invert-flowlabel-sharing-check-in-process-and-user-mode.patch b/queue-4.9/ipv6-invert-flowlabel-sharing-check-in-process-and-user-mode.patch
new file mode 100644 (file)
index 0000000..9541b3a
--- /dev/null
@@ -0,0 +1,37 @@
+From foo@baz Sat 04 May 2019 11:50:27 AM CEST
+From: Willem de Bruijn <willemb@google.com>
+Date: Thu, 25 Apr 2019 12:06:54 -0400
+Subject: ipv6: invert flowlabel sharing check in process and user mode
+
+From: Willem de Bruijn <willemb@google.com>
+
+[ Upstream commit 95c169251bf734aa555a1e8043e4d88ec97a04ec ]
+
+A request for a flowlabel fails in process or user exclusive mode must
+fail if the caller pid or uid does not match. Invert the test.
+
+Previously, the test was unsafe wrt PID recycling, but indeed tested
+for inequality: fl1->owner != fl->owner
+
+Fixes: 4f82f45730c68 ("net ip6 flowlabel: Make owner a union of struct pid* and kuid_t")
+Signed-off-by: Willem de Bruijn <willemb@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/ip6_flowlabel.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/ipv6/ip6_flowlabel.c
++++ b/net/ipv6/ip6_flowlabel.c
+@@ -640,9 +640,9 @@ recheck:
+                               if (fl1->share == IPV6_FL_S_EXCL ||
+                                   fl1->share != fl->share ||
+                                   ((fl1->share == IPV6_FL_S_PROCESS) &&
+-                                   (fl1->owner.pid == fl->owner.pid)) ||
++                                   (fl1->owner.pid != fl->owner.pid)) ||
+                                   ((fl1->share == IPV6_FL_S_USER) &&
+-                                   uid_eq(fl1->owner.uid, fl->owner.uid)))
++                                   !uid_eq(fl1->owner.uid, fl->owner.uid)))
+                                       goto release;
+                               err = -ENOMEM;
diff --git a/queue-4.9/net-phy-marvell-fix-buffer-overrun-with-stats-counters.patch b/queue-4.9/net-phy-marvell-fix-buffer-overrun-with-stats-counters.patch
new file mode 100644 (file)
index 0000000..9fc2a83
--- /dev/null
@@ -0,0 +1,51 @@
+From foo@baz Sat 04 May 2019 11:25:56 AM CEST
+From: Andrew Lunn <andrew@lunn.ch>
+Date: Thu, 25 Apr 2019 00:33:00 +0200
+Subject: net: phy: marvell: Fix buffer overrun with stats counters
+
+From: Andrew Lunn <andrew@lunn.ch>
+
+[ Upstream commit fdfdf86720a34527f777cbe0d8599bf0528fa146 ]
+
+marvell_get_sset_count() returns how many statistics counters there
+are. If the PHY supports fibre, there are 3, otherwise two.
+
+marvell_get_strings() does not make this distinction, and always
+returns 3 strings. This then often results in writing past the end
+of the buffer for the strings.
+
+Fixes: 2170fef78a40 ("Marvell phy: add field to get errors from fiber link.")
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/phy/marvell.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/phy/marvell.c
++++ b/drivers/net/phy/marvell.c
+@@ -1429,9 +1429,10 @@ static int marvell_get_sset_count(struct
+ static void marvell_get_strings(struct phy_device *phydev, u8 *data)
+ {
++      int count = marvell_get_sset_count(phydev);
+       int i;
+-      for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++) {
++      for (i = 0; i < count; i++) {
+               memcpy(data + i * ETH_GSTRING_LEN,
+                      marvell_hw_stats[i].string, ETH_GSTRING_LEN);
+       }
+@@ -1470,9 +1471,10 @@ static u64 marvell_get_stat(struct phy_d
+ static void marvell_get_stats(struct phy_device *phydev,
+                             struct ethtool_stats *stats, u64 *data)
+ {
++      int count = marvell_get_sset_count(phydev);
+       int i;
+-      for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++)
++      for (i = 0; i < count; i++)
+               data[i] = marvell_get_stat(phydev, i);
+ }
diff --git a/queue-4.9/packet-validate-msg_namelen-in-send-directly.patch b/queue-4.9/packet-validate-msg_namelen-in-send-directly.patch
new file mode 100644 (file)
index 0000000..6e1e01b
--- /dev/null
@@ -0,0 +1,97 @@
+From foo@baz Sat 04 May 2019 11:50:27 AM CEST
+From: Willem de Bruijn <willemb@google.com>
+Date: Mon, 29 Apr 2019 11:53:18 -0400
+Subject: packet: validate msg_namelen in send directly
+
+From: Willem de Bruijn <willemb@google.com>
+
+[ Upstream commit 486efdc8f6ce802b27e15921d2353cc740c55451 ]
+
+Packet sockets in datagram mode take a destination address. Verify its
+length before passing to dev_hard_header.
+
+Prior to 2.6.14-rc3, the send code ignored sll_halen. This is
+established behavior. Directly compare msg_namelen to dev->addr_len.
+
+Change v1->v2: initialize addr in all paths
+
+Fixes: 6b8d95f1795c4 ("packet: validate address length if non-zero")
+Suggested-by: David Laight <David.Laight@aculab.com>
+Signed-off-by: Willem de Bruijn <willemb@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/packet/af_packet.c |   24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+--- a/net/packet/af_packet.c
++++ b/net/packet/af_packet.c
+@@ -2638,8 +2638,8 @@ static int tpacket_snd(struct packet_soc
+       void *ph;
+       DECLARE_SOCKADDR(struct sockaddr_ll *, saddr, msg->msg_name);
+       bool need_wait = !(msg->msg_flags & MSG_DONTWAIT);
++      unsigned char *addr = NULL;
+       int tp_len, size_max;
+-      unsigned char *addr;
+       void *data;
+       int len_sum = 0;
+       int status = TP_STATUS_AVAILABLE;
+@@ -2650,7 +2650,6 @@ static int tpacket_snd(struct packet_soc
+       if (likely(saddr == NULL)) {
+               dev     = packet_cached_dev_get(po);
+               proto   = po->num;
+-              addr    = NULL;
+       } else {
+               err = -EINVAL;
+               if (msg->msg_namelen < sizeof(struct sockaddr_ll))
+@@ -2660,10 +2659,13 @@ static int tpacket_snd(struct packet_soc
+                                               sll_addr)))
+                       goto out;
+               proto   = saddr->sll_protocol;
+-              addr    = saddr->sll_halen ? saddr->sll_addr : NULL;
+               dev = dev_get_by_index(sock_net(&po->sk), saddr->sll_ifindex);
+-              if (addr && dev && saddr->sll_halen < dev->addr_len)
+-                      goto out_put;
++              if (po->sk.sk_socket->type == SOCK_DGRAM) {
++                      if (dev && msg->msg_namelen < dev->addr_len +
++                                 offsetof(struct sockaddr_ll, sll_addr))
++                              goto out_put;
++                      addr = saddr->sll_addr;
++              }
+       }
+       err = -ENXIO;
+@@ -2834,7 +2836,7 @@ static int packet_snd(struct socket *soc
+       struct sk_buff *skb;
+       struct net_device *dev;
+       __be16 proto;
+-      unsigned char *addr;
++      unsigned char *addr = NULL;
+       int err, reserve = 0;
+       struct sockcm_cookie sockc;
+       struct virtio_net_hdr vnet_hdr = { 0 };
+@@ -2851,7 +2853,6 @@ static int packet_snd(struct socket *soc
+       if (likely(saddr == NULL)) {
+               dev     = packet_cached_dev_get(po);
+               proto   = po->num;
+-              addr    = NULL;
+       } else {
+               err = -EINVAL;
+               if (msg->msg_namelen < sizeof(struct sockaddr_ll))
+@@ -2859,10 +2860,13 @@ static int packet_snd(struct socket *soc
+               if (msg->msg_namelen < (saddr->sll_halen + offsetof(struct sockaddr_ll, sll_addr)))
+                       goto out;
+               proto   = saddr->sll_protocol;
+-              addr    = saddr->sll_halen ? saddr->sll_addr : NULL;
+               dev = dev_get_by_index(sock_net(sk), saddr->sll_ifindex);
+-              if (addr && dev && saddr->sll_halen < dev->addr_len)
+-                      goto out_unlock;
++              if (sock->type == SOCK_DGRAM) {
++                      if (dev && msg->msg_namelen < dev->addr_len +
++                                 offsetof(struct sockaddr_ll, sll_addr))
++                              goto out_unlock;
++                      addr = saddr->sll_addr;
++              }
+       }
+       err = -ENXIO;
index 285ef427caa7daa84d4020a0a8ee5e8c303f2410..af3a2cf5e4b9bddbcbbac1859a802f0be0a6a511 100644 (file)
@@ -1 +1,7 @@
 alsa-line6-use-dynamic-buffers.patch
+ipv4-ip_do_fragment-preserve-skb_iif-during-fragmentation.patch
+ipv6-flowlabel-wait-rcu-grace-period-before-put_pid.patch
+ipv6-invert-flowlabel-sharing-check-in-process-and-user-mode.patch
+packet-validate-msg_namelen-in-send-directly.patch
+bnxt_en-improve-multicast-address-setup-logic.patch
+net-phy-marvell-fix-buffer-overrun-with-stats-counters.patch