lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 16 Jan 2024 14:32:32 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Subramanya Swamy <subramanya.swamy.linux@...il.com>, corbet@....net,
 asml.silence@...il.com, ribalda@...omium.org, rostedt@...dmis.org,
 bhe@...hat.com, akpm@...ux-foundation.org, matteorizzo@...gle.com,
 ardb@...nel.org, alexghiti@...osinc.com, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, io-uring@...r.kernel.org
Subject: Re: [PATCH] iouring:added boundary value check for io_uring_group
 systl

On 1/15/24 5:49 AM, Subramanya Swamy wrote:
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> index 09b6d860deba..0ed91b69643d 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -146,7 +146,9 @@ static void io_queue_sqe(struct io_kiocb *req);
>  struct kmem_cache *req_cachep;
>  
>  static int __read_mostly sysctl_io_uring_disabled;
> -static int __read_mostly sysctl_io_uring_group = -1;
> +static unsigned int __read_mostly sysctl_io_uring_group;
> +static unsigned int min_gid;
> +static unsigned int max_gid  = 4294967294;  /*4294967294 is the max guid*/

As per the compile bot, these need to be under CONFIG_SYSCTL. I'd
recommend just moving them a few lines further down to do that.

I think this would be cleaner:

static unsigned int max_gid = ((gid_t) ~0U) - 1;

however, as it explains why the value is what it is rather than being
some magic constant.

-- 
Jens Axboe


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ