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:   Sun, 21 May 2017 04:25:10 +0100
From:   Al Viro <viro@...IV.linux.org.uk>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Geliang Tang <geliangtang@...il.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Michal Nazarewicz <mina86@...a86.com>,
        Vincent Pelletier <plr.vincent@...il.com>,
        Felix Hädicke <felixhaedicke@....de>,
        Jim Lin <jilin@...dia.com>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: f_fs: use memdup_user

On Sat, May 13, 2017 at 11:05:30AM +0300, Dan Carpenter wrote:

> > +	data = memdup_user(buf, len);
> > +	if (unlikely(IS_ERR(data)))
> 
> Don't use likely/unlikely() here.  It's not a fast path.

More to the point,

#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
static inline bool __must_check IS_ERR(__force const void *ptr)
{
	return IS_ERR_VALUE((unsigned long)ptr);
}

IOW, IS_ERR() already produces unlikely(....), fast path or not.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ