Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp82514iog; Thu, 16 Jun 2022 22:35:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tUYUoe39eIPNeWQ/xSALLsKBC+wRoAt66IMkFwMlFf6UxHIhy7JPvKc1/2z7o3W5WrKfGk X-Received: by 2002:a05:6402:e9f:b0:435:644e:4a7d with SMTP id h31-20020a0564020e9f00b00435644e4a7dmr585610eda.114.1655444105831; Thu, 16 Jun 2022 22:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655444105; cv=none; d=google.com; s=arc-20160816; b=iIeHjl3j2FxH7RJrkphDceu+6JXxCnKNntHZWZiKoRTiJeZrAfi72ZtyKRcN5gCPeL O3/mQ3+JSUPdHLmG+NSmyuBvtc35YdlJd/rwKqQpFGwoEFuMw7tEbpTkdwsSYwFOY+f6 09zBPCp5pnjZHXU8RqYiP9L/qwA7yMi9OBrvNPGFgLuDaxd3Bt2YeIrveTm7w+aULhX4 GURFUjyv94qJnHa917+wgEYA0+kQWjDHr1EU3gQ49ja4usVPP+if2AUAiW6S+d01onpO geFBHaj2zOPjeWAecoTQem0jBfm/SYdLRVn1AKrJh1KPYlSjg1T1avwzfAFCG2f+DaBw BGvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3kogNl48Igq0sjUSHZ2cHxkX5GFxsC19iw2HB9fEgUg=; b=foD9QfcN9W6qwYWTgItS8ENasNXG8YQEnrwcD9SbVP4v7F4qX+++E6fTUhMEcf+z9V 5qnD0zJrcxJHZuxPlO3gR6ShvTNKEYgZB2S+AflmSYEw9A5a9iDfSpdXXGmpNI2OJYrl 6UtfnANPm74QtIn3rtwt6+0pTRno7c9HyJrMeXXz491Z3MbZH4wZHg4SvNTQ0Dn1W47b ZXahcp2ttKPMCyp3DKsTxjl/9kSLLN0qTyLN7DGNsK/6VvjExu9BwFn7RfzYrdRXBl8A m+lGonoyH+WitV6NJNwHsKSdPXzUo6kCMuawYqMsU5TUOIyL2o2RR3KaLnM2cn1GA+OK a6SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nyu.edu header.s=20180315 header.b="OY/juXmn"; 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=nyu.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs23-20020a1709073e9700b007157ddd2e51si4024215ejc.882.2022.06.16.22.34.39; Thu, 16 Jun 2022 22:35:05 -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=@nyu.edu header.s=20180315 header.b="OY/juXmn"; 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=nyu.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233127AbiFQFGB (ORCPT + 99 others); Fri, 17 Jun 2022 01:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237181AbiFQFGA (ORCPT ); Fri, 17 Jun 2022 01:06:00 -0400 X-Greylist: delayed 1016 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 16 Jun 2022 22:05:59 PDT Received: from mx0b-00256a01.pphosted.com (mx0b-00256a01.pphosted.com [67.231.153.242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9975E66AC1 for ; Thu, 16 Jun 2022 22:05:59 -0700 (PDT) Received: from pps.filterd (m0119692.ppops.net [127.0.0.1]) by mx0b-00256a01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25H4VHeF017372 for ; Fri, 17 Jun 2022 01:05:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nyu.edu; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=20180315; bh=3kogNl48Igq0sjUSHZ2cHxkX5GFxsC19iw2HB9fEgUg=; b=OY/juXmnpHNv/r4NdIN0U6Grcc/7h/Qcne4sUSimbvAbcsruYLErq9FUEdyAP6xlzouK QO23OZ2l7daDTbZupxoQctZ8f81pLXGCGAeCSGU/QebV72S/WLAs5+CYUbIaG4atng1W YGdLQ1KgTrpnePJHrscHrUOqBMzH9PSWpl8S8PxeYN9dkCjjX0yUgUZ2n4mPr60v+i6+ 7GUnoKDypBEbR720z1cvgikW03dIx0M1fhXObryfN/YCTGDYuhb4/NcsSvSyXJJjFScF Rfe5YSgjMHwPAIrBjoqMdAeOE8wuoi9ZbWPd9kOFyznEi0DN6eh6cq6TIw/Y+0Kv3kL6 1A== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0b-00256a01.pphosted.com (PPS) with ESMTPS id 3grjnm88mn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 17 Jun 2022 01:05:58 -0400 Received: by mail-qk1-f197.google.com with SMTP id i10-20020a05620a404a00b006a7609f54c6so3931124qko.7 for ; Thu, 16 Jun 2022 22:05:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3kogNl48Igq0sjUSHZ2cHxkX5GFxsC19iw2HB9fEgUg=; b=EG3TaQiPmCZSHlh8/QZoCt5bNMCDU2jNK9vOpnPu27yoescqKuBRH+vTEOPIbPwpDO qAvJLvr+WT7cgRiySWH+acaKHlytcsGmgKumjPJk4bav1mwWonBjG6iRQYOvS8j9xsoC 5NiMyE0byNzuP6u0v8cJtoJxfZ8p8+/rzWSoUYmvic5i1T+DV9cWBRTGnwmtlMtdqFtm ZiG2dogAplc1xKrrCQ5n+EpdJXTW6hOv1mqlsLD2KfwCRy48qMafDyEgxOUFZN48FjAB 5MU5xzc1ESQ/35JrfLTsD4wZD+nfZEs0i1B2vERdWjvQ9APdn8PPU7PuumI1tpWBs7Ry KEAQ== X-Gm-Message-State: AJIora+YyJw9ajhKnvFAEedGwMNFZB/gYyKRQCnL/hLuwFdVlhYXJfTj O2ENvxucxGfuCHnpPMpyN4yjMnouPrKITZWFmBNDggeFmjP4yRUCGFNqBIm6UaH+KEE+t8xCW9r 5bsl83AWWqijgHYNI2p2aZH0= X-Received: by 2002:a05:6214:d0f:b0:46b:af12:e20b with SMTP id 15-20020a0562140d0f00b0046baf12e20bmr7039993qvh.104.1655442358174; Thu, 16 Jun 2022 22:05:58 -0700 (PDT) X-Received: by 2002:a05:6214:d0f:b0:46b:af12:e20b with SMTP id 15-20020a0562140d0f00b0046baf12e20bmr7039985qvh.104.1655442357941; Thu, 16 Jun 2022 22:05:57 -0700 (PDT) Received: from localhost.localdomain (cpe-66-65-49-54.nyc.res.rr.com. [66.65.49.54]) by smtp.gmail.com with ESMTPSA id h22-20020ac85856000000b00304e95ec0fbsm3556530qth.89.2022.06.16.22.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 22:05:57 -0700 (PDT) From: HighW4y2H3ll To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: HighW4y2H3ll , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] Fix buffer overflow in hinic_devlink.c:hinic_flash_fw Date: Fri, 17 Jun 2022 01:01:02 -0400 Message-Id: <20220617050101.37620-1-huzh@nyu.edu> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: H2F68lZii1It7rK680HeFkfyb68Ztqe6 X-Proofpoint-ORIG-GUID: H2F68lZii1It7rK680HeFkfyb68Ztqe6 X-Orig-IP: 209.85.222.197 X-Proofpoint-Spam-Details: rule=outbound_bp_notspam policy=outbound_bp score=0 phishscore=0 adultscore=0 clxscore=1015 suspectscore=0 malwarescore=0 priorityscore=1501 spamscore=0 mlxlogscore=917 mlxscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206170023 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,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 Signed-off-by: zhenghao hu --- drivers/net/ethernet/huawei/hinic/hinic_port.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.h b/drivers/net/ethernet/huawei/hinic/hinic_port.h index c9ae3d4dc547..4a50e75a2424 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_port.h +++ b/drivers/net/ethernet/huawei/hinic/hinic_port.h @@ -13,6 +13,7 @@ #include #include "hinic_dev.h" +#include "hinic_devlink.h" #define HINIC_RSS_KEY_SIZE 40 #define HINIC_RSS_INDIR_SIZE 256 @@ -751,7 +752,7 @@ struct hinic_cmd_update_fw { u32 setion_total_len; u32 fw_section_version; u32 section_offset; - u32 data[384]; + u32 data[MAX_FW_FRAGMENT_LEN]; }; int hinic_port_add_mac(struct hinic_dev *nic_dev, const u8 *addr, -- 2.35.1