Received: by 10.223.176.46 with SMTP id f43csp745219wra; Fri, 26 Jan 2018 06:18:26 -0800 (PST) X-Google-Smtp-Source: AH8x225furXW++5hMNhIFHWfsGHRA/B5sxwT1ZIA432LIJokZQoBYyQEjMLEfc/Qn0yHNPoYG6PJ X-Received: by 10.99.116.22 with SMTP id p22mr7642296pgc.4.1516976306338; Fri, 26 Jan 2018 06:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516976306; cv=none; d=google.com; s=arc-20160816; b=UwwrqWQSopF6KPzBiP6wGFpPAZEIDGZcUiUzHD3P8FTPRClEMJSeiTMnjkq0SqICid wOOXJuJpknU4lgQssv2hVnZQNG4ho2as1yjQ/wvfrZkjFQ/OPvXsEcvkg6aGsTFjNfd+ gukt/esGRLBQM1q+/J0GIw5AgDpZwleBCgFd/2kTm824oNlRGh+x4AEOeN22SUHf6mSF P2M/Xyf5w2UzYo5nLcXzP3vLlaGt+nIdtCkPUTMQyztZ7r2EeN+3FMPTpJcCz175FV3t Zcd/hp46IHbYPRtst6skSISH7/QM3z918PFnQt0BDd7pOUZwMzsMNCk0lXQlzyIaMRZS ZrOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=3jByO+9IprbmwvIEzLPbU35nQWiHBtlqT5crGSNkQOw=; b=Tjr8xPZtXLGvY4hNG6DY7PXRTEGrjsmkA9nlnFWvl+vlJxGmLXsz9bOTLuZmFhNqv5 Diam7+skzXnFGuvV+SeqF1fR4T9J653+kmV0DK4nJ3+J6MQgvcKERRAxg9znm9a7O6Fw bkOYv0p2Wd+Q1qhP+u6FFkY2EjChzkWBoAQ142O3m4Uqnmpsh7lCKcAHnoebGJ5hWBDN Gsixve3LVq0ZNtjYLHndCqi3C3Mv3AR7ajdTpbf2YjBrN5gbrAmyzVCM4LC5kJDHX3fk xTvQnFvQILUkkxBdoB6MHhnRCPAXSgMLFdJpLpnQjSf/FQvkh7MohaKiBET/76gtC9xV UgmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fSSzD2oD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si3043693pgt.383.2018.01.26.06.18.11; Fri, 26 Jan 2018 06:18:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fSSzD2oD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbeAZORb (ORCPT + 99 others); Fri, 26 Jan 2018 09:17:31 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42008 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbeAZORa (ORCPT ); Fri, 26 Jan 2018 09:17:30 -0500 Received: by mail-pg0-f67.google.com with SMTP id q67so342659pga.9; Fri, 26 Jan 2018 06:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=3jByO+9IprbmwvIEzLPbU35nQWiHBtlqT5crGSNkQOw=; b=fSSzD2oDPfBxuPNlFLc4dR6vUZgqZ3Xxm7UiM9J1J8WJyXuFcBh8qoZdsy154d/LMd grSVvnwnpBObJi54Oaf3fYRYdx/2tbkT0XKQEqN3In0Gf76h/+WHS7rmm+oBd4GW7HLJ z4jLZeV4O3TQfwzVpLKR3LesdT7ZVp8qXTHlklMJjL5Sp7VIaeKD93wEiAObHcxZ+5f7 0KONE7rn4qmQKIzJ6TaaZqv3NJHbEyr9n5zyE+jgHM9LpHjr0DhfLFD7ccxeunPdlOO2 wer4p8+etIOH/2MOPV+cHDKdiloQzodzK3d8eusVaqjUvmSjN47tqrHPaW5CkNbF5uvp tp/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=3jByO+9IprbmwvIEzLPbU35nQWiHBtlqT5crGSNkQOw=; b=tAcxG9qL+VnpBdQT5tnVTK+6kXgehNbyou3sm1J1KxoJtnajTkkX76VKYqIAbB2wCW zRR1SYIsGzpomkdJ3KCl3WpNhwa6061Mog70E2msnKNrYGV0vWTQQn/QU6sJv6iJS1jG d9Yc9HQbR7g1llkXn9ftsa0XzLzLMtxs14FelOLVcxZw+Mx3qGBL8a6skyrWuST5p5y2 DtXaDlyfxjdrxgKFBkNUzsnAWaxEpHIDw9x9WLEjuEeD81AagAcjuWCx5bE5ilfgkUFK HSAt3JaH3OQsPf8A7etKm4eNH8jMls56KffdAmevBqlk28+yOeKcCC58OMhyNh6s8hn0 1l+g== X-Gm-Message-State: AKwxytdYMlFPeYJZzFof+4cVmsGogVlu6o5XxrSTLh8CT3k0W76IQd2S gOizp2rvfL1ewdEazlJ+BZx3wz2r X-Received: by 2002:a17:902:624:: with SMTP id 33-v6mr14177361plg.327.1516976249618; Fri, 26 Jan 2018 06:17:29 -0800 (PST) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.14? ([2402:f000:1:1501:200:5efe:a66f:460e]) by smtp.gmail.com with ESMTPSA id c1sm13263235pfa.119.2018.01.26.06.17.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 06:17:29 -0800 (PST) Subject: Re: [PATCH] atm: firestream: Replace GFP_ATOMIC with GFP_KERNEL in fs_send From: Jia-Ju Bai To: Al Viro Cc: 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1516953627-30983-1-git-send-email-baijiaju1990@gmail.com> <20180126120522.GX13338@ZenIV.linux.org.uk> Message-ID: <35cb1c70-824b-e0a3-1bed-d147d0f5dec2@gmail.com> Date: Fri, 26 Jan 2018 22:17:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :) Thanks, Jia-Ju Bai