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]
Date:   Tue, 12 Jun 2018 15:41:54 +0800
From:   "cgxu519@....com" <cgxu519@....com>
To:     Zhouyang Jia <jiazhouyang09@...il.com>
Cc:     "cgxu519@....com" <cgxu519@....com>, Jan Kara <jack@...e.cz>,
        Amir Goldstein <amir73il@...il.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] inotify: add error handling for kmem_cache_create


> 在 2018年6月12日,下午12:22,Zhouyang Jia <jiazhouyang09@...il.com> 写道:
> 
> When kmem_cache_create fails, the lack of error-handling code may
> cause unexpected results.
> 
> This patch adds error-handling code after calling kmem_cache_create.

I think SLAB_PANIC can handle this case.

Thanks,
Chengguang.

> 
> Signed-off-by: Zhouyang Jia <jiazhouyang09@...il.com>
> ---
> fs/notify/inotify/inotify_user.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
> index ef32f36..0704bab 100644
> --- a/fs/notify/inotify/inotify_user.c
> +++ b/fs/notify/inotify/inotify_user.c
> @@ -805,6 +805,8 @@ static int __init inotify_user_setup(void)
> 	BUG_ON(hweight32(ALL_INOTIFY_BITS) != 21);
> 
> 	inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark, SLAB_PANIC);
> +	if (!inotify_inode_mark_cachep)
> +		return -ENOMEM;
> 
> 	inotify_max_queued_events = 16384;
> 	init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES] = 128;
> -- 
> 2.7.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ