From: Fedor Pchelkin <pchelkin@ispras.ru>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Robin van der Gracht <robin@protonic.nl>,
Oleksij Rempel <linux@rempel-privat.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Oliver Hartkopp <socketcan@hartkopp.net>,
Marc Kleine-Budde <mkl@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Elenita Hinds <ecathinds@gmail.com>,
Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Alexey Khoroshilov <khoroshilov@ispras.ru>,
ldv-project@linuxtesting.org
Subject: Re: [PATCH] can: j1939: Remove unnecessary WARN_ON_ONCE in j1939_sk_queue_activate_next_locked()
Date: Thu, 28 Jul 2022 19:14:43 +0300 [thread overview]
Message-ID: <7ea40c0e-e696-3537-c2a4-a8eccf4695d0@ispras.ru> (raw)
In-Reply-To: <20220720191357.GB5600@pengutronix.de>
Hello Oleksij,
I'm sorry for late answering.
On 20.07.2022 22:13, Oleksij Rempel wrote:
>> Are you working on some system where this use case is valid?
No, we are fuzzing the kernel and analyzing different warnings and
crashes.
On 20.07.2022 22:13, Oleksij Rempel wrote:
> yes
Well, there is a long story about where and for which purposes the
kernel warning macros should be correctly used and, overall,
WARN_ON_ONCE is not intended for user-space notification.
Linus Torvalds wrote:
> WARN_ON() should only be used for "This cannot happen, but if it does,
> I want to know how we got here".
>
> So if that j1939 thing is something that can be triggered by a user,
> then the backtrace should be reported to the driver maintainer, and
> then either
>
> (a) the WARN_ON_ONCE() should just be removed ("ok, this can happen,
> we understand why it can happen, and it's fine")
>
> (b) the problem the WARN_ON_ONCE() reports about should be made
> impossible some way
>
> (c) it might be downgraded to a pr_warn() if people really want to
> tell user space that "guys, you're doing something wrong" and it's
> considered a useful warning.
So WARN_ON_ONCE should be replaced with a more gentle variant - I think
pr_warn_once would suit this case. I've prepared a new patch for that,
it will follow this email.
Could you also look at the patch - [PATCH] can: j1939: fix memory leak
of skbs - which I sent you on 08.07.2022, please?
next prev parent reply other threads:[~2022-07-28 16:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 11:06 [PATCH] can: j1939: Remove unnecessary WARN_ON_ONCE in j1939_sk_queue_activate_next_locked() Fedor Pchelkin
2022-07-20 19:13 ` Oleksij Rempel
2022-07-28 16:14 ` Fedor Pchelkin [this message]
2022-07-28 16:34 ` [PATCH] can: j1939: Replace WARN_ON_ONCE with pr_warn_once() " Fedor Pchelkin
2022-07-28 16:58 ` Oleksij Rempel
2022-07-29 14:06 ` [PATCH v2] can: j1939: Replace WARN_ON_ONCE with netdev_warn_once() " Fedor Pchelkin
2022-07-29 14:26 ` Oleksij Rempel
2022-07-29 14:36 ` Fedor Pchelkin
2022-08-08 8:06 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7ea40c0e-e696-3537-c2a4-a8eccf4695d0@ispras.ru \
--to=pchelkin@ispras.ru \
--cc=davem@davemloft.net \
--cc=dev.kurt@vandijck-laurijssen.be \
--cc=ecathinds@gmail.com \
--cc=kernel@pengutronix.de \
--cc=khoroshilov@ispras.ru \
--cc=kuba@kernel.org \
--cc=ldv-project@linuxtesting.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rempel-privat.de \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=robin@protonic.nl \
--cc=socketcan@hartkopp.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox