From: Stefan Metzmacher <[email protected]>
To: Matthew Wilcox <[email protected]>,
Pavel Begunkov <[email protected]>
Cc: yangerkun <[email protected]>,
[email protected], [email protected], [email protected]
Subject: Re: [PATCH 1/2] io_uring: fix UAF for personality_idr
Date: Mon, 8 Mar 2021 14:57:53 +0100 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Hi Matthew,
> - ret = idr_alloc_cyclic(&ctx->personality_idr, (void *) creds, 1,
> - USHRT_MAX, GFP_KERNEL);
> - if (ret < 0)
> - put_cred(creds);
> + ret = xa_alloc_cyclic(&ctx->personalities, &id, (void *)creds,
> + XA_LIMIT(0, USHRT_MAX), &ctx->pers_next, GFP_KERNEL);
> + if (!ret)
> + return id;
> + put_cred(creds);
> return ret;
I guess this should be XA_LIMIT(1, USHRT_MAX) instead?
'0' should not be a valid id.
metze
prev parent reply other threads:[~2021-03-08 13:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 6:59 [PATCH 1/2] io_uring: fix UAF for personality_idr yangerkun
2021-03-08 6:59 ` [PATCH 2/2] io_uring: fix UAF for io_buffer_idr yangerkun
2021-03-08 7:04 ` [PATCH 1/2] io_uring: fix UAF for personality_idr yangerkun
2021-03-08 10:46 ` Pavel Begunkov
2021-03-08 13:20 ` Matthew Wilcox
2021-03-08 13:54 ` Pavel Begunkov
2021-03-08 14:12 ` Matthew Wilcox
2021-03-08 13:57 ` Stefan Metzmacher [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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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