public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Wentao Liang <vulab@iscas.ac.cn>,
	luciano.coelho@intel.com, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] mac80211: Add null pointer check for ieee80211_link_get_chanctx()
Date: Mon, 26 May 2025 12:25:37 +0200	[thread overview]
Message-ID: <2025052607-hertz-duly-cca2@gregkh> (raw)
In-Reply-To: <293fe5ea564a98113443bbe93e6022c5bb6dd747.camel@sipsolutions.net>

On Mon, May 26, 2025 at 11:56:16AM +0200, Johannes Berg wrote:
> On Mon, 2025-05-26 at 11:50 +0200, Johannes Berg wrote:
> > 
> > I still very much disagree with you and _will_ keep adding warnings to
> > the wireless stack. This would be one of those places where it's totally
> > warranted, because it's actually impossible that this happens, for it to
> > something else would have to be changed to go wrong in how this is
> > called, for example.
> 
> And come to think of it, cases like this are exactly why some people
> decide to crash the system on warnings. It's things that the developers
> thought were impossible, but should be double-checked. If we stop
> putting warnings on such places, then the decision to crash on warnings
> becomes entirely meaningless. So seems to me that just lashing out
> against warnings all the time is actually detrimental to the intent of
> such configurations?

If you can detect a problem, like this, and properly handle the issue,
handle the issue, do NOT crash the machine which causes the issue to be
uable to be noticed at all (all that is noticed is that the machine
rebooted.)

Only do a WARN() if this is something that you can not recover from for
whatever reason (data is lost anyway, system is hosed, etc.)  If you
just sprinkle these WARN_ON() calls around to be defensive in the
programming, that's counter-productive as you are setting yourself up to
make angry users of the system if they ever fire.

I have no problem with logging the error/issue in the kernel log, but if
a wifi driver decides to panic the box for something that it did
properly detect and could handle just fine, that's just not nice.

thanks,

greg k-h

      reply	other threads:[~2025-05-26 10:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-26  9:19 [PATCH v2] mac80211: Add null pointer check for ieee80211_link_get_chanctx() Wentao Liang
2025-05-26  9:35 ` Johannes Berg
2025-05-26  9:44 ` Greg KH
2025-05-26  9:50   ` Johannes Berg
2025-05-26  9:56     ` Johannes Berg
2025-05-26 10:25       ` Greg KH [this message]

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=2025052607-hertz-duly-cca2@gregkh \
    --to=greg@kroah.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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