Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6105388rwb; Mon, 14 Nov 2022 14:31:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf5mkVHlNzHQLIzY296YTfqoyja4s337bXnuMoHiXCIof0lauqTzxgtPFeNvgD9AekJ5lMx/ X-Received: by 2002:a17:906:5ac6:b0:7ad:ab0e:76aa with SMTP id x6-20020a1709065ac600b007adab0e76aamr11482061ejs.435.1668465116621; Mon, 14 Nov 2022 14:31:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668465116; cv=pass; d=google.com; s=arc-20160816; b=QI4sZu8XVzHnUp1lczHBXvrB5ijKx20iwnoA2BmeC07hZhjLeWhnvqdRZmOoospWk+ WB5JdTI+p8QCLpLDOvlGRvhdz95vDUuft2OLCp4Nz4kX3AcvLlQjQoMYemZXSLnwJqAR lCUf0MLNwzlxpGzHcFIlM80SYqU7+3v89gXHlhb3QJKKjY71bVVD44vVP3J6j8t8oC2Z ygmbZldMZq4pWoIYmhFuqz3Qo0wrf3zH9M0MwVXtTaAVBzDpF251+rCGP3kr3I702jeG YNWXTEJ+0S671TxNZpWlXaCGaBIwoUqSwKI105I1o4M3v/HvFKhCofxjJBgaT1NYU2pP G4OA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=GgNLbRrKUhcGECxl737HVOrzL0RvP+ORLHBgsorcxXM=; b=t1HoFWO0OK7X8t31qLklxICDmzjAmz9tD2fYerR/1so14rlbwWMp3aSAnVGVmL1Xvp 2nckQY4o42r3d21c2FVkg09jSLj0/tHzADWbw5XnIAaTwzwEBveHg4N3g0FmpOfVJuzv tDPIy9Rcv704peHwXqgtTEoFYPq2ZlHUBNBFUY691KOHotqkk/5dtkCdBeGv/8rwC00q s1PENQrGxRx4vyd1szK/dUWzuk5BEQGbsEmz105/dR6iLnR4wk7fL1Bwq0bhSNe71tMm ntM11ykveMLf108dXXZyFTGG+vPL27u932gz+jT7md/WeGoi1eLP8fRkMW5ODAhfIgl/ W4rg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=V480qvEt; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DdAgSc9y; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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 d24-20020aa7d5d8000000b0045d4a88c735si8409978eds.220.2022.11.14.14.31.33; Mon, 14 Nov 2022 14:31:56 -0800 (PST) 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-2022-7-12 header.b=V480qvEt; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DdAgSc9y; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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 S237091AbiKNWY1 (ORCPT + 89 others); Mon, 14 Nov 2022 17:24:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbiKNWYY (ORCPT ); Mon, 14 Nov 2022 17:24:24 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E359FAE7; Mon, 14 Nov 2022 14:24:23 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AELEq3L002751; Mon, 14 Nov 2022 22:24:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=GgNLbRrKUhcGECxl737HVOrzL0RvP+ORLHBgsorcxXM=; b=V480qvEtFMcNzg7u7ypHtdSwD5TlzGyAooMQlib4YW28v3mqM0yvv2VUfbJo/YjaiV7e 8XokXQWwpxfEYOAaaAUycUVCTRGrtK/I30IK4YQFzYnzr2rPJEDLdolAF0u/7e59KSSH kTG86tAtxEVw4Yv5YFN5ErfIZEkifaX7sUjNf4uCNkafsEC8OLDBjx+CYWWrVzqBMR1t u3bgXGwsSdCNMb25vxOxI+ROEwbvt/EPhbrjOdrH+o069T+5/2dyXl8ECF2sYVlT0lYm /JQ+tiSWtIMkMdAmJgzfw+GxzO2095QGyMvUrKzDw5jMvJ/mlgQWZtd1N4qANxu0p+aM Ag== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kut2d8wwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2022 22:24:03 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2AELeB07035179; Mon, 14 Nov 2022 22:24:02 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kt1x4t8qd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2022 22:24:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PipZxgGH+PibjqAgtmHosQWl5b4CkAloBI/UW2pmTQ0Lm7+t0f5e/JWs246Q9/kYW5AV0yOfLcZ0pfKcHO5sYzXNc3ZKR4MCyn2K+VLbONAEAu6NhlExOe2gcVFNkVWNy7nXbJBFMfP6Doa8y8M4f+OSkaQkCBsREZJXJ7wrYTRCHbhIs/66aKo1Mq2O+mfAQKvAQhO9bVCxCzuwjs5hUwfSa6QJBsOlLFhdFZ7owEO8mB+U78rKgDbHfAXGbQhF2j+WEW9QJk0eNo72wfFsnzZeA4xP5oaMp7n5sJ5V3zb6PgZp50fqg3wbhlSWAgGJSiEhFWXbk78barl5g7OtCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GgNLbRrKUhcGECxl737HVOrzL0RvP+ORLHBgsorcxXM=; b=e+/Zc5bjYxyzbua6a4NjG1abdH7kXKwAf8ipgdYIrUwOU38lVhK+NJysiRcfY/gRD7rBaJkvQG3L0CFopBw8ndU16tDKnNhRdQx409/fOU+KX9pH8Nsqp3jonsE3GPpnyd9do8qnYbh0G660ES291pvnX5uEm6FX1DAt6dtSwLi6bR8Y7MkJhyl0UJzVCNa7evKsdfEkvLIA3+UOQDxW7u9WdGNJR6qMVcNfcKvUyUKY0FC1hwgeu997zNkMQng79moARIOmac5zUaObj8fTlwMRJwtnpGPIsiyfNpHKgQNURnn1xCQ5ev123fSazVXuWnkjxCyXBzERihz8LOTFow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GgNLbRrKUhcGECxl737HVOrzL0RvP+ORLHBgsorcxXM=; b=DdAgSc9yOoZJh0nZZW0QrDanJVeZOwa3pscP9z7EoL3fcsqrsRbFm1GuMhMlqAvF1c33YCXoyVubh7g1qmSDZju6mGc8SWhengRddvrLYgSoDgBlN2bdjoAaR1WHZF07f9BDLKhcD4fIh5X4ZTQ+QwsWrqeNVQFZNWbVanNzglM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH7PR10MB6283.namprd10.prod.outlook.com (2603:10b6:510:1a9::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17; Mon, 14 Nov 2022 22:24:00 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5813.017; Mon, 14 Nov 2022 22:24:00 +0000 Message-ID: Date: Mon, 14 Nov 2022 16:23:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2] scsi/cxgbi/libcxgbi: make sure sg is present before calling sg_next() Content-Language: en-US To: Daniil Tatianin , "James E.J. Bottomley" Cc: "Martin K. Petersen" , Lee Duncan , Nilesh Javali , Wu Bo , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, yc-core@yandex-team.ru References: <20221114150923.3544796-1-d-tatianin@yandex-team.ru> From: Mike Christie In-Reply-To: <20221114150923.3544796-1-d-tatianin@yandex-team.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR11CA0007.namprd11.prod.outlook.com (2603:10b6:610:54::17) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH7PR10MB6283:EE_ X-MS-Office365-Filtering-Correlation-Id: 551956c1-47c3-4e80-33c2-08dac68eedb5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uDThhUwCYRnCM9bliZJWmM/w3l0XTySH796g2bkRT3kVfi0kS3CwX51XdaaAY8Kv2WqQYnLmoXq3FvxDP+sOHzV5CI7l3Y4h1+uNhQRgXVC7HcBTdpGkNaqV1ASHsVvD9sO5mP9VaMiEHYf298sIWzE7bj1F6IemX2N9EClafP7yrX0pRqO0FrldKQqXvQ86w80yJnvrOfT0gpZkVBXmbu7GjNF7J3axvGd2MWqlK3yMhJ6x4/MVYRi+AP/J0vqcDpdV/4RxHWnvfJV0JaFvNMa6h+58WfL6kBvr8C9F626er4RL6Ci5oLFr4cpfqtTg/mWN+OyTYfS3b4Ys+XT+eJFKX2CyERWS4NW4KSI0AEPp0jstAov+Zx4RmXpNsBGP8v0hs+F84dW1SDLl/N9lsY+1i9qChUN/suAnEXyBwF+0xgf5YH/e1UKQI0jxtec2H9+fuAJ9x+MBnzrlLKo30geY+fWMI6mZxi/XFZl4obcLNgH7xNEJEGtXDc8S11oUaZDvN0X5CL/uJgvzM3GlvS7MW+ptFbMf3GejfLKM8ncl+cd5OxwRe5sJtFrOLSXX//i65501qlS8msRqgn1QSBAH4JNbTMgBCJ0qfLbOg52SM2T/hudXBLtnUtCaYz9pqOtktDFVEOQetJjoDqFW6YEkQd+Rn2fhsN+Mcoh924pCQJ7WwQ/0eBZ4A+G/zfpn3bmjkzRQ6Ck/Sl2XTBtRtEnJA/CB1JNkkccIRP4Nl/voncZyU/QkHay4aQKbxmPxTFYZIC2EykBYS65tlpMTA31ijWPPTePMdV2tZxJMtjQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(376002)(396003)(346002)(39860400002)(451199015)(83380400001)(186003)(38100700002)(2616005)(2906002)(53546011)(8936002)(4744005)(6506007)(478600001)(6512007)(66946007)(8676002)(26005)(4326008)(66556008)(6486002)(41300700001)(5660300002)(66476007)(316002)(54906003)(110136005)(31686004)(36756003)(31696002)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?anhYQk5kUWRMOVpnYlFTOUc2RmFIdERjZ09yTGJTd0Fxa0lVMlZQbXA4TElm?= =?utf-8?B?U1ZMTWVieVl0T0s4Nkx4QzhtYUd0c2pPeWIvd0o3SExzOThjcW92S3c3bWta?= =?utf-8?B?WC9zVmM1ZmRLaGQ5aFFUaXhXSFREbDl4cnliQ3oyOVZWUDkreUN4Sm1Qc3Fh?= =?utf-8?B?d0JIMThBaGFUYW5TVWtuSkZFdmM5OXVTVmx2TFpFdGF3Tm9JK0VZRFMrZXNp?= =?utf-8?B?VTNpaS9saDE4NThqYlJVcXlVajJrWTViZGw0cEJUNTA1VkV5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TUxSOW52Vk0vai9xdldyeTlQdkJ3?= =?utf-8?B?Vm1tRGN0bUM5b3ZVL21icXI4V0xOM3JreFI2QjZITVlQSFN2My81UHBtQ1d0?= =?utf-8?B?VkhRTW91M2NIMU1OZUc5ZlNRRFNRUzlkSHU0NWp5QXJxSitleERiSFpsamcw?= =?utf-8?B?a1k2b1dKQVdMbW9ocGUxZkNFZXJnSHg2cSszeVZNcTZaclBzeDY0ZCtNV1g0?= =?utf-8?B?RWNXWlJobE9UUnJPOUNmbGVHQ3B2NHE2SE1VUHJBR24yNW9EQnFMZmpzcGI3?= =?utf-8?B?N0FIUVIzVWtGYlV6c2h2Q3Z3Vk8zdVZlMDk5WEtSMGJCYkRER2VKOXI1RWFn?= =?utf-8?B?SmJtZS93NmI4b0xnMGF1RDlJUExrT0x4MktUdjFuMHdtUnZ5dTVnOEJqMFEz?= =?utf-8?B?UkZaa2I2MG1iM0JmaU1GamJkL0NCMjhVWURIdGRENVdqN1lVT2laVzZGUEY0?= =?utf-8?B?c1NJTFp0MUdNTzRhVndua2Qrd3JJMnRIM28zTDNKa09wNXRLT3lldW85NHlm?= =?utf-8?B?UEE3YUtuOFFFWlZscFRoN2hTTTVrSzJoakxkWksvQ1Uva3dhaThScTJBaWtW?= =?utf-8?B?aFRzMFRBaElvaXA2VnJSbUIwZWxhd2V6OVZKazI5VDRNR0FJWDhGeExxcXJO?= =?utf-8?B?ZEJzM1IzZ1FKSjdIeU4xdVBzZTBaVnRHNFc1bE9hamxGWGZyQnNxTHpTRkk4?= =?utf-8?Q?iFCYWWR5+TG56Jjj0pn06X+UFpGFPJ54=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 551956c1-47c3-4e80-33c2-08dac68eedb5 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2022 22:24:00.3796 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: O9pm9QNqLoHlAR2NtLA9WFZj9xF0KjApwrDle3YDJYdZjO7m+9YSGSM5A8Sa/kZjzjsuaVzaX1epoYhvnu4wO2K/JQp0zkdn12NgVi8xLu4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6283 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-14_15,2022-11-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211140158 X-Proofpoint-GUID: Vmsxbx5jAvToDe4QNdECUHsbZgJ2nhtU X-Proofpoint-ORIG-GUID: Vmsxbx5jAvToDe4QNdECUHsbZgJ2nhtU X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 11/14/22 9:09 AM, Daniil Tatianin wrote: > sg_next() dereferences the passed sg, therefore we have to verify that > it's present before calling it. > > Found by Linux Verification Center (linuxtesting.org) with the SVACE > static analysis tool. > > Signed-off-by: Daniil Tatianin > --- > drivers/scsi/cxgbi/libcxgbi.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c > index af281e271f88..2ff9810f42a9 100644 > --- a/drivers/scsi/cxgbi/libcxgbi.c > +++ b/drivers/scsi/cxgbi/libcxgbi.c > @@ -1196,8 +1196,7 @@ void cxgbi_ddp_set_one_ppod(struct cxgbi_pagepod *ppod, > > if (offset == len) { > offset = 0; > - sg = sg_next(sg); > - if (sg) { > + if (sg && (sg = sg_next(sg))) { > addr = sg_dma_address(sg); > len = sg_dma_len(sg); > } Is cxgbit_set_one_ppod the same function but it already has the extra sg check? Should it be a libcxgb function in libcxgb_ppm.c?