]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Feb 2019 12:39:30 +0000 (13:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Feb 2019 12:39:30 +0000 (13:39 +0100)
added patches:
alsa-compress-fix-stop-handling-on-compressed-capture-streams.patch
alsa-hda-serialize-codec-registrations.patch
dccp-fool-proof-ccid_hc_x_parse_options.patch
enic-fix-checksum-validation-for-ipv6.patch
fuse-call-pipe_buf_release-under-pipe-lock.patch
fuse-decrement-nr_writeback_temp-on-the-right-page.patch
fuse-handle-zero-sized-retrieve-correctly.patch
net-dp83640-expire-old-tx-skb.patch
net-dsa-slave-don-t-propagate-flag-changes-on-down-slave-interfaces.patch
net-mlx5e-force-checksum_unnecessary-for-short-ethernet-frames.patch
net-systemport-fix-wol-with-password-after-deep-sleep.patch
rds-fix-refcount-bug-in-rds_sock_addref.patch
rxrpc-bad-unlock-balance-in-rxrpc_recvmsg.patch
skge-potential-memory-corruption-in-skge_get_regs.patch

15 files changed:
queue-4.14/alsa-compress-fix-stop-handling-on-compressed-capture-streams.patch [new file with mode: 0644]
queue-4.14/alsa-hda-serialize-codec-registrations.patch [new file with mode: 0644]
queue-4.14/dccp-fool-proof-ccid_hc_x_parse_options.patch [new file with mode: 0644]
queue-4.14/enic-fix-checksum-validation-for-ipv6.patch [new file with mode: 0644]
queue-4.14/fuse-call-pipe_buf_release-under-pipe-lock.patch [new file with mode: 0644]
queue-4.14/fuse-decrement-nr_writeback_temp-on-the-right-page.patch [new file with mode: 0644]
queue-4.14/fuse-handle-zero-sized-retrieve-correctly.patch [new file with mode: 0644]
queue-4.14/net-dp83640-expire-old-tx-skb.patch [new file with mode: 0644]
queue-4.14/net-dsa-slave-don-t-propagate-flag-changes-on-down-slave-interfaces.patch [new file with mode: 0644]
queue-4.14/net-mlx5e-force-checksum_unnecessary-for-short-ethernet-frames.patch [new file with mode: 0644]
queue-4.14/net-systemport-fix-wol-with-password-after-deep-sleep.patch [new file with mode: 0644]
queue-4.14/rds-fix-refcount-bug-in-rds_sock_addref.patch [new file with mode: 0644]
queue-4.14/rxrpc-bad-unlock-balance-in-rxrpc_recvmsg.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/skge-potential-memory-corruption-in-skge_get_regs.patch [new file with mode: 0644]

diff --git a/queue-4.14/alsa-compress-fix-stop-handling-on-compressed-capture-streams.patch b/queue-4.14/alsa-compress-fix-stop-handling-on-compressed-capture-streams.patch
new file mode 100644 (file)
index 0000000..760b21a
--- /dev/null
@@ -0,0 +1,51 @@
+From 4f2ab5e1d13d6aa77c55f4914659784efd776eb4 Mon Sep 17 00:00:00 2001
+From: Charles Keepax <ckeepax@opensource.cirrus.com>
+Date: Tue, 5 Feb 2019 16:29:40 +0000
+Subject: ALSA: compress: Fix stop handling on compressed capture streams
+
+From: Charles Keepax <ckeepax@opensource.cirrus.com>
+
+commit 4f2ab5e1d13d6aa77c55f4914659784efd776eb4 upstream.
+
+It is normal user behaviour to start, stop, then start a stream
+again without closing it. Currently this works for compressed
+playback streams but not capture ones.
+
+The states on a compressed capture stream go directly from OPEN to
+PREPARED, unlike a playback stream which moves to SETUP and waits
+for a write of data before moving to PREPARED. Currently however,
+when a stop is sent the state is set to SETUP for both types of
+streams. This leaves a capture stream in the situation where a new
+start can't be sent as that requires the state to be PREPARED and
+a new set_params can't be sent as that requires the state to be
+OPEN. The only option being to close the stream, and then reopen.
+
+Correct this issues by allowing snd_compr_drain_notify to set the
+state depending on the stream direction, as we already do in
+set_params.
+
+Fixes: 49bb6402f1aa ("ALSA: compress_core: Add support for capture streams")
+Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/sound/compress_driver.h |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/include/sound/compress_driver.h
++++ b/include/sound/compress_driver.h
+@@ -186,7 +186,11 @@ static inline void snd_compr_drain_notif
+       if (snd_BUG_ON(!stream))
+               return;
+-      stream->runtime->state = SNDRV_PCM_STATE_SETUP;
++      if (stream->direction == SND_COMPRESS_PLAYBACK)
++              stream->runtime->state = SNDRV_PCM_STATE_SETUP;
++      else
++              stream->runtime->state = SNDRV_PCM_STATE_PREPARED;
++
+       wake_up(&stream->runtime->sleep);
+ }
diff --git a/queue-4.14/alsa-hda-serialize-codec-registrations.patch b/queue-4.14/alsa-hda-serialize-codec-registrations.patch
new file mode 100644 (file)
index 0000000..3a14f10
--- /dev/null
@@ -0,0 +1,70 @@
+From 305a0ade180981686eec1f92aa6252a7c6ebb1cf Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 30 Jan 2019 17:46:03 +0100
+Subject: ALSA: hda - Serialize codec registrations
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 305a0ade180981686eec1f92aa6252a7c6ebb1cf upstream.
+
+In the current code, the codec registration may happen both at the
+codec bind time and the end of the controller probe time.  In a rare
+occasion, they race with each other, leading to Oops due to the still
+uninitialized card device.
+
+This patch introduces a simple flag to prevent the codec registration
+at the codec bind time as long as the controller probe is going on.
+The controller probe invokes snd_card_register() that does the whole
+registration task, and we don't need to register each piece
+beforehand.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_bind.c  |    3 ++-
+ sound/pci/hda/hda_codec.h |    1 +
+ sound/pci/hda/hda_intel.c |    2 ++
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/hda_bind.c
++++ b/sound/pci/hda/hda_bind.c
+@@ -109,7 +109,8 @@ static int hda_codec_driver_probe(struct
+       err = snd_hda_codec_build_controls(codec);
+       if (err < 0)
+               goto error_module;
+-      if (codec->card->registered) {
++      /* only register after the bus probe finished; otherwise it's racy */
++      if (!codec->bus->bus_probing && codec->card->registered) {
+               err = snd_card_register(codec->card);
+               if (err < 0)
+                       goto error_module;
+--- a/sound/pci/hda/hda_codec.h
++++ b/sound/pci/hda/hda_codec.h
+@@ -68,6 +68,7 @@ struct hda_bus {
+       unsigned int response_reset:1;  /* controller was reset */
+       unsigned int in_reset:1;        /* during reset operation */
+       unsigned int no_response_fallback:1; /* don't fallback at RIRB error */
++      unsigned int bus_probing :1;    /* during probing process */
+       int primary_dig_out_type;       /* primary digital out PCM type */
+       unsigned int mixer_assigned;    /* codec addr for mixer name */
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -2236,6 +2236,7 @@ static int azx_probe_continue(struct azx
+       int val;
+       int err;
++      to_hda_bus(bus)->bus_probing = 1;
+       hda->probe_continued = 1;
+       /* bind with i915 if needed */
+@@ -2341,6 +2342,7 @@ i915_power_fail:
+       if (err < 0)
+               hda->init_failed = 1;
+       complete_all(&hda->probe_wait);
++      to_hda_bus(bus)->bus_probing = 0;
+       return err;
+ }
diff --git a/queue-4.14/dccp-fool-proof-ccid_hc_x_parse_options.patch b/queue-4.14/dccp-fool-proof-ccid_hc_x_parse_options.patch
new file mode 100644 (file)
index 0000000..7560568
--- /dev/null
@@ -0,0 +1,106 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Eric Dumazet <edumazet@google.com>
+Date: Wed, 30 Jan 2019 11:39:41 -0800
+Subject: dccp: fool proof ccid_hc_[rt]x_parse_options()
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 9b1f19d810e92d6cdc68455fbc22d9f961a58ce1 ]
+
+Similarly to commit 276bdb82dedb ("dccp: check ccid before dereferencing")
+it is wise to test for a NULL ccid.
+
+kasan: CONFIG_KASAN_INLINE enabled
+kasan: GPF could be caused by NULL-ptr deref or user memory access
+general protection fault: 0000 [#1] PREEMPT SMP KASAN
+CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.0.0-rc3+ #37
+Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
+RIP: 0010:ccid_hc_tx_parse_options net/dccp/ccid.h:205 [inline]
+RIP: 0010:dccp_parse_options+0x8d9/0x12b0 net/dccp/options.c:233
+Code: c5 0f b6 75 b3 80 38 00 0f 85 d6 08 00 00 48 b9 00 00 00 00 00 fc ff df 48 8b 45 b8 4c 8b b8 f8 07 00 00 4c 89 f8 48 c1 e8 03 <80> 3c 08 00 0f 85 95 08 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b
+kobject: 'loop5' (0000000080f78fc1): kobject_uevent_env
+RSP: 0018:ffff8880a94df0b8 EFLAGS: 00010246
+RAX: 0000000000000000 RBX: ffff8880858ac723 RCX: dffffc0000000000
+RDX: 0000000000000100 RSI: 0000000000000007 RDI: 0000000000000001
+RBP: ffff8880a94df140 R08: 0000000000000001 R09: ffff888061b83a80
+R10: ffffed100c370752 R11: ffff888061b83a97 R12: 0000000000000026
+R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
+FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
+CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 00007f0defa33518 CR3: 000000008db5e000 CR4: 00000000001406e0
+kobject: 'loop5' (0000000080f78fc1): fill_kobj_path: path = '/devices/virtual/block/loop5'
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+Call Trace:
+ dccp_rcv_state_process+0x2b6/0x1af6 net/dccp/input.c:654
+ dccp_v4_do_rcv+0x100/0x190 net/dccp/ipv4.c:688
+ sk_backlog_rcv include/net/sock.h:936 [inline]
+ __sk_receive_skb+0x3a9/0xea0 net/core/sock.c:473
+ dccp_v4_rcv+0x10cb/0x1f80 net/dccp/ipv4.c:880
+ ip_protocol_deliver_rcu+0xb6/0xa20 net/ipv4/ip_input.c:208
+ ip_local_deliver_finish+0x23b/0x390 net/ipv4/ip_input.c:234
+ NF_HOOK include/linux/netfilter.h:289 [inline]
+ NF_HOOK include/linux/netfilter.h:283 [inline]
+ ip_local_deliver+0x1f0/0x740 net/ipv4/ip_input.c:255
+ dst_input include/net/dst.h:450 [inline]
+ ip_rcv_finish+0x1f4/0x2f0 net/ipv4/ip_input.c:414
+ NF_HOOK include/linux/netfilter.h:289 [inline]
+ NF_HOOK include/linux/netfilter.h:283 [inline]
+ ip_rcv+0xed/0x620 net/ipv4/ip_input.c:524
+ __netif_receive_skb_one_core+0x160/0x210 net/core/dev.c:4973
+ __netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5083
+ process_backlog+0x206/0x750 net/core/dev.c:5923
+ napi_poll net/core/dev.c:6346 [inline]
+ net_rx_action+0x76d/0x1930 net/core/dev.c:6412
+ __do_softirq+0x30b/0xb11 kernel/softirq.c:292
+ run_ksoftirqd kernel/softirq.c:654 [inline]
+ run_ksoftirqd+0x8e/0x110 kernel/softirq.c:646
+ smpboot_thread_fn+0x6ab/0xa10 kernel/smpboot.c:164
+ kthread+0x357/0x430 kernel/kthread.c:246
+ ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
+Modules linked in:
+---[ end trace 58a0ba03bea2c376 ]---
+RIP: 0010:ccid_hc_tx_parse_options net/dccp/ccid.h:205 [inline]
+RIP: 0010:dccp_parse_options+0x8d9/0x12b0 net/dccp/options.c:233
+Code: c5 0f b6 75 b3 80 38 00 0f 85 d6 08 00 00 48 b9 00 00 00 00 00 fc ff df 48 8b 45 b8 4c 8b b8 f8 07 00 00 4c 89 f8 48 c1 e8 03 <80> 3c 08 00 0f 85 95 08 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b
+RSP: 0018:ffff8880a94df0b8 EFLAGS: 00010246
+RAX: 0000000000000000 RBX: ffff8880858ac723 RCX: dffffc0000000000
+RDX: 0000000000000100 RSI: 0000000000000007 RDI: 0000000000000001
+RBP: ffff8880a94df140 R08: 0000000000000001 R09: ffff888061b83a80
+R10: ffffed100c370752 R11: ffff888061b83a97 R12: 0000000000000026
+R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
+FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
+CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 00007f0defa33518 CR3: 0000000009871000 CR4: 00000000001406e0
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reported-by: syzbot <syzkaller@googlegroups.com>
+Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/dccp/ccid.h |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/dccp/ccid.h
++++ b/net/dccp/ccid.h
+@@ -202,7 +202,7 @@ static inline void ccid_hc_tx_packet_rec
+ static inline int ccid_hc_tx_parse_options(struct ccid *ccid, struct sock *sk,
+                                          u8 pkt, u8 opt, u8 *val, u8 len)
+ {
+-      if (ccid->ccid_ops->ccid_hc_tx_parse_options == NULL)
++      if (!ccid || !ccid->ccid_ops->ccid_hc_tx_parse_options)
+               return 0;
+       return ccid->ccid_ops->ccid_hc_tx_parse_options(sk, pkt, opt, val, len);
+ }
+@@ -214,7 +214,7 @@ static inline int ccid_hc_tx_parse_optio
+ static inline int ccid_hc_rx_parse_options(struct ccid *ccid, struct sock *sk,
+                                          u8 pkt, u8 opt, u8 *val, u8 len)
+ {
+-      if (ccid->ccid_ops->ccid_hc_rx_parse_options == NULL)
++      if (!ccid || !ccid->ccid_ops->ccid_hc_rx_parse_options)
+               return 0;
+       return ccid->ccid_ops->ccid_hc_rx_parse_options(sk, pkt, opt, val, len);
+ }
diff --git a/queue-4.14/enic-fix-checksum-validation-for-ipv6.patch b/queue-4.14/enic-fix-checksum-validation-for-ipv6.patch
new file mode 100644 (file)
index 0000000..a2498e4
--- /dev/null
@@ -0,0 +1,31 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Govindarajulu Varadarajan <gvaradar@cisco.com>
+Date: Wed, 30 Jan 2019 06:59:00 -0800
+Subject: enic: fix checksum validation for IPv6
+
+From: Govindarajulu Varadarajan <gvaradar@cisco.com>
+
+[ Upstream commit 7596175e99b3d4bce28022193efd954c201a782a ]
+
+In case of IPv6 pkts, ipv4_csum_ok is 0. Because of this, driver does
+not set skb->ip_summed. So IPv6 rx checksum is not offloaded.
+
+Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/cisco/enic/enic_main.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/cisco/enic/enic_main.c
++++ b/drivers/net/ethernet/cisco/enic/enic_main.c
+@@ -1393,7 +1393,8 @@ static void enic_rq_indicate_buf(struct
+                * csum is correct or is zero.
+                */
+               if ((netdev->features & NETIF_F_RXCSUM) && !csum_not_calc &&
+-                  tcp_udp_csum_ok && ipv4_csum_ok && outer_csum_ok) {
++                  tcp_udp_csum_ok && outer_csum_ok &&
++                  (ipv4_csum_ok || ipv6)) {
+                       skb->ip_summed = CHECKSUM_UNNECESSARY;
+                       skb->csum_level = encap;
+               }
diff --git a/queue-4.14/fuse-call-pipe_buf_release-under-pipe-lock.patch b/queue-4.14/fuse-call-pipe_buf_release-under-pipe-lock.patch
new file mode 100644 (file)
index 0000000..caf1f92
--- /dev/null
@@ -0,0 +1,40 @@
+From 9509941e9c534920ccc4771ae70bd6cbbe79df1c Mon Sep 17 00:00:00 2001
+From: Jann Horn <jannh@google.com>
+Date: Sat, 12 Jan 2019 02:39:05 +0100
+Subject: fuse: call pipe_buf_release() under pipe lock
+
+From: Jann Horn <jannh@google.com>
+
+commit 9509941e9c534920ccc4771ae70bd6cbbe79df1c upstream.
+
+Some of the pipe_buf_release() handlers seem to assume that the pipe is
+locked - in particular, anon_pipe_buf_release() accesses pipe->tmp_page
+without taking any extra locks. From a glance through the callers of
+pipe_buf_release(), it looks like FUSE is the only one that calls
+pipe_buf_release() without having the pipe locked.
+
+This bug should only lead to a memory leak, nothing terrible.
+
+Fixes: dd3bb14f44a6 ("fuse: support splice() writing to fuse device")
+Cc: stable@vger.kernel.org
+Signed-off-by: Jann Horn <jannh@google.com>
+Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/fuse/dev.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/fs/fuse/dev.c
++++ b/fs/fuse/dev.c
+@@ -2024,8 +2024,10 @@ static ssize_t fuse_dev_splice_write(str
+       ret = fuse_dev_do_write(fud, &cs, len);
++      pipe_lock(pipe);
+       for (idx = 0; idx < nbuf; idx++)
+               pipe_buf_release(pipe, &bufs[idx]);
++      pipe_unlock(pipe);
+ out:
+       kfree(bufs);
diff --git a/queue-4.14/fuse-decrement-nr_writeback_temp-on-the-right-page.patch b/queue-4.14/fuse-decrement-nr_writeback_temp-on-the-right-page.patch
new file mode 100644 (file)
index 0000000..53cde1a
--- /dev/null
@@ -0,0 +1,32 @@
+From a2ebba824106dabe79937a9f29a875f837e1b6d4 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi@redhat.com>
+Date: Wed, 16 Jan 2019 10:27:59 +0100
+Subject: fuse: decrement NR_WRITEBACK_TEMP on the right page
+
+From: Miklos Szeredi <mszeredi@redhat.com>
+
+commit a2ebba824106dabe79937a9f29a875f837e1b6d4 upstream.
+
+NR_WRITEBACK_TEMP is accounted on the temporary page in the request, not
+the page cache page.
+
+Fixes: 8b284dc47291 ("fuse: writepages: handle same page rewrites")
+Cc: <stable@vger.kernel.org> # v3.13
+Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/fuse/file.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/fuse/file.c
++++ b/fs/fuse/file.c
+@@ -1777,7 +1777,7 @@ static bool fuse_writepage_in_flight(str
+               spin_unlock(&fc->lock);
+               dec_wb_stat(&bdi->wb, WB_WRITEBACK);
+-              dec_node_page_state(page, NR_WRITEBACK_TEMP);
++              dec_node_page_state(new_req->pages[0], NR_WRITEBACK_TEMP);
+               wb_writeout_inc(&bdi->wb);
+               fuse_writepage_free(fc, new_req);
+               fuse_request_free(new_req);
diff --git a/queue-4.14/fuse-handle-zero-sized-retrieve-correctly.patch b/queue-4.14/fuse-handle-zero-sized-retrieve-correctly.patch
new file mode 100644 (file)
index 0000000..63b7f9f
--- /dev/null
@@ -0,0 +1,40 @@
+From 97e1532ef81acb31c30f9e75bf00306c33a77812 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi@redhat.com>
+Date: Wed, 16 Jan 2019 10:27:59 +0100
+Subject: fuse: handle zero sized retrieve correctly
+
+From: Miklos Szeredi <mszeredi@redhat.com>
+
+commit 97e1532ef81acb31c30f9e75bf00306c33a77812 upstream.
+
+Dereferencing req->page_descs[0] will Oops if req->max_pages is zero.
+
+Reported-by: syzbot+c1e36d30ee3416289cc0@syzkaller.appspotmail.com
+Tested-by: syzbot+c1e36d30ee3416289cc0@syzkaller.appspotmail.com
+Fixes: b2430d7567a3 ("fuse: add per-page descriptor <offset, length> to fuse_req")
+Cc: <stable@vger.kernel.org> # v3.9
+Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/fuse/dev.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/fuse/dev.c
++++ b/fs/fuse/dev.c
+@@ -1691,7 +1691,6 @@ static int fuse_retrieve(struct fuse_con
+       req->in.h.nodeid = outarg->nodeid;
+       req->in.numargs = 2;
+       req->in.argpages = 1;
+-      req->page_descs[0].offset = offset;
+       req->end = fuse_retrieve_end;
+       index = outarg->offset >> PAGE_SHIFT;
+@@ -1706,6 +1705,7 @@ static int fuse_retrieve(struct fuse_con
+               this_num = min_t(unsigned, num, PAGE_SIZE - offset);
+               req->pages[req->num_pages] = page;
++              req->page_descs[req->num_pages].offset = offset;
+               req->page_descs[req->num_pages].length = this_num;
+               req->num_pages++;
diff --git a/queue-4.14/net-dp83640-expire-old-tx-skb.patch b/queue-4.14/net-dp83640-expire-old-tx-skb.patch
new file mode 100644 (file)
index 0000000..a11cc27
--- /dev/null
@@ -0,0 +1,83 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Mon, 4 Feb 2019 11:20:29 +0100
+Subject: net: dp83640: expire old TX-skb
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+[ Upstream commit 53bc8d2af08654659abfadfd3e98eb9922ff787c ]
+
+During sendmsg() a cloned skb is saved via dp83640_txtstamp() in
+->tx_queue. After the NIC sends this packet, the PHY will reply with a
+timestamp for that TX packet. If the cable is pulled at the right time I
+don't see that packet. It might gets flushed as part of queue shutdown
+on NIC's side.
+Once the link is up again then after the next sendmsg() we enqueue
+another skb in dp83640_txtstamp() and have two on the list. Then the PHY
+will send a reply and decode_txts() attaches it to the first skb on the
+list.
+No crash occurs since refcounting works but we are one packet behind.
+linuxptp/ptp4l usually closes the socket and opens a new one (in such a
+timeout case) so those "stale" replies never get there. However it does
+not resume normal operation anymore.
+
+Purge old skbs in decode_txts().
+
+Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
+Acked-by: Richard Cochran <richardcochran@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/phy/dp83640.c |   13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/phy/dp83640.c
++++ b/drivers/net/phy/dp83640.c
+@@ -893,14 +893,14 @@ static void decode_txts(struct dp83640_p
+                       struct phy_txts *phy_txts)
+ {
+       struct skb_shared_hwtstamps shhwtstamps;
++      struct dp83640_skb_info *skb_info;
+       struct sk_buff *skb;
+-      u64 ns;
+       u8 overflow;
++      u64 ns;
+       /* We must already have the skb that triggered this. */
+-
++again:
+       skb = skb_dequeue(&dp83640->tx_queue);
+-
+       if (!skb) {
+               pr_debug("have timestamp but tx_queue empty\n");
+               return;
+@@ -915,6 +915,11 @@ static void decode_txts(struct dp83640_p
+               }
+               return;
+       }
++      skb_info = (struct dp83640_skb_info *)skb->cb;
++      if (time_after(jiffies, skb_info->tmo)) {
++              kfree_skb(skb);
++              goto again;
++      }
+       ns = phy2txts(phy_txts);
+       memset(&shhwtstamps, 0, sizeof(shhwtstamps));
+@@ -1466,6 +1471,7 @@ static bool dp83640_rxtstamp(struct phy_
+ static void dp83640_txtstamp(struct phy_device *phydev,
+                            struct sk_buff *skb, int type)
+ {
++      struct dp83640_skb_info *skb_info = (struct dp83640_skb_info *)skb->cb;
+       struct dp83640_private *dp83640 = phydev->priv;
+       switch (dp83640->hwts_tx_en) {
+@@ -1478,6 +1484,7 @@ static void dp83640_txtstamp(struct phy_
+               /* fall through */
+       case HWTSTAMP_TX_ON:
+               skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
++              skb_info->tmo = jiffies + SKB_TIMESTAMP_TIMEOUT;
+               skb_queue_tail(&dp83640->tx_queue, skb);
+               break;
diff --git a/queue-4.14/net-dsa-slave-don-t-propagate-flag-changes-on-down-slave-interfaces.patch b/queue-4.14/net-dsa-slave-don-t-propagate-flag-changes-on-down-slave-interfaces.patch
new file mode 100644 (file)
index 0000000..66fbecc
--- /dev/null
@@ -0,0 +1,53 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Rundong Ge <rdong.ge@gmail.com>
+Date: Sat, 2 Feb 2019 14:29:35 +0000
+Subject: net: dsa: slave: Don't propagate flag changes on down slave interfaces
+
+From: Rundong Ge <rdong.ge@gmail.com>
+
+[ Upstream commit 17ab4f61b8cd6f9c38e9d0b935d86d73b5d0d2b5 ]
+
+The unbalance of master's promiscuity or allmulti will happen after ifdown
+and ifup a slave interface which is in a bridge.
+
+When we ifdown a slave interface , both the 'dsa_slave_close' and
+'dsa_slave_change_rx_flags' will clear the master's flags. The flags
+of master will be decrease twice.
+In the other hand, if we ifup the slave interface again, since the
+slave's flags were cleared the 'dsa_slave_open' won't set the master's
+flag, only 'dsa_slave_change_rx_flags' that triggered by 'br_add_if'
+will set the master's flags. The flags of master is increase once.
+
+Only propagating flag changes when a slave interface is up makes
+sure this does not happen. The 'vlan_dev_change_rx_flags' had the
+same problem and was fixed, and changes here follows that fix.
+
+Fixes: 91da11f870f0 ("net: Distributed Switch Architecture protocol support")
+Signed-off-by: Rundong Ge <rdong.ge@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/dsa/slave.c |   12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -156,10 +156,14 @@ static void dsa_slave_change_rx_flags(st
+       struct dsa_slave_priv *p = netdev_priv(dev);
+       struct net_device *master = dsa_master_netdev(p);
+-      if (change & IFF_ALLMULTI)
+-              dev_set_allmulti(master, dev->flags & IFF_ALLMULTI ? 1 : -1);
+-      if (change & IFF_PROMISC)
+-              dev_set_promiscuity(master, dev->flags & IFF_PROMISC ? 1 : -1);
++      if (dev->flags & IFF_UP) {
++              if (change & IFF_ALLMULTI)
++                      dev_set_allmulti(master,
++                                       dev->flags & IFF_ALLMULTI ? 1 : -1);
++              if (change & IFF_PROMISC)
++                      dev_set_promiscuity(master,
++                                          dev->flags & IFF_PROMISC ? 1 : -1);
++      }
+ }
+ static void dsa_slave_set_rx_mode(struct net_device *dev)
diff --git a/queue-4.14/net-mlx5e-force-checksum_unnecessary-for-short-ethernet-frames.patch b/queue-4.14/net-mlx5e-force-checksum_unnecessary-for-short-ethernet-frames.patch
new file mode 100644 (file)
index 0000000..11b3be7
--- /dev/null
@@ -0,0 +1,71 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Cong Wang <xiyou.wangcong@gmail.com>
+Date: Mon, 3 Dec 2018 22:14:04 -0800
+Subject: net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames
+
+From: Cong Wang <xiyou.wangcong@gmail.com>
+
+[ Upstream commit e8c8b53ccaff568fef4c13a6ccaf08bf241aa01a ]
+
+When an ethernet frame is padded to meet the minimum ethernet frame
+size, the padding octets are not covered by the hardware checksum.
+Fortunately the padding octets are usually zero's, which don't affect
+checksum. However, we have a switch which pads non-zero octets, this
+causes kernel hardware checksum fault repeatedly.
+
+Prior to:
+commit '88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE ...")'
+skb checksum was forced to be CHECKSUM_NONE when padding is detected.
+After it, we need to keep skb->csum updated, like what we do for RXFCS.
+However, fixing up CHECKSUM_COMPLETE requires to verify and parse IP
+headers, it is not worthy the effort as the packets are so small that
+CHECKSUM_COMPLETE can't save anything.
+
+Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"),
+Cc: Eric Dumazet <edumazet@google.com>
+Cc: Tariq Toukan <tariqt@mellanox.com>
+Cc: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en_rx.c |   14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+@@ -646,6 +646,8 @@ static u32 mlx5e_get_fcs(const struct sk
+       return __get_unaligned_cpu32(fcs_bytes);
+ }
++#define short_frame(size) ((size) <= ETH_ZLEN + ETH_FCS_LEN)
++
+ static inline void mlx5e_handle_csum(struct net_device *netdev,
+                                    struct mlx5_cqe64 *cqe,
+                                    struct mlx5e_rq *rq,
+@@ -661,6 +663,17 @@ static inline void mlx5e_handle_csum(str
+               return;
+       }
++      /* CQE csum doesn't cover padding octets in short ethernet
++       * frames. And the pad field is appended prior to calculating
++       * and appending the FCS field.
++       *
++       * Detecting these padded frames requires to verify and parse
++       * IP headers, so we simply force all those small frames to be
++       * CHECKSUM_UNNECESSARY even if they are not padded.
++       */
++      if (short_frame(skb->len))
++              goto csum_unnecessary;
++
+       if (is_first_ethertype_ip(skb)) {
+               skb->ip_summed = CHECKSUM_COMPLETE;
+               skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
+@@ -672,6 +685,7 @@ static inline void mlx5e_handle_csum(str
+               return;
+       }
++csum_unnecessary:
+       if (likely((cqe->hds_ip_ext & CQE_L3_OK) &&
+                  (cqe->hds_ip_ext & CQE_L4_OK))) {
+               skb->ip_summed = CHECKSUM_UNNECESSARY;
diff --git a/queue-4.14/net-systemport-fix-wol-with-password-after-deep-sleep.patch b/queue-4.14/net-systemport-fix-wol-with-password-after-deep-sleep.patch
new file mode 100644 (file)
index 0000000..fab316e
--- /dev/null
@@ -0,0 +1,104 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Fri, 1 Feb 2019 13:23:38 -0800
+Subject: net: systemport: Fix WoL with password after deep sleep
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+[ Upstream commit 8dfb8d2cceb76b74ad5b58cc65c75994329b4d5e ]
+
+Broadcom STB chips support a deep sleep mode where all register
+contents are lost. Because we were stashing the MagicPacket password
+into some of these registers a suspend into that deep sleep then a
+resumption would not lead to being able to wake-up from MagicPacket with
+password again.
+
+Fix this by keeping a software copy of the password and program it
+during suspend.
+
+Fixes: 83e82f4c706b ("net: systemport: add Wake-on-LAN support")
+Signed-off-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/ethernet/broadcom/bcmsysport.c |   25 ++++++++++---------------
+ drivers/net/ethernet/broadcom/bcmsysport.h |    2 ++
+ 2 files changed, 12 insertions(+), 15 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bcmsysport.c
++++ b/drivers/net/ethernet/broadcom/bcmsysport.c
+@@ -519,7 +519,6 @@ static void bcm_sysport_get_wol(struct n
+                               struct ethtool_wolinfo *wol)
+ {
+       struct bcm_sysport_priv *priv = netdev_priv(dev);
+-      u32 reg;
+       wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE;
+       wol->wolopts = priv->wolopts;
+@@ -527,11 +526,7 @@ static void bcm_sysport_get_wol(struct n
+       if (!(priv->wolopts & WAKE_MAGICSECURE))
+               return;
+-      /* Return the programmed SecureOn password */
+-      reg = umac_readl(priv, UMAC_PSW_MS);
+-      put_unaligned_be16(reg, &wol->sopass[0]);
+-      reg = umac_readl(priv, UMAC_PSW_LS);
+-      put_unaligned_be32(reg, &wol->sopass[2]);
++      memcpy(wol->sopass, priv->sopass, sizeof(priv->sopass));
+ }
+ static int bcm_sysport_set_wol(struct net_device *dev,
+@@ -547,13 +542,8 @@ static int bcm_sysport_set_wol(struct ne
+       if (wol->wolopts & ~supported)
+               return -EINVAL;
+-      /* Program the SecureOn password */
+-      if (wol->wolopts & WAKE_MAGICSECURE) {
+-              umac_writel(priv, get_unaligned_be16(&wol->sopass[0]),
+-                          UMAC_PSW_MS);
+-              umac_writel(priv, get_unaligned_be32(&wol->sopass[2]),
+-                          UMAC_PSW_LS);
+-      }
++      if (wol->wolopts & WAKE_MAGICSECURE)
++              memcpy(priv->sopass, wol->sopass, sizeof(priv->sopass));
+       /* Flag the device and relevant IRQ as wakeup capable */
+       if (wol->wolopts) {
+@@ -2221,12 +2211,17 @@ static int bcm_sysport_suspend_to_wol(st
+       unsigned int timeout = 1000;
+       u32 reg;
+-      /* Password has already been programmed */
+       reg = umac_readl(priv, UMAC_MPD_CTRL);
+       reg |= MPD_EN;
+       reg &= ~PSW_EN;
+-      if (priv->wolopts & WAKE_MAGICSECURE)
++      if (priv->wolopts & WAKE_MAGICSECURE) {
++              /* Program the SecureOn password */
++              umac_writel(priv, get_unaligned_be16(&priv->sopass[0]),
++                          UMAC_PSW_MS);
++              umac_writel(priv, get_unaligned_be32(&priv->sopass[2]),
++                          UMAC_PSW_LS);
+               reg |= PSW_EN;
++      }
+       umac_writel(priv, reg, UMAC_MPD_CTRL);
+       /* Make sure RBUF entered WoL mode as result */
+--- a/drivers/net/ethernet/broadcom/bcmsysport.h
++++ b/drivers/net/ethernet/broadcom/bcmsysport.h
+@@ -11,6 +11,7 @@
+ #ifndef __BCM_SYSPORT_H
+ #define __BCM_SYSPORT_H
++#include <linux/ethtool.h>
+ #include <linux/if_vlan.h>
+ /* Receive/transmit descriptor format */
+@@ -754,6 +755,7 @@ struct bcm_sysport_priv {
+       unsigned int            crc_fwd:1;
+       u16                     rev;
+       u32                     wolopts;
++      u8                      sopass[SOPASS_MAX];
+       unsigned int            wol_irq_disabled:1;
+       /* MIB related fields */
diff --git a/queue-4.14/rds-fix-refcount-bug-in-rds_sock_addref.patch b/queue-4.14/rds-fix-refcount-bug-in-rds_sock_addref.patch
new file mode 100644 (file)
index 0000000..a87df49
--- /dev/null
@@ -0,0 +1,98 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Eric Dumazet <edumazet@google.com>
+Date: Thu, 31 Jan 2019 08:47:10 -0800
+Subject: rds: fix refcount bug in rds_sock_addref
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 6fa19f5637a6c22bc0999596bcc83bdcac8a4fa6 ]
+
+syzbot was able to catch a bug in rds [1]
+
+The issue here is that the socket might be found in a hash table
+but that its refcount has already be set to 0 by another cpu.
+
+We need to use refcount_inc_not_zero() to be safe here.
+
+[1]
+
+refcount_t: increment on 0; use-after-free.
+WARNING: CPU: 1 PID: 23129 at lib/refcount.c:153 refcount_inc_checked lib/refcount.c:153 [inline]
+WARNING: CPU: 1 PID: 23129 at lib/refcount.c:153 refcount_inc_checked+0x61/0x70 lib/refcount.c:151
+Kernel panic - not syncing: panic_on_warn set ...
+CPU: 1 PID: 23129 Comm: syz-executor3 Not tainted 5.0.0-rc4+ #53
+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+0x1db/0x2d0 lib/dump_stack.c:113
+ panic+0x2cb/0x65c kernel/panic.c:214
+ __warn.cold+0x20/0x48 kernel/panic.c:571
+ report_bug+0x263/0x2b0 lib/bug.c:186
+ fixup_bug arch/x86/kernel/traps.c:178 [inline]
+ fixup_bug arch/x86/kernel/traps.c:173 [inline]
+ do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
+ do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:290
+ invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:973
+RIP: 0010:refcount_inc_checked lib/refcount.c:153 [inline]
+RIP: 0010:refcount_inc_checked+0x61/0x70 lib/refcount.c:151
+Code: 1d 51 63 c8 06 31 ff 89 de e8 eb 1b f2 fd 84 db 75 dd e8 a2 1a f2 fd 48 c7 c7 60 9f 81 88 c6 05 31 63 c8 06 01 e8 af 65 bb fd <0f> 0b eb c1 90 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 54 49
+RSP: 0018:ffff8880a0cbf1e8 EFLAGS: 00010282
+RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffc90006113000
+RDX: 000000000001047d RSI: ffffffff81685776 RDI: 0000000000000005
+RBP: ffff8880a0cbf1f8 R08: ffff888097c9e100 R09: ffffed1015ce5021
+R10: ffffed1015ce5020 R11: ffff8880ae728107 R12: ffff8880723c20c0
+R13: ffff8880723c24b0 R14: dffffc0000000000 R15: ffffed1014197e64
+ sock_hold include/net/sock.h:647 [inline]
+ rds_sock_addref+0x19/0x20 net/rds/af_rds.c:675
+ rds_find_bound+0x97c/0x1080 net/rds/bind.c:82
+ rds_recv_incoming+0x3be/0x1430 net/rds/recv.c:362
+ rds_loop_xmit+0xf3/0x2a0 net/rds/loop.c:96
+ rds_send_xmit+0x1355/0x2a10 net/rds/send.c:355
+ rds_sendmsg+0x323c/0x44e0 net/rds/send.c:1368
+ sock_sendmsg_nosec net/socket.c:621 [inline]
+ sock_sendmsg+0xdd/0x130 net/socket.c:631
+ __sys_sendto+0x387/0x5f0 net/socket.c:1788
+ __do_sys_sendto net/socket.c:1800 [inline]
+ __se_sys_sendto net/socket.c:1796 [inline]
+ __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796
+ do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+RIP: 0033:0x458089
+Code: 6d b7 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
+RSP: 002b:00007fc266df8c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
+RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000458089
+RDX: 0000000000000000 RSI: 00000000204b3fff RDI: 0000000000000005
+RBP: 000000000073bf00 R08: 00000000202b4000 R09: 0000000000000010
+R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc266df96d4
+R13: 00000000004c56e4 R14: 00000000004d94a8 R15: 00000000ffffffff
+
+Fixes: cc4dfb7f70a3 ("rds: fix two RCU related problems")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reported-by: syzbot <syzkaller@googlegroups.com>
+Cc: Sowmini Varadhan <sowmini.varadhan@oracle.com>
+Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com>
+Cc: rds-devel@oss.oracle.com
+Cc: Cong Wang <xiyou.wangcong@gmail.com>
+Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/rds/bind.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/net/rds/bind.c
++++ b/net/rds/bind.c
+@@ -62,10 +62,10 @@ struct rds_sock *rds_find_bound(__be32 a
+       rcu_read_lock();
+       rs = rhashtable_lookup(&bind_hash_table, &key, ht_parms);
+-      if (rs && !sock_flag(rds_rs_to_sk(rs), SOCK_DEAD))
+-              rds_sock_addref(rs);
+-      else
++      if (rs && (sock_flag(rds_rs_to_sk(rs), SOCK_DEAD) ||
++                 !refcount_inc_not_zero(&rds_rs_to_sk(rs)->sk_refcnt)))
+               rs = NULL;
++
+       rcu_read_unlock();
+       rdsdebug("returning rs %p for %pI4:%u\n", rs, &addr,
diff --git a/queue-4.14/rxrpc-bad-unlock-balance-in-rxrpc_recvmsg.patch b/queue-4.14/rxrpc-bad-unlock-balance-in-rxrpc_recvmsg.patch
new file mode 100644 (file)
index 0000000..e85e315
--- /dev/null
@@ -0,0 +1,86 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Eric Dumazet <edumazet@google.com>
+Date: Mon, 4 Feb 2019 08:36:06 -0800
+Subject: rxrpc: bad unlock balance in rxrpc_recvmsg
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 6dce3c20ac429e7a651d728e375853370c796e8d ]
+
+When either "goto wait_interrupted;" or "goto wait_error;"
+paths are taken, socket lock has already been released.
+
+This patch fixes following syzbot splat :
+
+WARNING: bad unlock balance detected!
+5.0.0-rc4+ #59 Not tainted
+-------------------------------------
+syz-executor223/8256 is trying to release lock (sk_lock-AF_RXRPC) at:
+[<ffffffff86651353>] rxrpc_recvmsg+0x6d3/0x3099 net/rxrpc/recvmsg.c:598
+but there are no more locks to release!
+
+other info that might help us debug this:
+1 lock held by syz-executor223/8256:
+ #0: 00000000fa9ed0f4 (slock-AF_RXRPC){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline]
+ #0: 00000000fa9ed0f4 (slock-AF_RXRPC){+...}, at: release_sock+0x20/0x1c0 net/core/sock.c:2798
+
+stack backtrace:
+CPU: 1 PID: 8256 Comm: syz-executor223 Not tainted 5.0.0-rc4+ #59
+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_unlock_imbalance_bug kernel/locking/lockdep.c:3391 [inline]
+ print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3368
+ __lock_release kernel/locking/lockdep.c:3601 [inline]
+ lock_release+0x67e/0xa00 kernel/locking/lockdep.c:3860
+ sock_release_ownership include/net/sock.h:1471 [inline]
+ release_sock+0x183/0x1c0 net/core/sock.c:2808
+ rxrpc_recvmsg+0x6d3/0x3099 net/rxrpc/recvmsg.c:598
+ sock_recvmsg_nosec net/socket.c:794 [inline]
+ sock_recvmsg net/socket.c:801 [inline]
+ sock_recvmsg+0xd0/0x110 net/socket.c:797
+ __sys_recvfrom+0x1ff/0x350 net/socket.c:1845
+ __do_sys_recvfrom net/socket.c:1863 [inline]
+ __se_sys_recvfrom net/socket.c:1859 [inline]
+ __x64_sys_recvfrom+0xe1/0x1a0 net/socket.c:1859
+ do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+RIP: 0033:0x446379
+Code: e8 2c b3 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 2b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
+RSP: 002b:00007fe5da89fd98 EFLAGS: 00000246 ORIG_RAX: 000000000000002d
+RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446379
+RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
+RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000
+R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
+R13: 0000000000000000 R14: 0000000000000000 R15: 20c49ba5e353f7cf
+
+Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Cc: David Howells <dhowells@redhat.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/rxrpc/recvmsg.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/rxrpc/recvmsg.c
++++ b/net/rxrpc/recvmsg.c
+@@ -588,6 +588,7 @@ error_requeue_call:
+       }
+ error_no_call:
+       release_sock(&rx->sk);
++error_trace:
+       trace_rxrpc_recvmsg(call, rxrpc_recvmsg_return, 0, 0, 0, ret);
+       return ret;
+@@ -596,7 +597,7 @@ wait_interrupted:
+ wait_error:
+       finish_wait(sk_sleep(&rx->sk), &wait);
+       call = NULL;
+-      goto error_no_call;
++      goto error_trace;
+ }
+ /**
index e40e57aad412d899c8926e60ae073aa539988023..990d0ed6074d6d39f6422b76bf24f66b1af11837 100644 (file)
@@ -163,3 +163,17 @@ fs-epoll-drop-ovflist-branch-prediction.patch
 exec-load_script-don-t-blindly-truncate-shebang-stri.patch
 scripts-gdb-fix-lx-version-string-output.patch
 thermal-hwmon-inline-helpers-when-config_thermal_hwmon-is-not-set.patch
+dccp-fool-proof-ccid_hc_x_parse_options.patch
+enic-fix-checksum-validation-for-ipv6.patch
+net-dp83640-expire-old-tx-skb.patch
+rxrpc-bad-unlock-balance-in-rxrpc_recvmsg.patch
+skge-potential-memory-corruption-in-skge_get_regs.patch
+rds-fix-refcount-bug-in-rds_sock_addref.patch
+net-systemport-fix-wol-with-password-after-deep-sleep.patch
+net-mlx5e-force-checksum_unnecessary-for-short-ethernet-frames.patch
+net-dsa-slave-don-t-propagate-flag-changes-on-down-slave-interfaces.patch
+alsa-compress-fix-stop-handling-on-compressed-capture-streams.patch
+alsa-hda-serialize-codec-registrations.patch
+fuse-call-pipe_buf_release-under-pipe-lock.patch
+fuse-decrement-nr_writeback_temp-on-the-right-page.patch
+fuse-handle-zero-sized-retrieve-correctly.patch
diff --git a/queue-4.14/skge-potential-memory-corruption-in-skge_get_regs.patch b/queue-4.14/skge-potential-memory-corruption-in-skge_get_regs.patch
new file mode 100644 (file)
index 0000000..1b1d6c8
--- /dev/null
@@ -0,0 +1,37 @@
+From foo@baz Sun Feb 10 12:47:17 CET 2019
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Fri, 1 Feb 2019 11:28:16 +0300
+Subject: skge: potential memory corruption in skge_get_regs()
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+[ Upstream commit 294c149a209c6196c2de85f512b52ef50f519949 ]
+
+The "p" buffer is 0x4000 bytes long.  B3_RI_WTO_R1 is 0x190.  The value
+of "regs->len" is in the 1-0x4000 range.  The bug here is that
+"regs->len - B3_RI_WTO_R1" can be a negative value which would lead to
+memory corruption and an abrupt crash.
+
+Fixes: c3f8be961808 ("[PATCH] skge: expand ethtool debug register dump")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/marvell/skge.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/marvell/skge.c
++++ b/drivers/net/ethernet/marvell/skge.c
+@@ -152,8 +152,10 @@ static void skge_get_regs(struct net_dev
+       memset(p, 0, regs->len);
+       memcpy_fromio(p, io, B3_RAM_ADDR);
+-      memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1,
+-                    regs->len - B3_RI_WTO_R1);
++      if (regs->len > B3_RI_WTO_R1) {
++              memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1,
++                            regs->len - B3_RI_WTO_R1);
++      }
+ }
+ /* Wake on Lan only supported on Yukon chips with rev 1 or above */