Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1338831pxb; Thu, 14 Apr 2022 04:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+QYa/76HCu0otKRe+O3X7E+V69UUcdMjTKyf1b/G3HxDtL9wLtmcPsnqwL6XcoC8kjy0+ X-Received: by 2002:a05:6a00:1310:b0:4ca:cc46:20c7 with SMTP id j16-20020a056a00131000b004cacc4620c7mr3375338pfu.44.1649934462258; Thu, 14 Apr 2022 04:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649934462; cv=none; d=google.com; s=arc-20160816; b=U/c2RwiXIh9uU34ehdeGmloq/TPUuw9yKMcViEDQnuC52hllhR5WXp6yQZz+M4sHns HV3xyGB+0iV26kBh3tLWofs+YDV2V8JPyPHWIIY3HxtBH7hL3qZXqzQ05qaYkrIHDq+/ Xp+lOePPHC4EPRtQeaYVoA93WdlIS+mF/LeUl3Kz7zgCciXHr8+YIVF3mOt7rWo4yf79 QkcY2pDq+sgcQJVErn7TapUZmiivyo4+8miTWasMSiWHd3Zt5PvOhrSsfoqGzwOyai5F xgXgCYS4ST9bxTOPCJH38XPwlYro9ViyIXFvPZ2x8CiNLjMHf0BEHSJ07881bHu4mJ9m jElQ== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=KhtSZr2c56r54K7IpY0qcNj65rBp4GOZJk8SwvpS20Q=; b=q/pNZWl1I/F5YjwVNLsBQqrCyMsQDHyT7/kMcwqy4Pl9jentyyOMQlASedvny3yhZd HapFK2yW8WzVmgsV839rnmeYgBkyvFE026ssxTD+LFzMs+npDAVBT+4cxfzr3FVhQjyn 9y/ZxAFDTqYBIahdnxlt4fZaBBfmq8qCfSphQfVbKDhQG8NHGYyln7/BbHgncP+9KO0j Os5VVmgu8uJI2gu64Km3bVE2cxhYaEtFwQqIgeHUT5DC9qVJj093SGphC1BrGlazm1/g ThTObLzXDWbyw5Ry2UMhFmUke1B8o8fiqQuMy+doqUPzonxU2kaF5WMxTdkVU0qdoqnp aerw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A1UR9raa; 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 b15-20020a170902d50f00b00158618de96fsi12405712plg.115.2022.04.14.04.07.29; Thu, 14 Apr 2022 04:07:42 -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=A1UR9raa; 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 S232611AbiDMJmQ (ORCPT + 99 others); Wed, 13 Apr 2022 05:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234576AbiDMJmO (ORCPT ); Wed, 13 Apr 2022 05:42:14 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAC4E34BBE for ; Wed, 13 Apr 2022 02:39:52 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id z12so1671371edl.2 for ; Wed, 13 Apr 2022 02:39:52 -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 :references:from:in-reply-to:content-transfer-encoding; bh=KhtSZr2c56r54K7IpY0qcNj65rBp4GOZJk8SwvpS20Q=; b=A1UR9raaChW76TEYQ6W7rbeQLFclE3Ev4UXUC48a3qNoNBpbUBpm3RwMBHLxEDTjRp urD+qi7Ny4fEyRtFuBtz8khDO4UlxKcgQg91Wah1DGrop6eqbEnoL5jZcHvFzzRluE6q PVpql2/AhUhT3insWejQuTozd2Wy5sc8NaZbRk0xNHxUA4MQtQheUODGiwxY3zJfVG+q HYN0ba4JvT0P6fbTLjBOdcjwiQ2PZB3nZM3I58D2zKiX9/2BhjObbHglbxQ+R+Be8w1E WBEtNfBU3KWskGvqMu+Z96tygaDFrQvFZksYOTjfDKqjUsCvegxDnesXjUS2FknsjQAs fS5Q== 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:references:from:in-reply-to :content-transfer-encoding; bh=KhtSZr2c56r54K7IpY0qcNj65rBp4GOZJk8SwvpS20Q=; b=SKYfr9QV9G1NhiY9KzdVU8ZScLu/PhOpnSDQMTT/qon7R/MCzOHnfOkEvgs2Z3Jrwx EdQj0OrzfGy6LINBT4fjl36Dg5gAG17KLSnJqcyM3TAfGISTBr/7WLWpu0s+TO90t1mQ 9/a0qc4JbIC0uClrh9DbztaUDKERmmpix/126cV16MagIJLigvp96A5XmhDm0t9VNNVf jA/A6E9D+MWNKymseAqgdGy7Q8HgkGAQ7BZ+O5bwW8DKlRjVXC6qe2dW+o0GcRivH9v1 XO9zEYcjoKZcbekUTuk4hg/y5gxQahru+kqs4Id1LtFm/V1n7DTYu0nWZRJVTsMWrnDA 25eQ== X-Gm-Message-State: AOAM532f6kV0K07Al/OQZd0y7G4zM1ELxcxxVWwWgX5CLRlLqt9UD9Dj 9+jyJnHmWF5KvpLKNfg0V5qkyg== X-Received: by 2002:a05:6402:2794:b0:419:2ea9:7de3 with SMTP id b20-20020a056402279400b004192ea97de3mr43060432ede.169.1649842791323; Wed, 13 Apr 2022 02:39:51 -0700 (PDT) Received: from [192.168.0.203] (xdsl-188-155-201-27.adslplus.ch. [188.155.201.27]) by smtp.gmail.com with ESMTPSA id b5-20020a17090630c500b006e8044fa76bsm9711375ejb.143.2022.04.13.02.39.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Apr 2022 02:39:50 -0700 (PDT) Message-ID: Date: Wed, 13 Apr 2022 11:39:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] NFC: NULL out the dev->rfkill to prevent UAF Content-Language: en-US To: Lin Ma , davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220412053208.28681-1-linma@zju.edu.cn> From: Krzysztof Kozlowski In-Reply-To: <20220412053208.28681-1-linma@zju.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 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=ham 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 12/04/2022 07:32, Lin Ma wrote: > Commit 3e3b5dfcd16a ("NFC: reorder the logic in nfc_{un,}register_device") > assumes the device_is_registered() in function nfc_dev_up() will help > to check when the rfkill is unregistered. However, this check only > take effect when device_del(&dev->dev) is done in nfc_unregister_device(). > Hence, the rfkill object is still possible be dereferenced. > Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof