From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB807202F65; Mon, 29 Dec 2025 16:23:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767025385; cv=none; b=QafZ97YRa8YgFrfBtC/NScwzpcJjjbJ1BsCxnyWqowWWi80WiMTWUkasKwqafKrG6S2d5t9zv99jgNZEAEAsxacdyGQL+Kpq0WuvAN81BY5xBEipz9nggNF2PE20+szX/N7qGKeNTWCqBg7ZwiRKU3fZxS5y8kDt8tQEWIC7VBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767025385; c=relaxed/simple; bh=HUbQSP1bljb9dIbPoHGgBY+r5GwNmFi8ztGKaEhWlUQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dSOh3kfWwN1uNCjq2Ig39FhHvUZQVFRD8viuFQFb5EE3mnN3PVy+PYIenuMae9g0bR8/2qdWAU510Adh8nJIvRzg0DqEPvj11XuVA1Rb5NOR1W7GXb4hIX2YLibRBxA6qjsQwL7d5HLf2Un97flVgn8cEQhQqJwPqX27bqX69P4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GzXLGsQO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GzXLGsQO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF577C4CEF7; Mon, 29 Dec 2025 16:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767025384; bh=HUbQSP1bljb9dIbPoHGgBY+r5GwNmFi8ztGKaEhWlUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GzXLGsQOYTv7u6v98DBFbX2GCFMP6qusyKiaLCPFd7+SnnOHdVNS0VW5eH9TScghh BAch/Pu7l5MoXWaGhFdd9DXZP1fhR3XXWuT36Zi7E2lL26Ee+k8LBrfPbc4NvvDPDz x+cDanb3ghNGP9c2in27ztwG8ST3SO/NwTWdfKwQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, kernel test robot , Yuezhang Mo , Namjae Jeon , Sasha Levin Subject: [PATCH 6.18 194/430] exfat: fix remount failure in different process environments Date: Mon, 29 Dec 2025 17:09:56 +0100 Message-ID: <20251229160731.494624182@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251229160724.139406961@linuxfoundation.org> References: <20251229160724.139406961@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yuezhang Mo [ Upstream commit 51fc7b4ce10ccab8ea5e4876bcdc42cf5202a0ef ] The kernel test robot reported that the exFAT remount operation failed. The reason for the failure was that the process's umask is different between mount and remount, causing fs_fmask and fs_dmask are changed. Potentially, both gid and uid may also be changed. Therefore, when initializing fs_context for remount, inherit these mount options from the options used during mount. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202511251637.81670f5c-lkp@intel.com Signed-off-by: Yuezhang Mo Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin --- fs/exfat/super.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 74d451f732c7..581754001128 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -813,10 +813,21 @@ static int exfat_init_fs_context(struct fs_context *fc) ratelimit_state_init(&sbi->ratelimit, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); - sbi->options.fs_uid = current_uid(); - sbi->options.fs_gid = current_gid(); - sbi->options.fs_fmask = current->fs->umask; - sbi->options.fs_dmask = current->fs->umask; + if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE && fc->root) { + struct super_block *sb = fc->root->d_sb; + struct exfat_mount_options *cur_opts = &EXFAT_SB(sb)->options; + + sbi->options.fs_uid = cur_opts->fs_uid; + sbi->options.fs_gid = cur_opts->fs_gid; + sbi->options.fs_fmask = cur_opts->fs_fmask; + sbi->options.fs_dmask = cur_opts->fs_dmask; + } else { + sbi->options.fs_uid = current_uid(); + sbi->options.fs_gid = current_gid(); + sbi->options.fs_fmask = current->fs->umask; + sbi->options.fs_dmask = current->fs->umask; + } + sbi->options.allow_utime = -1; sbi->options.errors = EXFAT_ERRORS_RO; exfat_set_iocharset(&sbi->options, exfat_default_iocharset); -- 2.51.0