]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2023 10:30:08 +0000 (12:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2023 10:30:08 +0000 (12:30 +0200)
added patches:
can-isotp-isotp_sendmsg-fix-return-error-fix-on-tx-path.patch

queue-5.15/can-isotp-isotp_sendmsg-fix-return-error-fix-on-tx-path.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/can-isotp-isotp_sendmsg-fix-return-error-fix-on-tx-path.patch b/queue-5.15/can-isotp-isotp_sendmsg-fix-return-error-fix-on-tx-path.patch
new file mode 100644 (file)
index 0000000..9ca5669
--- /dev/null
@@ -0,0 +1,44 @@
+From e38910c0072b541a91954682c8b074a93e57c09b Mon Sep 17 00:00:00 2001
+From: Oliver Hartkopp <socketcan@hartkopp.net>
+Date: Wed, 7 Jun 2023 09:27:08 +0200
+Subject: can: isotp: isotp_sendmsg(): fix return error fix on TX path
+
+From: Oliver Hartkopp <socketcan@hartkopp.net>
+
+commit e38910c0072b541a91954682c8b074a93e57c09b upstream.
+
+With commit d674a8f123b4 ("can: isotp: isotp_sendmsg(): fix return
+error on FC timeout on TX path") the missing correct return value in
+the case of a protocol error was introduced.
+
+But the way the error value has been read and sent to the user space
+does not follow the common scheme to clear the error after reading
+which is provided by the sock_error() function. This leads to an error
+report at the following write() attempt although everything should be
+working.
+
+Fixes: d674a8f123b4 ("can: isotp: isotp_sendmsg(): fix return error on FC timeout on TX path")
+Reported-by: Carsten Schmidt <carsten.schmidt-achim@t-online.de>
+Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
+Link: https://lore.kernel.org/all/20230607072708.38809-1-socketcan@hartkopp.net
+Cc: stable@vger.kernel.org
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/can/isotp.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/net/can/isotp.c
++++ b/net/can/isotp.c
+@@ -992,8 +992,9 @@ static int isotp_sendmsg(struct socket *
+               /* wait for complete transmission of current pdu */
+               wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE);
+-              if (sk->sk_err)
+-                      return -sk->sk_err;
++              err = sock_error(sk);
++              if (err)
++                      return err;
+       }
+       return size;
index 01e9e6d8f41875451c2e4d8ff192cd9e1e54fcaf..2bf53fbaa323f576f6e58f41a57a1aace6e5e242 100644 (file)
@@ -5,3 +5,4 @@ mm-hwpoison-when-copy-on-write-hits-poison-take-page-offline.patch
 drm-amdgpu-set-vmbo-destroy-after-pt-bo-is-created.patch
 x86-microcode-amd-load-late-on-both-threads-too.patch
 x86-smp-use-dedicated-cache-line-for-mwait_play_dead.patch
+can-isotp-isotp_sendmsg-fix-return-error-fix-on-tx-path.patch