Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2919889rdh; Mon, 27 Nov 2023 02:12:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqk5Z4hAOVDk9rRrIbvxoFF1rTJz1jgIsFndZY83ul6roebBNglU1hY14f9jPhKHSdbo5x X-Received: by 2002:a05:6808:221d:b0:3a7:7bea:d3cc with SMTP id bd29-20020a056808221d00b003a77bead3ccmr13214312oib.0.1701079977775; Mon, 27 Nov 2023 02:12:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701079977; cv=none; d=google.com; s=arc-20160816; b=mmAsU3Wzl1WAG+b3Ie/RiI6ji5DBaiHOfntp3D2ZZaY4umPw/Jltk1O+MXNSoSASuz 8z/zHuZ8kE/+ggm1oxogCLCnUQuemmsyWeN/Sg6FCbxolhhsy20SE1OgEvg2271kobVY smJWCC2HapH9LHUW5oSAJFjkTPEflP+ggv686DsW95JmsHFuKWSdRNxXFqFnPrm2swXI nUwVlii3/G4sTHitjTVZQIb0Eo5tIDYnNBaddPhHVRc5BHZ69x8soSTcEsW5NS6LpSgW dOjvsClJsiqNBacBNYVMb6wWmoYHqPWV0pYd0SRiUHq/mriXaF3pfurWUCs1/r81RxsI zjuw== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=pSRf/M0O+ZKi6iHJXEPlgfivAVZeJl23LnlZI/T7QFY=; fh=HBKlYYNy2D67kj+EqdyvSz/LG4kPqFUZm6r3q2VAzYU=; b=ELP+aQDJhlBQX/WyppE5TDE81ekLoL2C5XnYcksuT40e+0zV8AIkXc1K4cDWqax85l lHk8+aUINpZqCJd1nQOr6f2GH9UzwvU2ffzzHKQwTye37Vi8D4CKOIr43jwbGn5RR8v9 M5zZCjFCIdJpsjMT84KB0jMGcONnGzoQORHo4LBe1+oP+Yrlph6l5OpmboyHWLSemnKy Tqz2mrZFvj6T/0hj8QDfiI3iRgj6nCcwo785YSHGglX0Ke/PD1g0aAdOQZKcFDlcxbHM 1aCIJsgW5NLAmVDsNDZN0qli3gm8MzLIDcqfagyrlfTN9pJShPvJn6d6MbzE3WvU3pNt 9Umw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g0hf1x7x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id k1-20020a635a41000000b005b8ddb9c305si8904189pgm.30.2023.11.27.02.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:12:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g0hf1x7x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 63A74802BD4D; Mon, 27 Nov 2023 02:12:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232711AbjK0KMk (ORCPT + 99 others); Mon, 27 Nov 2023 05:12:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232862AbjK0KKt (ORCPT ); Mon, 27 Nov 2023 05:10:49 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA4810F for ; Mon, 27 Nov 2023 02:10:54 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a011e9bf336so549638466b.3 for ; Mon, 27 Nov 2023 02:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701079853; x=1701684653; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pSRf/M0O+ZKi6iHJXEPlgfivAVZeJl23LnlZI/T7QFY=; b=g0hf1x7xJObHU1aQWZ78X1e1UT/hYcFntf2rpmUNJdtrdztsblv1M9AEOE7a2h3rHC 905ig6apmLFvsS6dGxIDJH8DqHD3OcgQA+gynfN1Uxj+6wZmNdkFLCXkhjrtasuAHT9k 2u9yS0W1z75q7+xMWDYvAi39/j0/IR8yc85Bx5ewptPGfTdxc74wK5FT9WMnhjCLJv0L 2goQSNpV9vo3CEVXD09ErGhOo0r3MXLUhwZrFzupVjWSJHORZSiAM3tv0u+An+cK9WBc 7yMobVf8ZvKmY2GEOubWXCDXOYsZJP3i8uL2ZYX0pl4lBlPkXv0hKkpDB6g4ZQpGhjvm lStQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701079853; x=1701684653; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pSRf/M0O+ZKi6iHJXEPlgfivAVZeJl23LnlZI/T7QFY=; b=ArNHx6k9uR7aXXUJPJnRQ2GXXCDoaIKAM9wSUsKXBBPaD0AQtgYerJIWGjuM2jt/9d WCq1abDokpNJi6ZJF1hzULVei0BRL/3nNa91MbFBBFQuqXuPQDhPjYRXrUjZ0NFMtdgL M2OK15MbRjCH0ZlGViTaUsWKJ2PU5jLetgXTTlGfqtYQjmPZ9r8gWBXPe7P05VpKStCJ rwxKQwL454nVTudgNjEO+offGtqwUP6kYg7VPTbea6bx1No0b9UTqA8aX4UFHHI1jDZw s5hJpgKedu0Rx22gEqk1YCs66kSkVwdzr0fAusngIGkLpHEjg1a7a79WfzasBCQoLJEx FFWw== X-Gm-Message-State: AOJu0YyPRGMuN7xklqDogg/ti5kd+BsU1K9fFVrGVelr+Kz3vQvnrAi8 Q2CCHPFc07WZFroJ3I1sUVQVdA== X-Received: by 2002:a17:906:2c4d:b0:9bf:b022:dc7 with SMTP id f13-20020a1709062c4d00b009bfb0220dc7mr7916810ejh.48.1701079853422; Mon, 27 Nov 2023 02:10:53 -0800 (PST) Received: from [192.168.1.20] ([178.197.223.109]) by smtp.gmail.com with ESMTPSA id bw24-20020a170906c1d800b009fc24437439sm5491621ejb.158.2023.11.27.02.10.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Nov 2023 02:10:52 -0800 (PST) Message-ID: Date: Mon, 27 Nov 2023 11:10:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] nfc: Extract nfc_dev access from nfc_alloc_send_skb() into the callers Content-Language: en-US To: Siddh Raman Pant , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0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I09jNGbRA/ABEBAAHCwXwEGAEKACYCGwwWIQSb0H4O DFH41ZZ3t1Qbk0N9O0FimwUCYDzvagUJFF+UtgAKCRAbk0N9O0Fim9JzD/0auoGtUu4mgnna oEEpQEOjgT7l9TVuO3Qa/SeH+E0m55y5Fjpp6ZToc481za3xAcxK/BtIX5Wn1mQ6+szfrJQ6 59y2io437BeuWIRjQniSxHz1kgtFECiV30yHRgOoQlzUea7FgsnuWdstgfWi6LxstswEzxLZ Sj1EqpXYZE4uLjh6dW292sO+j4LEqPYr53hyV4I2LPmptPE9Rb9yCTAbSUlzgjiyyjuXhcwM qf3lzsm02y7Ooq+ERVKiJzlvLd9tSe4jRx6Z6LMXhB21fa5DGs/tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 27 Nov 2023 02:12:55 -0800 (PST) On 25/11/2023 21:26, Siddh Raman Pant wrote: > The only reason why nfc_dev was accessed inside nfc_alloc_send_skb() is > for getting the headroom and tailroom values. > > This can cause UAF to be reported from nfc_alloc_send_skb(), but the > callers are responsible for managing the device access, and thus the > UAF being reported, as the callers (like nfc_llcp_send_ui_frame()) may > repeatedly call this function, and this function will repeatedly try > to get the same headroom and tailroom values. I don't understand this sentence. "This can cause ..., but ...". But starts another clause which should be in contradictory to previous one. > > Thus, put the nfc_dev access responsibility on the callers and accept > the headroom and tailroom values directly. Is this a fix or improvement? If fix, is the UAF real? If so, you miss Fixes tag. Best regards, Krzysztof