Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:35596 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753757AbcA2TqF (ORCPT ); Fri, 29 Jan 2016 14:46:05 -0500 Message-ID: <1454096764.7627.66.camel@edumazet-glaptop2.roam.corp.google.com> (sfid-20160129_204615_486758_FE1C22D4) Subject: Re: [PATCH v2 net] nfc: use GFP_USER for user-controlled kmalloc From: Eric Dumazet To: Cong Wang Cc: netdev@vger.kernel.org, dvyukov@google.com, linux-wireless@vger.kernel.org, julian.calaby@gmail.com, Lauro Ramos Venancio , Aloisio Almeida Jr , Samuel Ortiz Date: Fri, 29 Jan 2016 11:46:04 -0800 In-Reply-To: <1454095465-16685-1-git-send-email-xiyou.wangcong@gmail.com> References: <1454095465-16685-1-git-send-email-xiyou.wangcong@gmail.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, 2016-01-29 at 11:24 -0800, Cong Wang wrote: > These two functions are called in sendmsg path, and the > 'len' is passed from user-space, so we should not allow > malicious users to OOM kernel on purpose. > > Reported-by: Dmitry Vyukov > Cc: Lauro Ramos Venancio > Cc: Aloisio Almeida Jr > Cc: Samuel Ortiz > Signed-off-by: Cong Wang > --- Note that the issue is not OOM the kernel (as the allocation is attempted even after your patch), but having a way to spill stack traces in the syslog. Acked-by: Eric Dumazet Thanks!