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: <20160621181404.GB4501@cmpxchg.org>
Date:	Tue, 21 Jun 2016 14:14:04 -0400
From:	Johannes Weiner <hannes@...xchg.org>
To:	Tejun Heo <tj@...nel.org>
Cc:	Li Zefan <lizefan@...wei.com>, cgroups@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH cgroup/for-4.8] cgroup: allow NULL return from
 ss->css_alloc()

On Tue, Jun 21, 2016 at 01:06:24PM -0400, Tejun Heo wrote:
> cgroup core expected css_alloc to return an ERR_PTR value on failure
> and caused NULL deref if it returned NULL.  It's an easy mistake to
> make from an alloc function and there's no ambiguity in what's being
> indicated.  Update css_create() so that it interprets NULL return from
> css_alloc as -ENOMEM.
> 
> Signed-off-by: Tejun Heo <tj@...nel.org>

Would it be better to remove the error code instead and have everybody
return NULL? AFAICS, everybody is returning either the object or the
-ENOMEM error code right now.

What error condition is there for an allocation function?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ