[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220728163429.214758-1-pchelkin@ispras.ru>
Date: Thu, 28 Jul 2022 19:34:29 +0300
From: Fedor Pchelkin <pchelkin@...ras.ru>
To: Robin van der Gracht <robin@...tonic.nl>,
Oleksij Rempel <linux@...pel-privat.de>
Cc: Fedor Pchelkin <pchelkin@...ras.ru>, kernel@...gutronix.de,
Oliver Hartkopp <socketcan@...tkopp.net>,
Marc Kleine-Budde <mkl@...gutronix.de>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Kurt Van Dijck <dev.kurt@...dijck-laurijssen.be>,
Bastian Stender <bst@...gutronix.de>,
linux-can@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Alexey Khoroshilov <khoroshilov@...ras.ru>,
ldv-project@...uxtesting.org
Subject: [PATCH] can: j1939: Replace WARN_ON_ONCE with pr_warn_once() in j1939_sk_queue_activate_next_locked()
We should warn user-space that it is doing something wrong when trying to
activate sessions with identical parameters but WARN_ON_ONCE macro can not
be used here as it serves a different purpose.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Fedor Pchelkin <pchelkin@...ras.ru>
Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
---
net/can/j1939/socket.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
index f5ecfdcf57b2..67e8b50b8bc1 100644
--- a/net/can/j1939/socket.c
+++ b/net/can/j1939/socket.c
@@ -178,7 +178,8 @@ static void j1939_sk_queue_activate_next_locked(struct j1939_session *session)
if (!first)
return;
- if (WARN_ON_ONCE(j1939_session_activate(first))) {
+ if (j1939_session_activate(first)) {
+ pr_warn_once("can: j1939: Identical session is already activated.\n");
first->err = -EBUSY;
goto activate_next;
} else {
--
2.25.1
Powered by blists - more mailing lists