]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2022 16:44:21 +0000 (18:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2022 16:44:21 +0000 (18:44 +0200)
added patches:
cifs-don-t-send-down-the-destination-address-to-sendmsg-for-a-sock_stream.patch
cifs-revalidate-mapping-when-doing-direct-writes.patch

queue-5.4/cifs-don-t-send-down-the-destination-address-to-sendmsg-for-a-sock_stream.patch [new file with mode: 0644]
queue-5.4/cifs-revalidate-mapping-when-doing-direct-writes.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/cifs-don-t-send-down-the-destination-address-to-sendmsg-for-a-sock_stream.patch b/queue-5.4/cifs-don-t-send-down-the-destination-address-to-sendmsg-for-a-sock_stream.patch
new file mode 100644 (file)
index 0000000..32b29d2
--- /dev/null
@@ -0,0 +1,34 @@
+From 17d3df38dc5f4cec9b0ac6eb79c1859b6e2693a4 Mon Sep 17 00:00:00 2001
+From: Stefan Metzmacher <metze@samba.org>
+Date: Wed, 14 Sep 2022 05:25:46 +0200
+Subject: cifs: don't send down the destination address to sendmsg for a SOCK_STREAM
+
+From: Stefan Metzmacher <metze@samba.org>
+
+commit 17d3df38dc5f4cec9b0ac6eb79c1859b6e2693a4 upstream.
+
+This is ignored anyway by the tcp layer.
+
+Signed-off-by: Stefan Metzmacher <metze@samba.org>
+Cc: stable@vger.kernel.org
+Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
+Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/transport.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/cifs/transport.c
++++ b/fs/cifs/transport.c
+@@ -209,8 +209,8 @@ smb_send_kvec(struct TCP_Server_Info *se
+       *sent = 0;
+-      smb_msg->msg_name = (struct sockaddr *) &server->dstaddr;
+-      smb_msg->msg_namelen = sizeof(struct sockaddr);
++      smb_msg->msg_name = NULL;
++      smb_msg->msg_namelen = 0;
+       smb_msg->msg_control = NULL;
+       smb_msg->msg_controllen = 0;
+       if (server->noblocksnd)
diff --git a/queue-5.4/cifs-revalidate-mapping-when-doing-direct-writes.patch b/queue-5.4/cifs-revalidate-mapping-when-doing-direct-writes.patch
new file mode 100644 (file)
index 0000000..cf098bc
--- /dev/null
@@ -0,0 +1,37 @@
+From 7500a99281dfed2d4a84771c933bcb9e17af279b Mon Sep 17 00:00:00 2001
+From: Ronnie Sahlberg <lsahlber@redhat.com>
+Date: Mon, 12 Sep 2022 13:04:46 +1000
+Subject: cifs: revalidate mapping when doing direct writes
+
+From: Ronnie Sahlberg <lsahlber@redhat.com>
+
+commit 7500a99281dfed2d4a84771c933bcb9e17af279b upstream.
+
+Kernel bugzilla: 216301
+
+When doing direct writes we need to also invalidate the mapping in case
+we have a cached copy of the affected page(s) in memory or else
+subsequent reads of the data might return the old/stale content
+before we wrote an update to the server.
+
+Cc: stable@vger.kernel.org
+Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/file.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/fs/cifs/file.c
++++ b/fs/cifs/file.c
+@@ -3194,6 +3194,9 @@ static ssize_t __cifs_writev(
+ ssize_t cifs_direct_writev(struct kiocb *iocb, struct iov_iter *from)
+ {
++      struct file *file = iocb->ki_filp;
++
++      cifs_revalidate_mapping(file->f_inode);
+       return __cifs_writev(iocb, from, true);
+ }
index fee155f86d9bf63095ffce35b2b45170628a7b77..2d5943b1b03209c2dd9d2f20698c110daf68e782 100644 (file)
@@ -9,3 +9,5 @@ efi-libstub-disable-struct-randomization.patch
 alsa-pcm-oss-fix-race-at-sndctl_dsp_sync.patch
 task_stack-x86-cea-force-inline-stack-helpers.patch
 tracing-hold-caller_addr-to-hardirq_-enable-disable-.patch
+cifs-revalidate-mapping-when-doing-direct-writes.patch
+cifs-don-t-send-down-the-destination-address-to-sendmsg-for-a-sock_stream.patch