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]
Date:   Tue, 7 Nov 2017 10:15:35 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Shaohua Li <shli@...com>
Cc:     LKML <linux-kernel@...r.kernel.org>, Jens Axboe <axboe@...nel.dk>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Ingo Molnar <mingo@...nel.org>, Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH] kthread: move the cgroup info initialization early

On Tue, 7 Nov 2017 09:57:03 -0800 Shaohua Li <shli@...com> wrote:

> kthread() could bail out early before we initialize blkcg_css (if the
> kthread is killed very soon), which confuses free_kthread_struct. Move
> the blkcg_css initialization early.

Changelog is... minimal.  I guess it doesn't matter much.

> Reported-by: syzbot <syzkaller@...glegroups.com>
> Fix: 05e3db9(kthread: add a mechanism to store cgroup info)

That's a bit messed up.  Please use

Fixes: 05e3db95ebfc ("kthread: add a mechanism to store cgroup info")

> --- a/kernel/kthread.c
> +++ b/kernel/kthread.c
> @@ -205,6 +205,10 @@ static int kthread(void *_create)
>  	int ret;
>  
>  	self = kmalloc(sizeof(*self), GFP_KERNEL);
> +#ifdef CONFIG_BLK_CGROUP
> +	if (self)
> +		self->blkcg_css = NULL;
> +#endif

Using kzalloc() would be much neater.  That way we get to delete a bit
more code and it doesn't leave me wondering "under what circumstances
is kthread.cpu uninitialized".  At least, not as much as I am wondering
right now.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ