All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: guzebing <guzebing1612@gmail.com>, tytso@mit.edu
Cc: adilger.kernel@dilger.ca, libaokun@linux.alibaba.com,
	jack@suse.cz, ojaswin@linux.ibm.com, yi.zhang@huawei.com,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	guzebing <guzebing1612@gmail.com>
Subject: Re: [PATCH] ext4: fix reserved group initialization
Date: Tue, 11 Aug 2026 08:20:32 +0530	[thread overview]
Message-ID: <tsp1jrpj.ritesh.list@gmail.com> (raw)
In-Reply-To: <20260811021848.1821435-1-guzebing1612@gmail.com>

guzebing <guzebing1612@gmail.com> writes:

> ext4 initializes the in-memory reserved uid and gid from the on-disk
> default reserved id fields during mount. The s_resgid assignment
> accidentally uses ext4_get_resuid(), so the reserved group is initialized
> from the reserved uid instead of the reserved gid.
>
> As a result, members of the configured reserved group can be denied access
> to reserved blocks, while members of a group whose gid matches the
> reserved uid can be incorrectly allowed to use them.
>
> Initialize s_resgid with ext4_get_resgid() instead.
>
> Fixes: 12c84dd4d308 ("ext4: add support for 32-bit default reserved uid and gid values")
> Signed-off-by: guzebing <guzebing1612@gmail.com>

This was posted before [1] and looks it already landed in ext4's dev
branch [2].

[1]: https://lore.kernel.org/all/20260727104103.28916-1-liujiazi@amazon.com/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?h=dev&id=c87abbab6147dcc5aa1fd8f2a61734d58d8b99ec

-ritesh

> ---
>  fs/ext4/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 245f67d10ded3..63de62a75a543 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -5369,7 +5369,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
>  	ext4_set_def_opts(sb, es);
>  
>  	sbi->s_resuid = make_kuid(&init_user_ns, ext4_get_resuid(es));
> -	sbi->s_resgid = make_kgid(&init_user_ns, ext4_get_resuid(es));
> +	sbi->s_resgid = make_kgid(&init_user_ns, ext4_get_resgid(es));
>  	sbi->s_commit_interval = JBD2_DEFAULT_MAX_COMMIT_AGE * HZ;
>  	sbi->s_min_batch_time = EXT4_DEF_MIN_BATCH_TIME;
>  	sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME;
>
> base-commit: 06cf61899d6498b33e4b7c87d99d5bd471ccc375
> -- 
> 2.20.1

  reply	other threads:[~2026-08-11  2:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  2:18 [PATCH] ext4: fix reserved group initialization guzebing
2026-08-11  2:50 ` Ritesh Harjani [this message]
2026-08-11  8:09   ` guzebing

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=tsp1jrpj.ritesh.list@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=guzebing1612@gmail.com \
    --cc=jack@suse.cz \
    --cc=libaokun@linux.alibaba.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=tytso@mit.edu \
    --cc=yi.zhang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.