Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5758201rdb; Wed, 13 Dec 2023 20:31:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHP6yneoDmI/JTLKEMrvlT9KaKjAukrSnbmjWMEaH4Ld/0CAyXH7SsfNs2qRaWJmSgeXg+d X-Received: by 2002:a05:6a00:14d5:b0:6cb:d24c:4a9f with SMTP id w21-20020a056a0014d500b006cbd24c4a9fmr10481128pfu.29.1702528278182; Wed, 13 Dec 2023 20:31:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702528278; cv=none; d=google.com; s=arc-20160816; b=DfaVTuwb8Z8M4xdcSkaMR5vDoitLIBMPc1muyW7znBqlGjxkcOHyzzuSVsR6G204w+ 9IOBRA1Ny+bJyJScRl/e2eVcQvmddFhfoyrskrS//P/aLBrazpgNw1u1gSbhhFQDhCOH jm6eSH41yHxWbJ8s532a7q/BxYAUeGH0GYBi32bYGot9Ste+wh0WvvkbHXidiLQ+ayyJ uKN61EkixS9sN/nyfabaHroyyMO5gk+6CCF67EU4hMrtyvVjqCe949xBwT29wbteWrb/ gYmPZY3LnQcaKTEi4Eoyp/6DQimnrKyCGDCdobXbbEYymbCGNBktPsah5C5DuIzhOSyT UT9g== 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=n39mVTkPVz6dQ6k8si0hmgulTiuGKemMH0YL3y2LjAM=; fh=ouB5ftPxolKq0UVp3WEdVUKTIIueUv+4rqGi/FBt38E=; b=0QF5QlzgfjLCk3s5CSa4Bg0F90vXn3W0EqhEZ/+Za/mi3V3eYhE51OAGcbW0KtWzuO 2kmfhNT4WRmeT64Di3D8nEnXBVUObQNImGOfNe2fanBj7GC9KvcHxOScYdgPa4YKg97P CU7qUJZeEIt/cWtLs7E/eBIJKlnnsizDUgjpD0EXw28mKmiyXk0y8wmJfPAVDFmrMoE/ nyVBs+3ZhlUCMUy8ctcXQxZg499MxIq7UfYg45gVT/ml6/V5ms0Ra/MqdWKpx1znXpDT gqwcAabskwFBXLAqCYCmu8dKJ+9lEIkYUX5dW2EJRU/ZIx+1QZoFBh3S0HCsWZl3qvaZ fAbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=IpkUwNWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id dw7-20020a056a00368700b006ce060dba6esi10767274pfb.240.2023.12.13.20.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 20:31:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=IpkUwNWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D470E8087CAF; Wed, 13 Dec 2023 20:30:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443137AbjLNEaJ (ORCPT + 99 others); Wed, 13 Dec 2023 23:30:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443136AbjLNE3t (ORCPT ); Wed, 13 Dec 2023 23:29:49 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07F31111; Wed, 13 Dec 2023 20:29:47 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BE0S8PT014198; Thu, 14 Dec 2023 04:29:31 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-11-20; bh=n39mVTkPVz6dQ6k8si0hmgulTiuGKemMH0YL3y2LjAM=; b=IpkUwNWaZxdlIBJiQCbiXR33Wed3e3eR88PW9bFlSShaUdSci/FfMKIsYlLiMYzS1iqH dsSJJswoXWjiH5uhiryB1uEniJvgCY1fx/HEEO95bOwhP+Z2sSLAvVzribBbODfqW0aW H65LRqnw8KqzXY9vrxka24x/RgqCX61svCLLoYVKIl4uw9ZAM1O3C0EaS2aLvuYKSxXa u7Y3PqoHP5Nastya1PUGr12HPs2jqP2gyoqehDrLlVnaWnNjTpJY0Lq6KJF+DLOzLlyL ZaSF2/FYB040jlVk0T5GEpAKTghIaF4dHPRwoTmYIA8R7tNXdcV9vZk5c+ZCe/7Q089I gA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uwfrrr80p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Dec 2023 04:29:31 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3BE46m3q009809; Thu, 14 Dec 2023 04:29:30 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3uvep9ev3t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Dec 2023 04:29:30 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BE4TQMK035965; Thu, 14 Dec 2023 04:29:29 GMT Received: from ca-mkp2.ca.oracle.com.com (mpeterse-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.251.135]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3uvep9ev0g-9; Thu, 14 Dec 2023 04:29:29 +0000 From: "Martin K. Petersen" To: Kees Cook Cc: "Martin K . Petersen" , "James E.J. Bottomley" , Steffen Maier , Benjamin Block , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Azeem Shaikh , linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2] scsi: zfcp: Replace strlcpy() with strscpy() Date: Wed, 13 Dec 2023 23:29:14 -0500 Message-ID: <170205513094.1790765.1831681257602752476.b4-ty@oracle.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231130204056.it.978-kees@kernel.org> References: <20231130204056.it.978-kees@kernel.org> 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.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-14_01,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=942 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312140024 X-Proofpoint-GUID: rUSrRzEa_gMTd1iA_Sn-t0nuVLhPretp X-Proofpoint-ORIG-GUID: rUSrRzEa_gMTd1iA_Sn-t0nuVLhPretp X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 20:30:32 -0800 (PST) On Thu, 30 Nov 2023 12:41:00 -0800, Kees Cook wrote: > strlcpy() reads the entire source buffer first. This read may exceed > the destination size limit. This is both inefficient and can lead > to linear read overflows if a source string is not NUL-terminated[1]. > Additionally, it returns the size of the source string, not the > resulting size of the destination string. In an effort to remove strlcpy() > completely[2], replace strlcpy() here with strscpy(). > > [...] Applied to 6.8/scsi-queue, thanks! [1/1] scsi: zfcp: Replace strlcpy() with strscpy() https://git.kernel.org/mkp/scsi/c/0d224b1088af -- Martin K. Petersen Oracle Linux Engineering