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: <20130711153313.7e37a9095eacb1153ade516c@linux-foundation.org>
Date:	Thu, 11 Jul 2013 15:33:13 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Oleg Nesterov <oleg@...hat.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
	Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH] mm: mempolicy: turn vma_set_policy() into
 vma_dup_policy()

On Thu, 11 Jul 2013 15:27:46 -0700 (PDT) David Rientjes <rientjes@...gle.com> wrote:

> On Thu, 11 Jul 2013, Andrew Morton wrote:
> 
> > On Thu, 11 Jul 2013 15:13:03 -0700 (PDT) David Rientjes <rientjes@...gle.com> wrote:
> > 
> > > > +int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
> > > > +{
> > > > +	struct mempolicy *pol = mpol_dup(vma_policy(src));
> > > > +
> > > > +	if (IS_ERR(pol))
> > > > +		return PTR_ERR(pol);
> > > 
> > > PTR_ERR() returns long, so vma_dup_policy() needs to return long.
> > 
> > hm, really?  vma_dup_policy() returns an errno and errnos have type "int".
> > 
> > Arguably it is PTR_ERR() which returns the wrong type...
> > 
> 
> PTR_ERR() may not imply IS_ERR(),

Well why not.  Are we saying that code can legitimately convert the
PTR_ERR() return value back into a pointer?  If so that sounds nuts.

> which I believe Rusty is trying to fix 
> with his series that fixes up abuses of PTR_ERR().

Well I hope all of this will be completely documented in err.h. 
Otherwise the abuses will simply continue.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ