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] [day] [month] [year] [list]
Message-ID: <b4865aaf-8253-b44e-55fe-d1fab1f5f092@huawei.com>
Date: Mon, 18 Nov 2024 13:24:43 +0800
From: Zhihao Cheng <chengzhihao1@...wei.com>
To: Fedor Pchelkin <pchelkin@...ras.ru>, Richard Weinberger <richard@....at>
CC: David Woodhouse <dwmw2@...radead.org>, Wang Yong <wang.yong12@....com.cn>,
	Lu Zhongjun <lu.zhongjun@....com.cn>, Yang Tao <yang.tao172@....com.cn>, Al
 Viro <viro@...iv.linux.org.uk>, <linux-mtd@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <lvc-project@...uxtesting.org>,
	<stable@...r.kernel.org>
Subject: Re: [PATCH 2/2] jffs2: initialize inocache earlier

在 2024/11/18 2:44, Fedor Pchelkin 写道:
> Inside jffs2_new_inode() there is a small gap when jffs2_init_acl_pre() or
> jffs2_do_new_inode() may fail e.g. due to a memory allocation error while
> uninit inocache field is touched upon subsequent inode eviction.
> 
> general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] PREEMPT SMP KASAN NOPTI
> KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
> CPU: 0 PID: 10592 Comm: syz-executor.1 Not tainted 5.10.209-syzkaller #0
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
> RIP: 0010:jffs2_xattr_delete_inode+0x35/0x130 fs/jffs2/xattr.c:602
> Call Trace:
>   jffs2_do_clear_inode+0x4c/0x570 fs/jffs2/readinode.c:1418
>   evict+0x281/0x6b0 fs/inode.c:577
>   iput_final fs/inode.c:1697 [inline]
>   iput.part.0+0x4df/0x6d0 fs/inode.c:1723
>   iput+0x58/0x80 fs/inode.c:1713
>   jffs2_new_inode+0xb12/0xdb0 fs/jffs2/fs.c:469
>   jffs2_create+0x90/0x400 fs/jffs2/dir.c:177
>   lookup_open.isra.0+0xead/0x1260 fs/namei.c:3169
>   open_last_lookups fs/namei.c:3239 [inline]
>   path_openat+0x96c/0x2670 fs/namei.c:3428
>   do_filp_open+0x1a4/0x3f0 fs/namei.c:3458
>   do_sys_openat2+0x171/0x420 fs/open.c:1186
>   do_sys_open fs/open.c:1202 [inline]
>   __do_sys_openat fs/open.c:1218 [inline]
>   __se_sys_openat fs/open.c:1213 [inline]
>   __x64_sys_openat+0x13c/0x1f0 fs/open.c:1213
>   do_syscall_64+0x30/0x40 arch/x86/entry/common.c:46
> 
> Initialize the inocache pointer to a NULL value while preparing an inode
> in jffs2_init_inode_info(). jffs2_xattr_delete_inode() will handle it
> later just fine.
> 
> Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@...r.kernel.org
> Signed-off-by: Fedor Pchelkin <pchelkin@...ras.ru>
> ---
>   fs/jffs2/os-linux.h | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Zhihao Cheng <chengzhihao1@...wei.com>
> 
> diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
> index 86ab014a349c..39b6565f10c9 100644
> --- a/fs/jffs2/os-linux.h
> +++ b/fs/jffs2/os-linux.h
> @@ -55,6 +55,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
>   	f->metadata = NULL;
>   	f->dents = NULL;
>   	f->target = NULL;
> +	f->inocache = NULL;
>   	f->flags = 0;
>   	f->usercompr = 0;
>   }
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ