Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4905277rwb; Mon, 31 Jul 2023 14:28:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/O36VQda+sa6m0EX+5CMS54SegSg8Dup3gYZiI9yTkLQCjnpnwWBt3iSRXb/Va8MdhcuJ X-Received: by 2002:a17:90a:17a5:b0:268:ac3:b1f6 with SMTP id q34-20020a17090a17a500b002680ac3b1f6mr9762115pja.24.1690838894457; Mon, 31 Jul 2023 14:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690838894; cv=none; d=google.com; s=arc-20160816; b=sg6LKVlFzi4/r8qJi2+RUmoaG0Pu/LP5vKiup99xuc6qcfO25txBbHwdB/VdE/21Hc Tdebs+dSD7OUZSLlc7ppe9a4BU9vtuyo9UibHnbAJcBYx0ibBqoRl1JMJNIbUQQ2JxVI 7pmrUnh3vUog8ZTtpHjka64mHpvYHLVGgAT8XkUU69haLQU58pWqnJmTU94HutWYOGvL jRiIsKD2ZlDC4LiDeGNshVgNI8eHF0WAdf0V/jROCO0OJ5b6bJDjHERkiKHFC54V8N/P sOXG+VaMEBSogAQ+u8QOvVRMQu4xpSKDLIgEJ/3n8juaBPegAWdEtt0qbl6xGP7uzvwp hW3g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/Kd2V0k/lLv+56J3a2P0teQNuzHpQLFn1rCvoLa66pA=; fh=iChFvbCajSo3DQJGsO73jqdhhZ2+SdPvowuNS9GwFm4=; b=hB7h9+BuKk8o4N1wNv9tIi8yStsH1/B20jXGyGrFDY/3ZNEUtMafKR3I9+YHwyEe1U HyDfxE3o8mWQP8God2XqWs5ABDy4bMX5qLzf0ByUpFd3EtBix3iG/A3aisKpysD3Ovm+ VaMViTBJ+aeALYyot1BU4DbQes0XDsXcgYbhoa3WvPKlLO5xwaruEO8K/GwVkYtkze5Z MYQR6XBcLG5ol3USA/A5kZdb5Y9LYTYUSm5hoTdELmbzW/WILCraQUw3wvZeR7nFh6Mc tm4M8WmZSDMUcIhd2B919XgCCwT2+epixnZ3RnbVQrwE7sNpsd2z0BTu7anR/66WoC3D c1AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="wZ2Ul/Pq"; 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=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a17090a694500b002635643286fsi9365039pjm.133.2023.07.31.14.28.02; Mon, 31 Jul 2023 14:28:14 -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=@oracle.com header.s=corp-2023-03-30 header.b="wZ2Ul/Pq"; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbjGaTpW (ORCPT + 99 others); Mon, 31 Jul 2023 15:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjGaTpV (ORCPT ); Mon, 31 Jul 2023 15:45:21 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29CB91B2; Mon, 31 Jul 2023 12:45:20 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36VDTJ9d029568; Mon, 31 Jul 2023 19:45:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2023-03-30; bh=/Kd2V0k/lLv+56J3a2P0teQNuzHpQLFn1rCvoLa66pA=; b=wZ2Ul/PqfCjHcGbXtQKfkg7LvjO1Uz7FuCJ/X+V3HDx73aBNb7ABDg2jARpYeHXraJUf QDhQe9lmW539EgQBovyTdFKXXnY2SB05LgvorL0JedTJvaK/Z14js2Ug3DGR0avtjl6l taYv/m7qb7IsPtxI4b7C/DAK+1jCRLDO0wTdQQj/61aFx1lpqO91MTwbzA7TzKh9hg5g MDr9Xmvt0z/Wcv7I0Pl8VMfcXqHzJMHhyo+XqcaHp2BOKrzCgiazLDuqFpNBgc7POgeJ fm++UZt4+kCLUaqPrrlnydbjp0DUqiTd1m/Wr3L2VrSqm9nan5Oat266Qa+mt5R8wNCH JA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s4ttd3f7g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 Jul 2023 19:45:17 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36VICZNl013711; Mon, 31 Jul 2023 19:45:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s4s75cmke-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 Jul 2023 19:45:17 +0000 Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36VJjEfd025102; Mon, 31 Jul 2023 19:45:16 GMT Received: from ca-mkp2.ca.oracle.com.com (mpeterse-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.251.135]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s4s75cmf1-3; Mon, 31 Jul 2023 19:45:16 +0000 From: "Martin K. Petersen" To: ketan.mukadam@broadcom.com, jejb@linux.ibm.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Lin Ma Cc: "Martin K . Petersen" Subject: Re: [PATCH v1] scsi: be2iscsi: Add length check when parsing nlattrs Date: Mon, 31 Jul 2023 15:45:04 -0400 Message-Id: <169083266402.2873709.5582459662630461146.b4-ty@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230723075938.3713864-1-linma@zju.edu.cn> References: <20230723075938.3713864-1-linma@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-31_13,2023-07-31_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307310179 X-Proofpoint-GUID: Kjo8zRpKKIxmtaS3UR17VIGDwZPs8kkz X-Proofpoint-ORIG-GUID: Kjo8zRpKKIxmtaS3UR17VIGDwZPs8kkz X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 On Sun, 23 Jul 2023 15:59:38 +0800, Lin Ma wrote: > beiscsi_iface_set_param parses nlattr with nla_for_each_attr and assumes > every attributes can be viewed as struct iscsi_iface_param_info. > > This is not true because there is no any nla_policy to validate the > attributes passed from the upper function iscsi_set_iface_params. > > This patch adds the nla_len check before accessing the nlattr data and > error return EINVAL if the length check fails. > > [...] Applied to 6.6/scsi-queue, thanks! [1/1] scsi: be2iscsi: Add length check when parsing nlattrs https://git.kernel.org/mkp/scsi/c/ee0268f230f6 -- Martin K. Petersen Oracle Linux Engineering