public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Florian Westphal <fw@strlen.de>,
	Dong Chenchen <dongchenchen2@huawei.com>,
	steffen.klassert@secunet.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	timo.teras@iki.fi, yuehaibing@huawei.com, weiyongjun1@huawei.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Patch net, v2] net: xfrm: skip policies marked as dead while reinserting policies
Date: Tue, 15 Aug 2023 11:05:57 +0300	[thread overview]
Message-ID: <20230815080557.GK22185@unreal> (raw)
In-Reply-To: <ZNsukMSQmzmXpgbS@gondor.apana.org.au>

On Tue, Aug 15, 2023 at 03:51:44PM +0800, Herbert Xu wrote:
> On Tue, Aug 15, 2023 at 10:30:33AM +0300, Leon Romanovsky wrote:
> >
> > But policy has, and we are not interested in validity of it as first
> > check in if (...) will be true for policy->walk.dead.
> > 
> > So it is safe to call to dir = xfrm_policy_id2dir(policy->index) even
> > for dead policy.
> 
> If you dereference policy->index on a walker object it will read memory
> before the start of the walker object.  That could do anything, perhaps
> even triggering a page fault.

Where do you see walker object? xfrm_policy_id2dir() is called on policy
object, which is defined as "struct xfrm_policy".

Thanks

> 
> Cheers,
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2023-08-15  8:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 14:00 [Patch net, v2] net: xfrm: skip policies marked as dead while reinserting policies Dong Chenchen
2023-08-14 14:12 ` Florian Westphal
2023-08-15  6:00 ` Leon Romanovsky
2023-08-15  6:04   ` Florian Westphal
2023-08-15  7:30     ` Leon Romanovsky
2023-08-15  7:51       ` Herbert Xu
2023-08-15  8:05         ` Leon Romanovsky [this message]
2023-08-15  9:13   ` Leon Romanovsky
2023-08-15 12:32     ` Leon Romanovsky
2023-08-15 18:19       ` Leon Romanovsky

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=20230815080557.GK22185@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dongchenchen2@huawei.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steffen.klassert@secunet.com \
    --cc=timo.teras@iki.fi \
    --cc=weiyongjun1@huawei.com \
    --cc=yuehaibing@huawei.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