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: <20210922174856.GA87201@rsjd01523.et2sqa>
Date:   Thu, 23 Sep 2021 01:48:56 +0800
From:   Liu Bo <bo.liu@...ux.alibaba.com>
To:     Gao Xiang <hsiangkao@...ux.alibaba.com>
Cc:     linux-erofs@...ts.ozlabs.org, Chao Yu <chao@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] erofs: fix misbehavior of unsupported chunk format check

On Wed, Sep 22, 2021 at 05:51:41PM +0800, Gao Xiang wrote:
> Unsupported chunk format should be checked with
> "if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL)"
> 
> Found when checking with 4k-byte blockmap (although currently mkfs
> uses inode chunk indexes format by default.)
>

Good catch.

Reviewed-by: Liu Bo <bo.liu@...ux.alibaba.com>

thanks,
liubo

> Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files")
> Cc: Liu Bo <bo.liu@...ux.alibaba.com>
> Cc: Chao Yu <chao@...nel.org>
> Signed-off-by: Gao Xiang <hsiangkao@...ux.alibaba.com>
> ---
>  fs/erofs/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
> index 31ac3a7..a552399 100644
> --- a/fs/erofs/inode.c
> +++ b/fs/erofs/inode.c
> @@ -176,7 +176,7 @@ static struct page *erofs_read_inode(struct inode *inode,
>  	}
>  
>  	if (vi->datalayout == EROFS_INODE_CHUNK_BASED) {
> -		if (!(vi->chunkformat & EROFS_CHUNK_FORMAT_ALL)) {
> +		if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL) {
>  			erofs_err(inode->i_sb,
>  				  "unsupported chunk format %x of nid %llu",
>  				  vi->chunkformat, vi->nid);
> -- 
> 1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ