public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: kernel test robot <lkp@intel.com>,
	oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: net/netfilter/nft_synproxy.c:51:40: sparse: sparse: cast to non-scalar
Date: Mon, 9 Mar 2026 22:46:25 +0100	[thread overview]
Message-ID: <aa8_sTGkwVy3o5ww@strlen.de> (raw)
In-Reply-To: <ea2aaffb-c124-4fcb-9070-a13603f06393@suse.de>

Fernando Fernandez Mancera <fmancera@suse.de> wrote:
> Hi,
> 
> Is this a false positive? nf_synproxy_info struct is smaller than the 
> word size and therefore READ_ONCE() should be fine. I guess I can use 
> READ_ONCE() for every struct field.
> 
> What do you think Florian?

We shouldn't do per-field accesses here, but one, single READ so
the datapath sees all new fields or the old ones, and no mix of the
two (albeit that would be harmless here).

Can you experiment with a cast to u32 to get rid if the warning?

That said, we have so many sparse warnings that getting rid of this
warning isn't high-prio, I think the code is fine as-is.

      reply	other threads:[~2026-03-09 21:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 12:21 net/netfilter/nft_synproxy.c:51:40: sparse: sparse: cast to non-scalar kernel test robot
2026-03-08 19:15 ` Fernando Fernandez Mancera
2026-03-09 21:46   ` Florian Westphal [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=aa8_sTGkwVy3o5ww@strlen.de \
    --to=fw@strlen.de \
    --cc=fmancera@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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