Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3466077iob; Tue, 17 May 2022 00:04:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCvyA8j/rQzI7hMyZx5LX3xuxPETVpgC5z2xrQGm4fXycIHWVHLViMV6t16WTVwjad05zn X-Received: by 2002:a17:902:a9cc:b0:161:3bf4:9047 with SMTP id b12-20020a170902a9cc00b001613bf49047mr17546795plr.137.1652771051153; Tue, 17 May 2022 00:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652771051; cv=none; d=google.com; s=arc-20160816; b=Fmm+zdTeK+9IKeDGYB6v3Zlh+2liCknUFcHI8E0sA0a0sdvdjeWFnDTsCnyViAckXg lR2I7XRKNXP97NFktlF5dkVBXkxSYMRfLDaSgqqFA8zwNuLM1xvnPolIMgIvcY7zPhQH /2zaD1ti2vuMIa+6kGv1Z9Yx9SpmcIcydOKhtWXJ2s1w+snDbgBf6JRhhxk9095fKu1K XtcqbqbzlEiC+qvG4z9gSOeCwZ2bELajhii4ZkW/KW6hEiVywDxnv/NCsg3y91Y+n5BJ CgKJ4hqqpnF+VizJeCmPNn9X/h7msa3MESvIkR7MHxbA0vlwWQuVPFS2DIIHKgYgvu+c X9LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3daWTLjDfemU4LkrKKjdRnCWKXpzBvPuFNd5zc6Jz5A=; b=sYq22n2zzoT8UlzmuX6WtHkPDbJTqOJ/5oFMXhEiLyu2pG6aXSYHa5yQCFWdnaY/ZK HM19/zS11Liq4nQuwJKubOVWqaqBrEYViwNsBpx3x6Q1KnHl/qq9fCCi9i+aOx0qlfQ1 cAsTnu6KUxRdgp8J1BIdrT08nXXQEXmXBJOZ1KSKZsFy95vdUH9fjodund9QpVrC4CWt ngPSDNcT2+RDrEOvJbZKFRVznD+CsClZ+iVT8d39HnbIjS0CBYb5u9Z+57D1VGD8OTkr xfCfupAYojNReaxZpSrL94PlL02KTQtUuDLcKLmz+CdjM4mtRgPS94ZfUkfQQPE5jVi2 3ZpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vIJLb1Xm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np5-20020a17090b4c4500b001d9a26d525asi1941145pjb.105.2022.05.17.00.03.58; Tue, 17 May 2022 00:04:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vIJLb1Xm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbiEQGZJ (ORCPT + 99 others); Tue, 17 May 2022 02:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234274AbiEQGZI (ORCPT ); Tue, 17 May 2022 02:25:08 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73DDB44A07 for ; Mon, 16 May 2022 23:25:07 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id j6so32622479ejc.13 for ; Mon, 16 May 2022 23:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=3daWTLjDfemU4LkrKKjdRnCWKXpzBvPuFNd5zc6Jz5A=; b=vIJLb1XmiUQPDP9LOfnswgdPT30ag0zLABpNg2EIJgJs2dbD59ExZ9WUB7x+eYPK6X Jslp8ywU4Hv087437vHZZU9nXb9vKhQX/L14b3tlk+MDDLRf3cca5lcufwyhwljuTjnt s5GFG9HB0v5hkcwJZANsjt0QilC53+46snkcntiPjWX6KrA4GVm+qcBkm/38Vb7Us47v KNILJhRgUP1FPvNNz4itwGOK/GlNv1LeZesIqlaPqmsxoPA7ZMy8Ut5NgCbk5v3cS45M Hwn8YUKh4fYKptSijHt2fHmUN1daqd7kMu5XXbTE9P6N+LH9it5YDUH7nW3o2DQ1Cxdl ir4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=3daWTLjDfemU4LkrKKjdRnCWKXpzBvPuFNd5zc6Jz5A=; b=S3zLboOOVI44TTo71rcEL4ydh8m8P1cZk5LJTuYvflpXWjgUWF6sQ64E4qqlQGXVQR OLqq7EDN2buLhtj9FYN87l6mgy/NS/GUSGj+ra2lAgHXiN24mbIdTKfat+c48wtp9MBz WX6moVrt15dyxSzB6s8GOQPg+0lW0VazBgFwHc8w25vIIJFN+aBVctYy21Mqr6VvuK8/ ZDl/D8NxMFfJsBveUsLZsCt34+r3qRS18Lewzd2zUonfOhtrBXiTsWvBHuTkE2GuM/2B HCTeIIfjUL3nRDhRtFzcNKFIbwjBwz4MuvBXXD5FHx6wO44w3sGwfBNQNpP387LDR9K8 7Clg== X-Gm-Message-State: AOAM533q9tEgx+/j+eHgGt9f/TA2lS7jBy1lZB1Dznf/vnYmHh52ZrU7 jKPI02ubPhuc2quUy2mC/80zBg== X-Received: by 2002:a17:907:1c06:b0:6df:b257:cbb3 with SMTP id nc6-20020a1709071c0600b006dfb257cbb3mr18607442ejc.631.1652768706063; Mon, 16 May 2022 23:25:06 -0700 (PDT) Received: from [192.168.0.17] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id hv6-20020a17090760c600b006f3ef214e4dsm628655ejc.179.2022.05.16.23.25.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 May 2022 23:25:05 -0700 (PDT) Message-ID: <4889a6cd-ef96-595e-a117-2965aab97a54@linaro.org> Date: Tue, 17 May 2022 08:25:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH net v2] NFC: nci: fix sleep in atomic context bugs caused by nci_skb_alloc Content-Language: en-US To: Duoming Zhou , linux-kernel@vger.kernel.org, kuba@kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, gregkh@linuxfoundation.org, alexander.deucher@amd.com, broonie@kernel.org, netdev@vger.kernel.org References: <20220517012530.75714-1-duoming@zju.edu.cn> From: Krzysztof Kozlowski In-Reply-To: <20220517012530.75714-1-duoming@zju.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/05/2022 03:25, Duoming Zhou wrote: > There are sleep in atomic context bugs when the request to secure > element of st-nci is timeout. The root cause is that nci_skb_alloc > with GFP_KERNEL parameter is called in st_nci_se_wt_timeout which is > a timer handler. The call paths that could trigger bugs are shown below: > > (interrupt context 1) > st_nci_se_wt_timeout > nci_hci_send_event > nci_hci_send_data > nci_skb_alloc(..., GFP_KERNEL) //may sleep > > (interrupt context 2) > st_nci_se_wt_timeout > nci_hci_send_event > nci_hci_send_data > nci_send_data > nci_queue_tx_data_frags > nci_skb_alloc(..., GFP_KERNEL) //may sleep > > This patch changes allocation mode of nci_skb_alloc from GFP_KERNEL to > GFP_ATOMIC in order to prevent atomic context sleeping. The GFP_ATOMIC > flag makes memory allocation operation could be used in atomic context. > > Fixes: ed06aeefdac3 ("nfc: st-nci: Rename st21nfcb to st-nci") > Signed-off-by: Duoming Zhou > --- > Changes in v2: > - Change the Fixes tag to commit st_nci_se_wt_timeout was added. Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply. https://elixir.bootlin.com/linux/v5.13/source/Documentation/process/submitting-patches.rst#L543 If a tag was not added on purpose, please state why and what changed. Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof