netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org,
	Steffen Klassert <steffen.klassert@secunet.com>,
	syzbot+7ed9d47e15e88581dc5b@syzkaller.appspotmail.com
Subject: Re: [PATCH ipsec 1/2] xfrm: state: initialize state_ptrs earlier in xfrm_state_find
Date: Fri, 23 May 2025 20:05:00 +0200	[thread overview]
Message-ID: <aDC4zH_iZ5ss08uK@strlen.de> (raw)
In-Reply-To: <73c9e0ad005210c0813316008ec69fe3da1bd4ba.1748001837.git.sd@queasysnail.net>

Sabrina Dubroca <sd@queasysnail.net> wrote:
> In case of preemption, xfrm_state_look_at will find a different
> pcpu_id and look up states for that other CPU. If we matched a state
> for CPU2 in the state_cache while the lookup started on CPU1, we will
> jump to "found", but the "best" state that we got will be ignored and
> we will enter the "acquire" block. This block uses state_ptrs, which
> isn't initialized at this point.

Yep, I missed the "goto" and cc doesn't complain either.

> Let's initialize state_ptrs just after taking rcu_read_lock. This will
> also prevent a possible misuse in the future, if someone adjusts this
> function.

Thanks for fixing this bug.

Reviewed-by: Florian Westphal <fw@strlen.de>

  reply	other threads:[~2025-05-23 18:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 15:11 [PATCH ipsec 0/2] xfrm: fixes for xfrm_state_find under preemption Sabrina Dubroca
2025-05-23 15:11 ` [PATCH ipsec 1/2] xfrm: state: initialize state_ptrs earlier in xfrm_state_find Sabrina Dubroca
2025-05-23 18:05   ` Florian Westphal [this message]
2025-05-23 15:11 ` [PATCH ipsec 2/2] xfrm: state: use a consistent pcpu_id " Sabrina Dubroca
2025-05-23 18:12   ` Florian Westphal
2025-05-26  6:28   ` Steffen Klassert
2025-05-26 13:57     ` Florian Westphal
2025-05-26 12:17       ` Steffen Klassert
2025-06-10  7:55 ` [PATCH ipsec 0/2] xfrm: fixes for xfrm_state_find under preemption Steffen Klassert

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=aDC4zH_iZ5ss08uK@strlen.de \
    --to=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    --cc=steffen.klassert@secunet.com \
    --cc=syzbot+7ed9d47e15e88581dc5b@syzkaller.appspotmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).