From: Pavel Skripkin <paskripkin@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
pabeni@redhat.com, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org,
syzbot+cba21d50095623218389@syzkaller.appspotmail.com
Subject: Re: [PATCH] crypto: fix uninit-value in af_alg_free_resources
Date: Mon, 14 Aug 2023 21:04:15 +0300 [thread overview]
Message-ID: <a3721585-c38f-f222-9a0e-4b268a48491b@gmail.com> (raw)
In-Reply-To: <3954480.1692001609@warthog.procyon.org.uk>
Hi David,
David Howells <dhowells@redhat.com> says:
> Pavel Skripkin <paskripkin@gmail.com> wrote:
>
>> Syzbot was able to trigger use of uninitialized memory in
>> af_alg_free_resources.
>>
>> Bug is caused by missing initialization of rsgl->sgl.need_unpin before
>> adding to rsgl_list. Then in case of extract_iter_to_sg() failure, rsgl
>> is left with uninitialized need_unpin which is read during clean up
>
> Looks feasible :-).
>
>> + rsgl->sgl.need_unpin = 0;
>> +
>
> The blank line isn't really necessary and it's a bool, so can you use 'false'
> rather than '0'?
>
> Alternatively, it might be better to move:
>
> rsgl->sgl.need_unpin =
> iov_iter_extract_will_pin(&msg->msg_iter);
>
> up instead.
>
Thank you for review! I've just posted v2 :)
With regards,
Pavel Skripkin
next prev parent reply other threads:[~2023-08-14 18:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-13 12:23 Pavel Skripkin
2023-08-14 8:26 ` David Howells
2023-08-14 18:04 ` Pavel Skripkin [this message]
2023-08-14 18:03 ` [PATCH v2] " Pavel Skripkin
2023-08-18 10:33 ` Herbert Xu
2023-08-18 13:21 ` David Howells
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=a3721585-c38f-f222-9a0e-4b268a48491b@gmail.com \
--to=paskripkin@gmail.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+cba21d50095623218389@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
all inboxes | Powered by JetHome®