Received: by 10.192.165.148 with SMTP id m20csp4488502imm; Tue, 8 May 2018 09:12:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq8dE3en4PC7qnUHeRVR8MGc05fUQ4IgtgyOyG2a+7BmYBoC4M1GBE4Wo3Bze2Z59/dSvNP X-Received: by 10.167.131.199 with SMTP id j7mr17033883pfn.50.1525795963048; Tue, 08 May 2018 09:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525795963; cv=none; d=google.com; s=arc-20160816; b=lq7Hv1fJASOfQbB3qCT6pwBiD+f0gANxd1uang48X4k3uNISShdJFTO42ky/Lsy43v EqSwTEzF0mVL+OCTCiYNdglZTSCiichrvBbWe/sK4XhDyESpffFa+zAZa4GF/AaFIt42 3hSEAI7/vQzWlT0cSPa3vGzwRotuUsmJgDTvrLZkYZp8jxaBEzndGWGwsgQRZIN9g0xb hNTxcyVvFdACdvGeX3ERDzpKBnyUMJZesi+zC7tTxeaNBREMe9fKrXY9xjATl02koNj9 KHG7Fzou8pBEma9H3+I7xTTPI2vh91EFhmnAspMTVOYBp25Lcm8qy6Q3mmV0hHpl2q0V WNtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=FjpymGg4Dtsixd2QetyX06TDfzGMtfhjeg1c8eRh7nM=; b=0o76rKl+bz0QjFuZMQTg/q3LN6NxR4sFgF29OxWE3abdbYw/PMlJ9sPZzim46AmJbk 9SUbgOH88CGEEDkV1avr5esU11z8EZGFdxKuEYBhoRJVzPvuFzqrUQxUKxALi6OfdYyU q2eD+KbcxvT8C9Y3yy4/YW0G38T6HVal7mjdrxOZHc22B0EAQe0PpyGOq4GQyVukD7aQ mTQ+43aiB/kOLjiVEtsfpGJC+e1rN3fxsjVOJfMzMyWms/zPafkWQJYWXRddCudP0KAQ J6jMHNjDsSPjFPSpELaeVuFMSnwK3Aj3buLsQyLHi/OJRdwLYpmH8ZP/QLqJO8HtJoOb KqtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f75si25933845pfh.90.2018.05.08.09.12.28; Tue, 08 May 2018 09:12:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932732AbeEHQLc (ORCPT + 99 others); Tue, 8 May 2018 12:11:32 -0400 Received: from fieldses.org ([173.255.197.46]:50808 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932127AbeEHQLa (ORCPT ); Tue, 8 May 2018 12:11:30 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 3DFB2AAA; Tue, 8 May 2018 12:11:30 -0400 (EDT) Date: Tue, 8 May 2018 12:11:30 -0400 From: "bfields@fieldses.org" To: Trond Myklebust Cc: "syzbot+4b98281f2401ab849f4b@syzkaller.appspotmail.com" , "syzkaller-bugs@googlegroups.com" , "anna.schumaker@netapp.com" , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" , "linux-nfs@vger.kernel.org" , "jlayton@kernel.org" , "netdev@vger.kernel.org" Subject: Re: general protection fault in encode_rpcb_string Message-ID: <20180508161130.GC6151@fieldses.org> References: <20180417213308.GC18217@fieldses.org> <1524002074.63751.5.camel@hammer.space> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524002074.63751.5.camel@hammer.space> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "J. Bruce Fields" Date: Tue, 8 May 2018 11:47:03 -0400 Subject: [PATCH 2/2] sunrpc: convert unnecessary GFP_ATOMIC to GFP_NOFS It's OK to sleep here, we just don't want to recurse into the filesystem as this writeout could be waiting on this. As a next step: the documentation for GFP_NOFS says "Please try to avoid using this flag directly and instead use memalloc_nofs_{save,restore} to mark the whole scope which cannot/shouldn't recurse into the FS layer with a short explanation why. All allocation requests will inherit GFP_NOFS implicitly." But I'm not sure where to do this. Should the workqueue could be arranging that for us in the case of workqueues created with WQ_MEM_RECLAIM? Reported-by: Trond Myklebust Signed-off-by: J. Bruce Fields --- net/sunrpc/rpcb_clnt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) On Tue, Apr 17, 2018 at 09:54:36PM +0000, Trond Myklebust wrote: > Yes, and we can probably convert it, and the other GFP_ATOMIC > allocations in the rpcbind client to use GFP_NOFS in order to improve > reliability. diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 82c120e51d64..576e84a1adee 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -752,7 +752,7 @@ void rpcb_getport_async(struct rpc_task *task) goto bailout_nofree; } - map = kzalloc(sizeof(struct rpcbind_args), GFP_ATOMIC); + map = kzalloc(sizeof(struct rpcbind_args), GFP_NOFS); if (!map) { status = -ENOMEM; dprintk("RPC: %5u %s: no memory available\n", @@ -770,7 +770,7 @@ void rpcb_getport_async(struct rpc_task *task) case RPCBVERS_4: case RPCBVERS_3: map->r_netid = xprt->address_strings[RPC_DISPLAY_NETID]; - map->r_addr = rpc_sockaddr2uaddr(sap, GFP_ATOMIC); + map->r_addr = rpc_sockaddr2uaddr(sap, GFP_NOFS); if (!map->r_addr) { status = -ENOMEM; dprintk("RPC: %5u %s: no memory available\n", -- 2.17.0