From: Herbert Xu <herbert@gondor.apana.org.au>
To: VanGiang Nguyen <vangiang.nguyen@rohde-schwarz.com>
Cc: steffen.klassert@secunet.com, daniel.m.jordan@oracle.com,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] padata: use integer wrap around to prevent deadlock on seq_nr overflow
Date: Sat, 24 Aug 2024 21:42:09 +0800 [thread overview]
Message-ID: <ZsnjMWrFP0IYJmaa@gondor.apana.org.au> (raw)
In-Reply-To: <a16995232eda4d39812f4bd94d9fb846@rohde-schwarz.com>
VanGiang Nguyen <vangiang.nguyen@rohde-schwarz.com> wrote:
> When submitting more than 2^32 padata objects to padata_do_serial, the
> current sorting implementation incorrectly sorts padata objects with
> overflowed seq_nr, causing them to be placed before existing objects in
> the reorder list. This leads to a deadlock in the serialization process
> as padata_find_next cannot match padata->seq_nr and pd->processed
> because the padata instance with overflowed seq_nr will be selected
> next.
>
> To fix this, we use an unsigned integer wrap around to correctly sort
> padata objects in scenarios with integer overflow.
>
> Co-developed-by: Christian Gafert <christian.gafert@rohde-schwarz.com>
> Signed-off-by: Christian Gafert <christian.gafert@rohde-schwarz.com>
> Co-developed-by: Max Ferger <max.ferger@rohde-schwarz.com>
> Signed-off-by: Max Ferger <max.ferger@rohde-schwarz.com>
> Signed-off-by: Van Giang Nguyen <vangiang.nguyen@rohde-schwarz.com>
> ---
> kernel/padata.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Patch applied. 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
prev parent reply other threads:[~2024-08-24 13:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 6:21 VanGiang Nguyen
2024-08-13 17:00 ` Daniel Jordan
2024-08-15 9:38 ` [PATCH v2] " VanGiang Nguyen
2024-08-24 13:42 ` Herbert Xu [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=ZsnjMWrFP0IYJmaa@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=daniel.m.jordan@oracle.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=vangiang.nguyen@rohde-schwarz.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®