From: Herbert Xu <herbert@gondor.apana.org.au>
To: Khalid Masum <khalid.masum.92@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com,
Steffen Klassert <steffen.klassert@secunet.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel-mentees@lists.linuxfoundation.org,
Shuah Khan <skhan@linuxfoundation.org>,
syzbot+5ec9bb042ddfe9644773@syzkaller.appspotmail.com
Subject: Re: [PATCH v3] xfrm: Update ipcomp_scratches with NULL if not allocated
Date: Thu, 1 Sep 2022 12:17:59 +0800 [thread overview]
Message-ID: <YxAyd6++6oWPu9L1@gondor.apana.org.au> (raw)
In-Reply-To: <20220901040307.4674-1-khalid.masum.92@gmail.com>
On Thu, Sep 01, 2022 at 10:03:07AM +0600, Khalid Masum wrote:
>
> diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
> index cb40ff0ff28d..3774d07c5819 100644
> --- a/net/xfrm/xfrm_ipcomp.c
> +++ b/net/xfrm/xfrm_ipcomp.c
> @@ -203,6 +203,7 @@ static void ipcomp_free_scratches(void)
> vfree(*per_cpu_ptr(scratches, i));
>
> free_percpu(scratches);
> + ipcomp_scratches = NULL;
> }
Good catch! This is probably the root cause of all the crashes.
> static void * __percpu *ipcomp_alloc_scratches(void)
> @@ -215,7 +216,7 @@ static void * __percpu *ipcomp_alloc_scratches(void)
>
> scratches = alloc_percpu(void *);
> if (!scratches)
> - return NULL;
> + return ipcomp_scratches = NULL;
This is unnecessary as with your first hunk, ipcomp_scratches
is guaranteed to be NULL.
Thanks,
--
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
next prev parent reply other threads:[~2022-09-01 4:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-16 7:01 WARNING in __vunmap syzbot
2019-09-08 7:05 ` syzbot
2021-08-04 5:35 ` [syzbot] " syzbot
2022-08-31 1:41 ` [PATCH] xfrm: Don't increase scratch users if allocation fails Khalid Masum
2022-08-31 9:13 ` Herbert Xu
2022-08-31 12:01 ` Khalid Masum
2022-08-31 14:29 ` [PATCH v2] xfrm: ipcomp: Update ipcomp_scratches with NULL if alloc fails Khalid Masum
2022-08-31 14:58 ` Greg KH
2022-09-01 4:03 ` [PATCH v3] xfrm: Update ipcomp_scratches with NULL if not allocated Khalid Masum
2022-09-01 4:17 ` Herbert Xu [this message]
2022-09-01 7:03 ` Khalid Masum
2022-09-01 7:12 ` [PATCH v4] xfrm: Update ipcomp_scratches with NULL when freed Khalid Masum
2022-09-01 7:48 ` Herbert Xu
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=YxAyd6++6oWPu9L1@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=khalid.masum.92@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=skhan@linuxfoundation.org \
--cc=steffen.klassert@secunet.com \
--cc=syzbot+5ec9bb042ddfe9644773@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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
all inboxes | Powered by JetHome®