public inbox for [email protected]
 help / color / mirror / Atom feed
From: Matthew Wilcox <[email protected]>
To: 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:12:39 +0000	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Mon, Mar 08, 2021 at 01:54:14PM +0000, Pavel Begunkov wrote:
> > +	ret = xa_alloc_cyclic(&ctx->personalities, &id, (void *)creds,
> > +			XA_LIMIT(0, USHRT_MAX), &ctx->pers_next, GFP_KERNEL);
> 
> ids are >=1, because 0 is kind of a reserved value for io_uring, so I guess
> 
> XA_LIMIT(1, USHRT_MAX)

+       xa_init_flags(&ctx->personalities, XA_FLAGS_ALLOC1);

takes care of not being able to allocate ID 0.

  reply	other threads:[~2021-03-08 14:14 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 [this message]
2021-03-08 13:57     ` Stefan Metzmacher

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] \
    /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