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]
Message-Id: <20090310105258.A483.A69D9226@jp.fujitsu.com>
Date:	Tue, 10 Mar 2009 10:53:35 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Li Zefan <lizf@...fujitsu.com>
Cc:	kosaki.motohiro@...fujitsu.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	Americo Wang <xiyou.wangcong@...il.com>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Arjan van de Ven <arjan@...radead.org>,
	Roland Dreier <rdreier@...co.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH] memdup_user: introduce, fix

>   * Include machine specific inline routines
> diff --git a/mm/util.c b/mm/util.c
> index 3d21c21..7c122e4 100644
> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -74,15 +74,19 @@ EXPORT_SYMBOL(kmemdup);
>   *
>   * @src: source address in user space
>   * @len: number of bytes to copy
> - * @gfp: GFP mask to use
>   *
>   * Returns an ERR_PTR() on failure.
>   */
> -void *memdup_user(const void __user *src, size_t len, gfp_t gfp)
> +void *memdup_user(const void __user *src, size_t len)
>  {
>  	void *p;
>  
> -	p = kmalloc_track_caller(len, gfp);
> +	/*
> +	 * Always use GFP_KERNEL, since copy_from_user() can sleep and
> +	 * cause pagefault, which makes it pointless to use GFP_NOFS
> +	 * or GFP_ATOMIC.
> +	 */
> +	p = kmalloc_track_caller(len, GFP_KERNEL);
>  	if (!p)
>  		return ERR_PTR(-ENOMEM);

ok. thanks.
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>



--
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