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]
Message-ID: <5b615ac3-6080-473f-a0ff-19c38de4ab59@linux.alibaba.com>
Date: Wed, 14 May 2025 16:53:18 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: Kemeng Shi <shikemeng@...weicloud.com>, hughd@...gle.com,
 akpm@...ux-foundation.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] mm: shmem: add missing shmem_unacct_size() in
 __shmem_file_setup()



On 2025/5/15 00:50, Kemeng Shi wrote:
> We will miss shmem_unacct_size() when is_idmapped_mnt() returns a failure.
> Move is_idmapped_mnt() before shmem_acct_size() to fix the issue.
> 
> Fixes: 7a80e5b8c6fa7 ("shmem: support idmapped mounts for tmpfs")
> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>

> ---
>   mm/shmem.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 980fa15f393e..495e661eb8bb 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -5812,12 +5812,12 @@ static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name,
>   	if (size < 0 || size > MAX_LFS_FILESIZE)
>   		return ERR_PTR(-EINVAL);
>   
> -	if (shmem_acct_size(flags, size))
> -		return ERR_PTR(-ENOMEM);
> -
>   	if (is_idmapped_mnt(mnt))
>   		return ERR_PTR(-EINVAL);
>   
> +	if (shmem_acct_size(flags, size))
> +		return ERR_PTR(-ENOMEM);
> +
>   	inode = shmem_get_inode(&nop_mnt_idmap, mnt->mnt_sb, NULL,
>   				S_IFREG | S_IRWXUGO, 0, flags);
>   	if (IS_ERR(inode)) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ