Received: by 10.223.176.46 with SMTP id f43csp872003wra; Fri, 26 Jan 2018 08:11:48 -0800 (PST) X-Google-Smtp-Source: AH8x226VLazBC3EBtx/qO7jQdKx0zedPM21+9LGhzzXGRGkU3W2Gdp+DECaKmFw1IL65FGEF9X1n X-Received: by 10.99.185.78 with SMTP id v14mr9028780pgo.112.1516983108742; Fri, 26 Jan 2018 08:11:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516983108; cv=none; d=google.com; s=arc-20160816; b=aq6f0hARt5BAd+Vsv8T0fX79rrWtlMBPBiP0iPQiYANHGFGEWqfex+lnhJIEXr6tm7 0BP8Uu3hGgcpOIKdHwFkJTSE6s73M7Xxr/eOnEkQIt8I2ZivmN5klLn7OIaXwHpaFH1y GCOuCWQFR1l86yTtHZ9+2cUMAJph9WDHlxJjbTLMjiHstsbhCeD1+yyXxGiz07t9D/uk TTMbgzE6S21pIOj3muG/LkVj4HwBzQZ/e6+zFo2DGMTd3gKDsrYPvJcUGdqN64/nRyH3 reH//3UnJEk5e7Ei5C8VvHnfvc5ciiXfSTejehLcW++HY1WOOS9XjC0ntfJ1PE/gI06a or/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=obboxHIdMwj5AXJjWtRvcMMw73ZA2y5Go0x9HxvDkBo=; b=F/V1H/W1Gpb4pCdVlezGY/klVwrO3xzeLDCRTY1w2PSQAdY+MreLB1Mos2WofePuk+ wKrw2M5JBnNfiL+kyLI328iT1LuZtASTgQbioKU0IVslryNfETYvvU7qji2+z92Xl3PR uypT2mo7rJFM/NV+HDbQU6Nybyl1KZ/pXc3xrQlSvC1bbJux5lq2dZbOTHKs31IC57/r QcLtttstyaWiCQtxAL92tXIlrLX/qj/n4ETw4PMSjxrsZl0LOjjfdQgw0KsompjJfoYr WredPMalj3yqKIE4cXG5RqIjgtDl8mSlpJcBPGn6jC5P062I3X65zq8R6S8fkrzA/n5n +tfg== 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 c81si6505548pfe.306.2018.01.26.08.11.34; Fri, 26 Jan 2018 08:11:48 -0800 (PST) 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 S1753807AbeAZQLB (ORCPT + 99 others); Fri, 26 Jan 2018 11:11:01 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:47490 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbeAZQLA (ORCPT ); Fri, 26 Jan 2018 11:11:00 -0500 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id B888A109164E9; Fri, 26 Jan 2018 08:10:59 -0800 (PST) Date: Fri, 26 Jan 2018 11:10:59 -0500 (EST) Message-Id: <20180126.111059.743624766367628826.davem@davemloft.net> To: baijiaju1990@gmail.com Cc: viro@ZenIV.linux.org.uk, 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] atm: firestream: Replace GFP_ATOMIC with GFP_KERNEL in fs_send From: David Miller In-Reply-To: <35cb1c70-824b-e0a3-1bed-d147d0f5dec2@gmail.com> References: <20180126120522.GX13338@ZenIV.linux.org.uk> <35cb1c70-824b-e0a3-1bed-d147d0f5dec2@gmail.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 26 Jan 2018 08:11:00 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai Date: Fri, 26 Jan 2018 22:17:08 +0800 > > > On 2018/1/26 21:56, Jia-Ju Bai wrote: >> >> >> On 2018/1/26 20:05, Al Viro wrote: >>> On Fri, Jan 26, 2018 at 04:00:27PM +0800, Jia-Ju Bai wrote: >>>> After checking all possible call chains to fs_send() here, >>>> my tool finds that fs_send() is never called in atomic context. >>>> And this function is assigned to a function pointer "dev->ops->send", >>>> which is only called by vcc_sendmsg() (net/atm/common.c) >>>> through vcc->dev->ops->send(), and vcc_sendmsg() calls schedule(), >>>> it indicates that fs_send() can call functions which may sleep. >>>> Thus GFP_ATOMIC is not necessary, and it can be replaced with >>>> GFP_KERNEL. >>>> >>>> This is found by a static analysis tool named DCNS written by myself. >>> The trouble is, places like >>> net/atm/raw.c:65: vcc->send = atm_send_aal0; >>> net/atm/raw.c:74: vcc->send = vcc->dev->ops->send; >>> net/atm/raw.c:83: vcc->send = vcc->dev->ops->send; >>> mean extra call chains. It's *not* just vcc_sendmsg(), and e.g. >>> ret = ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb) >>> ? DROP_PACKET : 1; >>> bh_unlock_sock(sk_atm(vcc)); >>> in pppoatm_send() definitely is called under a spinlock. >>> >>> Looking through the driver (in advanced bitrot, as usual for >>> drivers/atm), >>> I'd say that submit_queue() is fucked in head in the "queue full" >>> case. >>> And judging by the history, had been thus since the original merge... >> >> Thanks for reply :) >> >> I am sorry for this false positive. >> I think other ATM related patches that I submitted are also false >> positives, sorry. >> My tool did not handle this situation of passing function pointer, and >> I will improve the tool... >> >> >> Thanks, >> Jia-Ju Bai > > I check the code again, and confirm only my patches about "send" are > false positives. > I think other my patches that are about "open" does not has this > problem: > https://marc.info/?l=linux-kernel&m=151693791432626&w=2 > https://marc.info/?l=linux-kernel&m=151695475503314&w=2 > https://marc.info/?l=linux-kernel&m=151693150131512&w=2 > > I hope you can have a check :) No, _you_ have a check. All of these patches will be dropped, sorry.