Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp595226pxw; Fri, 8 Apr 2022 16:08:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtP6VvsvpLoWXDP5HBDz4RsD4prN3ubrn2VLKFTFz6lsRHMH+Kib4TP+mR195I6+1oL0B5 X-Received: by 2002:a17:907:7204:b0:6e8:504c:fc96 with SMTP id dr4-20020a170907720400b006e8504cfc96mr4758858ejc.121.1649459293294; Fri, 08 Apr 2022 16:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649459293; cv=none; d=google.com; s=arc-20160816; b=QV1XcXWQBl7iF7kwDRTgJOPN17yLWM8xMHP1A306C5ox6CgsI5X6ORmWlQO+KdJb5v ugVMr1ltOhlrhVk0eJGdoG8gJWEtot6oVj3FNnMslv1dUUnzB+MJ4P6BVKSEP2Z3Y1xF FRC35VSQ+Ap1xmumUPd8D63Kf/amaQNxFqbKHVevp9aV3OgIkxDCbmCXJ0Lj/D68U84i ilnXw1MEUiJzoTP7JA9VeKl6N/Sg8n9LisZSHeSaS2hyszZ+MLIYMpATO9xERkLBVQir tIypWyyDJKFLk1vpXJDwFonvpcJA7MjrHyj3LjCPFr7wWyj1+HfL+cOXVrU3QaMs3ASF MLXg== 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=Cu2apFYpM5bPz1vZIij3a91tdWX8TyF7yQXIxmBRn8A=; b=OO97DSDV+318FjpN77GfWk8WzUTeHO1oQBnH6pzuUJFSXOOHbWPEZzwAUojit8z+c2 kdIScHV6BHwpsKwKpFRznIDkiG2RvE6cTOkGW2ki4OP3chW3/3cHaxc1o2ZwcDxJKKCQ GoMaAsIxzV057Ji1aKrIixh5bIndjvY90nLLPf0XcKhz+e1M+rIZN5L47pfh30HhuNlu bpGim6hhhZhnwVS904GGhFbheix4qSFUCHusiNBjdG/EzrFGIZEb7LUp1up2v4tEfHYL U5OlvVBar66QEIlQ4AK6GDLpLthu131rxyz00wMVky8POAJQdKGXB6YF5c+gvxPAG8Qf bVaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=JkqIg8J7; 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=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a170906224300b006e0660cefcbsi2070936ejr.356.2022.04.08.16.07.25; Fri, 08 Apr 2022 16:08:13 -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=@marvell.com header.s=pfpt0220 header.b=JkqIg8J7; 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=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237013AbiDHOlX (ORCPT + 99 others); Fri, 8 Apr 2022 10:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233877AbiDHOlW (ORCPT ); Fri, 8 Apr 2022 10:41:22 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ACECECB2B; Fri, 8 Apr 2022 07:39:18 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 238DXrgB004524; Fri, 8 Apr 2022 07:39:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pfpt0220; bh=Cu2apFYpM5bPz1vZIij3a91tdWX8TyF7yQXIxmBRn8A=; b=JkqIg8J7iTWfWkKknajNn9WQ7LBxrJY2LmdOM+MxRgI2aq0DUHOJTxE3whhaKVuVy7HX 6Nqlgnirns41njwbzwHIunCtXRcSMwMWUHRArGT+1fkE8/+1VkfWdo1ZEbQFFrUI7E6R mHuZLExck1iwKbNKY+9aDXSeGo/s3YoUESws2jiyH8M4Z0a+DxhWX6rKqb8mWyCS3Xfy TtHAxWhgeOd08izksdleIx9+tFsvXA+wOi+vGeofCtxcOuOz3B3bNItiKyoWjH4BF8rV vMrfgmS/6nEGkQsSbQ1BcWqyEBqUYs4t+2ADLcgBe5q+Yan2Xx5PB0ZQ0YtDjmmK510E Zg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3f9r7erhnu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 08 Apr 2022 07:39:03 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 8 Apr 2022 07:39:01 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 8 Apr 2022 07:39:01 -0700 Received: from [10.193.34.141] (unknown [10.193.34.141]) by maili.marvell.com (Postfix) with ESMTP id 9A67D3F704C; Fri, 8 Apr 2022 07:38:59 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2022 16:38:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Thunderbird/98.0 Subject: Re: [EXT] [PATCH v2] net: atlantic: Avoid out-of-bounds indexing Content-Language: en-US To: Kai-Heng Feng , , CC: Mario Limonciello , Paolo Abeni , , References: <20220408022204.16815-1-kai.heng.feng@canonical.com> From: Igor Russkikh In-Reply-To: <20220408022204.16815-1-kai.heng.feng@canonical.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: mfWi2QzyKu_I-GBIafCg-kQQTJG2eqDb X-Proofpoint-ORIG-GUID: mfWi2QzyKu_I-GBIafCg-kQQTJG2eqDb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-04-08_05,2022-04-08_01,2022-02-23_01 X-Spam-Status: No, score=-4.9 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,URIBL_BLOCKED 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 > UBSAN warnings are observed on atlantic driver: > [ 294.432996] UBSAN: array-index-out-of-bounds in > /build/linux-Qow4fL/linux-5.15.0/drivers/net/ethernet/aquantia/atlantic/aq > _nic.c:484:48 > [ 294.433695] index 8 is out of range for type 'aq_vec_s *[8]' > > The ring is dereferenced right before breaking out the loop, to prevent > that from happening, only use the index in the loop to fix the issue. Thanks, Reviewed-by: Igor Russkikh Igor