Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp120109lqj; Thu, 11 Apr 2024 11:29:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfRn94XgwLMQ4rsgWbkM1JB4mGWKAqdMsWCoAvZUMhBU6fvUxgj5bDIg/+v6aRhz3Kk2grBp2k4OQ/IQNSe7KHKvNfWvrQIbKPjm0UTg== X-Google-Smtp-Source: AGHT+IHqSQvRoQomnD2zKsBPwFd7U0sr1lGheAnEaNq5h0IRq4v+vW+zI7ZnqWRrBzXeveaTMxyT X-Received: by 2002:ac2:4549:0:b0:516:d416:a7a3 with SMTP id j9-20020ac24549000000b00516d416a7a3mr434899lfm.14.1712860196477; Thu, 11 Apr 2024 11:29:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712860196; cv=pass; d=google.com; s=arc-20160816; b=or/4Wcbm79Rw06funIS0tXEinkEmSTsD7RHxuJJa9VnJrhwf/QkxRQH0dDWf1Adlaw KkYm9QZZvV86VSmCuvfyXGVFXmr5WHTVdQzY2IQJz6LjOjt94u4lrZen8YiZ0JC2yBRo etOmYGJSX7qSsZb2y7Z8wxuody5NnH4XGuCZTtut7+dNp53WQygJCIyu8NnEdv3O8aJv SLCqojcB0e+CONESs00++Z6dHE/34YchGj0umTJAlH8dNBZhpPqAWrLUVeoxENhY4rvl 1xwCiiwYb2djp/3C77+6GPOEBYQBzQwHLyjptJrS6glcLpPfrhyTzAmog4fMyqpQuSMY gPLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=bg+20wp3Le4X91w4ozUwj5L1yb0W2jai4VIb5/iv4Jc=; fh=sxorC0j7DMlOzBbPy8wTgiTTHmeRULP/kNU/8DH2ZWg=; b=LBnHs+HL9SYhunS7Bx3DDw5yCeujF4Vv4fBThZFqoYZiG8a8M0itrny7qQSe4SQu7+ dR5v47Nv5HtJDMzg6Bn1H2JgwxMUrzkSo8aLakAFeZUebFsd2artYxdfp/8py755dzJZ ozlXcGjPJQ2hwTPiaEw6hD4V+88vclo4N4EMMXwos2lkXVRvjHB9lWQTbeAgrx1Ttp6W xIxZfrQz7eFDa6/YS87DO7KlKuOakCeoWTvp368rZbgHK+Fu+FF+3eQ/UkWW2AX1Tcjk zikt2sTXdL0o5DBFKaOODSRNmT6n42xhbnJM3xgKJpHQTqfvD/A5utyvRrXmJoXvL0bt yV5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-141435-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141435-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s19-20020a170906bc5300b00a4e98614b44si966108ejv.958.2024.04.11.11.29.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:29:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141435-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-141435-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141435-linux.lists.archive=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0DA501F22CFD for ; Thu, 11 Apr 2024 18:29:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A221D40C15; Thu, 11 Apr 2024 17:56:18 +0000 (UTC) Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64DB03F9CB; Thu, 11 Apr 2024 17:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.154.21.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712858178; cv=none; b=X6LOUcOhz92wtEtM5KTIfO8/WjqJrJTl3uoF61Ctd8PUj5W7nSBJQBoakEvw51CTxhC3B17XpfNtUiitLrRxe2FbfyyL+Pv4bkYwi2Ai5O7AkmGZhPWp94JXiid7SgUt2hDAbNyO6oJjUML/uOroRWL+Pg8yYMh+HZ9PcW/jI9c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712858178; c=relaxed/simple; bh=lM0JrKFMnVWxg7ZhHZ22iVaZdtHVDJwtbdyMIQClsJE=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=qQgVoFqopLieJDhrleqRKAdMtMlPUsndOB3zAUqrzGK+z277k2OeJriA0Bhe/p2qzezDuqIBpK5IXUY9P90mxoupgDgjPujsOz33aXRg/sB/SfDsnM972cjQI3Cutb0DKTgAUJ+7YTuQ+2w3Lyb6wVDlKG42A043eBxve7/tZwU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru; spf=pass smtp.mailfrom=omp.ru; arc=none smtp.client-ip=90.154.21.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru Received: from [192.168.1.105] (178.176.74.224) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Thu, 11 Apr 2024 20:56:08 +0300 Subject: Re: [PATCH net 4/4] net: ravb: Fix RX byte accounting for jumbo packets To: Paul Barker , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Geert Uytterhoeven CC: , , References: <20240411114434.26186-1-paul.barker.ct@bp.renesas.com> <20240411114434.26186-5-paul.barker.ct@bp.renesas.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Thu, 11 Apr 2024 20:56:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240411114434.26186-5-paul.barker.ct@bp.renesas.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.1.0, Database issued on: 04/11/2024 17:36:52 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 184678 [Apr 11 2024] X-KSE-AntiSpam-Info: Version: 6.1.0.4 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 16 0.3.16 6e64c33514fcbd07e515710c86ba61de7f56194e X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: omp.ru:7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.74.224 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 04/11/2024 17:40:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 4/11/2024 10:51:00 AM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit On 4/11/24 2:44 PM, Paul Barker wrote: > The RX byte accounting for jumbo packets was changed to fix a potential > use-after-free bug. However, that fix used the wrong variable and so > only accounted for the number of bytes in the final descriptor, not the > number of bytes in the whole packet. > > To fix this, we can simply update our stats with the correct number of > bytes before calling napi_gro_receive(). > > Also rename pkt_len to desc_len in ravb_rx_gbeth() to avoid any future > confusion. The variable name pkt_len is correct in ravb_rx_rcar() as > that function does not handle packets spanning multiple descriptors. > > Fixes: 5a5a3e564de6 ("ravb: Fix potential use-after-free in ravb_rx_gbeth()") > Signed-off-by: Paul Barker Reviewed-by: Sergey Shtylyov [...] MBR, Sergey