Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1209753lqo; Thu, 9 May 2024 07:41:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbB2WahANiLOXkkQ77YOn9IxBKpUTRqVmUJJXA7tyi6FYyxfl3MK98dNV4tRKUJvv27M94kNuxfP+t1FFojGEHEHjKQlVUC6vmCcmyaA== X-Google-Smtp-Source: AGHT+IEiW4PVEV6QK95/KW6AEEyXaN4j1TFF48zmVOfgkCwrETH1DoMFsWDaEV6FoOu1ksX/7tZ+ X-Received: by 2002:a05:6a20:d490:b0:1af:b0d0:281 with SMTP id adf61e73a8af0-1afc8d044bcmr6985799637.6.1715265695662; Thu, 09 May 2024 07:41:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715265695; cv=pass; d=google.com; s=arc-20160816; b=vCaWlgcFAOph33b+qZLADh6JRGW3tJZ2tBek17zdktJr0Jj4OR8rf/k1233C8ZcZ/6 jRXPkiHnl/l//Th5QngU1Tes1gEQE08io/pwoqajKk3xJOTOT7od1JF0kHCAaoeQQ+NC SdWzMRCBKPNIj3XpVd9eHyN+MkkoSq++1R03nwUTPcmib7WdObdJ9E6Uq/pYQr6uXjN/ Z7T4qhh42ZOLXB5e7IOALk3FCUzwOOat1C8FbsUXP5h+DxOlodqh0Qct8eyXyFdQ6cGN TSxhEn5FRY/5Kd1kLW4XCoSEVnr0mdW4ygxwtYL1LxYzwxZxKwrgVWgjlsnl2RPfSQ5o 0f5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=0fgJc8E2KgKNGLKRWDqADYaZW8wGqtQXaUAbdG1wpeQ=; fh=Rhu3tN3uW3qHee0ikKzmbiQcVHo6Q4eqKdSgxR1fh8c=; b=Jusk7mptEt+dgXcsNm6hfP/kePjuOOhXt2x7KqcVxSc0Z+RztIinc/zMFsaUVWuuwF tGeLFTDyWkclwcuJiPTo4BjY0Y0pHmfzLHU4GAUSdy8V02PsXKkI0vF4ZJCZed6NQTjE psn8SjER9T0hGDmgPCft+gpce/LeiZsLJ8WQF8xr39XjNE7kd1knH3OmjRCR3kncQd+0 IWVKeereFbpvZcIeY35ZJ2czpnyi/FFgmOOxTvAhhUEX+XvJW5pF1nLykkPrZCWS3ZUG +fdxrn2wyjP7c00iSyjBN2bPyHIFIes8fqIiSjXc5Na9hZxLX4ogy6oFz4O6hB0bDYS0 CAgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dvs4oONd; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-174599-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e82681si1498552a12.27.2024.05.09.07.41.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 07:41:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174599-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dvs4oONd; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-174599-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 52B32B22113 for ; Thu, 9 May 2024 14:39:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6FCA133423; Thu, 9 May 2024 14:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dvs4oONd" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 027A375811 for ; Thu, 9 May 2024 14:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715265570; cv=none; b=j77rlKjOB5GOYLDm1rNFukmTyXwNJGOchwt3yD+WX3lKxFQqYIRTO0Mxb7AUFC2nTOO7w7VJP9ndcWR5hP/nhD01dmewQ0q447QKozpJ9fAR8ZkCeWnmdmq/vhJG56Ha7xMlR1kmokETx0miQA4qb7NkF2mm3ltzA6oGE/16Wko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715265570; c=relaxed/simple; bh=Oqw9hCVQzSIH3enl+rGm71JD1XIoGust4N0femSQBcU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Xep/io61WyTsIy6byvcVpQMoWBis4Yd/cc79EBmAJvfI5JNlomcXcMxEj3h9PRarhNNOFSIOlFxG6fLx08QSs/MPRQWrUxwnTUl8rYd1OTnI2DBSCb/Bdg3RwnGbu3DNXVF+eH9x6OSL0C8XCjqccr9YpyP2GBq6zhhpruJPVw4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dvs4oONd; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a59a17fcc6bso234230866b.1 for ; Thu, 09 May 2024 07:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715265567; x=1715870367; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=0fgJc8E2KgKNGLKRWDqADYaZW8wGqtQXaUAbdG1wpeQ=; b=dvs4oONdcrFA38TKdRlkc+gKW9q+qHwNjN8U5UXJhDCaTl7p/eD6Sh/Tjafm73bNua KRSQsCPeBqnbPfb7k37vlt82xm2cRvd8lcxcr1fxDlvfZcUIF0mNFTI62Wx5DvLhFal4 MOCN1kg8/wZ/eRPcGQIIRCzDxFST8+zr09Z4Mq0/djqaexe7DuZwnp/tRGZ/iVFOs2NL xVIdfTWoDKZdeiaAU16uu68wZMIvqUpssuIuJSzWOxRnNUdmvzYqHSNVioG+yW70jmv2 0uYfnIQAIvx4J0B51AOfe6w+70C9C1J4GQ9K83u0yqIUA2OmWMZ1GRPum8QkhbTHiCNQ LHqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715265567; x=1715870367; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0fgJc8E2KgKNGLKRWDqADYaZW8wGqtQXaUAbdG1wpeQ=; b=qqEDV1+kisGPy9VVBnprXND5HPEjJwZcwKzQfLkF6hNk5vmhLXWW/JHN+YYn+Rp1E2 VXGoMOJn2rA/bWubOQSuOE5DRA93Vu9GtnOKMYIoA4FIxmo52gI6UM93pZgHVm9GnVGA VK8mjs+3kJi7SK5S+0SM8jiZ9CG5kqgP9m52hA72uHfEVgw5nDsHQdhMwaif0q0lMu+Z 1JgpCD+2R9gfQtdQz2Ciberu/eoawgveLZHQ5W+/Bs2t04a06G7huT7AjmKHRNIeiTXH y5R+PbZ9KX6Fxa56DCUB0swkwWgijqHXAB943mON2GufedYlkf7lpReLEvzGRXrV0R5m bwEQ== X-Forwarded-Encrypted: i=1; AJvYcCUnTTI7C904Bl7rDzEoMmrKCMczDfMzIyJPbup7/17gfd+UURJopO5KoLF/2egOq5LZ2bXq07OgYTRXCpA9vniGkBAU9wf+9PGtc1OG X-Gm-Message-State: AOJu0YyfoapCVnBGlVEv7lvzp/wTau3fSKjs6qcrgdBDGmfDPvWwEWtZ cImYhsDD5go91SjbIahNK50lGfPn05WXKkFSuN1BUgKYAKTwucHSglArEKUeZQM= X-Received: by 2002:a17:906:fac3:b0:a59:beb2:62cc with SMTP id a640c23a62f3a-a59fb9dbd48mr357841866b.61.1715265567328; Thu, 09 May 2024 07:39:27 -0700 (PDT) Received: from [192.168.1.20] ([178.197.206.169]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a178a9d68sm80346866b.80.2024.05.09.07.39.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 May 2024 07:39:26 -0700 (PDT) Message-ID: Date: Thu, 9 May 2024 16:39:25 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v4] nfc: nci: Fix uninit-value in nci_rx_work To: Ryosuke Yasuoka , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syoshida@redhat.com, syzbot+d7b4dc6cd50410152534@syzkaller.appspotmail.com References: <20240509113036.362290-1-ryasuoka@redhat.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg S296bG93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AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240509113036.362290-1-ryasuoka@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 09/05/2024 13:30, Ryosuke Yasuoka wrote: > syzbot reported the following uninit-value access issue [1] > > nci_rx_work() parses received packet from ndev->rx_q. It should be > validated header size, payload size and total packet size before > processing the packet. If an invalid packet is detected, it should be > silently discarded. > > Fixes: d24b03535e5e ("nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet") > Reported-and-tested-by: syzbot+d7b4dc6cd50410152534@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=d7b4dc6cd50410152534 [1] > Signed-off-by: Ryosuke Yasuoka > --- > v4 > - v3 patch uses goto statement and it makes codes complicated. So this > patch simply calls kfree_skb inside loop and remove goto statement. > - [2] inserted kcov_remote_stop() to fix kcov check. However, as we > discuss about my v3 patch [3], it should not exit the for statement > and should continue processing subsequent packets. This patch removes Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof