Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3746181rdb; Thu, 14 Sep 2023 00:57:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOGLAtrpFCXOkZJKc2sTIAdY6hFZyNADeGXkhB72teQVrFCwHW6PRsH91ZAu5eyzvjWFii X-Received: by 2002:a05:6a20:a10c:b0:145:3bd9:1389 with SMTP id q12-20020a056a20a10c00b001453bd91389mr4304353pzk.6.1694678277745; Thu, 14 Sep 2023 00:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694678277; cv=none; d=google.com; s=arc-20160816; b=Kt2PVhOn4lfwKhw8AiLgnZC3psVu4/2UpTvRqRH3BscxERnQyr8F5nlw9YYsMj36a/ xuS21h3mRa1PJwNo6XAqv/c9mIz6/tK+xO+38c27pCI0jmmcYUJoz6HSvRYECnuPEY9k 54O9y8nZHZmiHspzz8NrHkwcMb1gc0fS6W5/0Npep4j6pkGTNrSH7o5RUVeFLwh4uW8f qLl8qOGif1ogvKJNhjkqmYELSDOkNHvwOBr5pBJm+UVuONT3N2KWNcmU5ZvnOvZplEU+ YRFpDR9//Lg9qFC5Uq7MUj27mypfHnaPINloGi+0LGv42paw0Mehj/f5bjyaE5rEJKbw jJUA== 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=bYGqFxi1OHfFB/skcVZcSNk2thtjUMw9RD2mRaKfX10=; fh=ppD768DDakHK+CnTZiiTE7rYeRULZfHM0ef/abjhFTE=; b=XmrJaniwmpKWBC8/cMY0Q06Bw8zuT2iwVKobbO/ZMDBG7QICHDJd8OKG2uiPDxpNEq ck9l1neAXAGa8TXgO1m0xN8Dn36pNeyj6SpmWpl09KM4cTM7CXmc8k5P2GvmcJrviewM dRLF5xmos3Z+z6DLs83psj/DO3AESG8zbGBKDPFMXyl33o6BJt8xovXwPZf7eRkbZ6xQ tdO70rVpPrIRiFdF2gMNZZdxeBTvXBKYmPmGHjJogQocCgkJUX5joxy5fZ0rEiMpEFD0 194f99oo7ZXqxWao1GrINUx0v5H5Yq1nQpYoy5qzJpgCr+DIDzxzx14/0SYu8jF4lM6i p0XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=wYRgWChS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id kk12-20020a170903070c00b001c3ae631b86si1136445plb.112.2023.09.14.00.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 00:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=wYRgWChS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 0CE1C82277B8; Wed, 13 Sep 2023 18:41:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233883AbjINBk6 (ORCPT + 99 others); Wed, 13 Sep 2023 21:40:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233625AbjINBk4 (ORCPT ); Wed, 13 Sep 2023 21:40:56 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CA3B1BD3; Wed, 13 Sep 2023 18:40:52 -0700 (PDT) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38DKbOIb005535; Thu, 14 Sep 2023 01:40:44 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=bYGqFxi1OHfFB/skcVZcSNk2thtjUMw9RD2mRaKfX10=; b=wYRgWChSINdnbpKSsFZ4P28BgOyIW6W8w/TfqRyJ3QZiSqd0ZV3DmX+dgXyFN6yLFwqU 6Ei0F9Ptwng7uPc9GG+B8XExq+V0WAZ4SMSVPnkotZQm7TbG/4rgg+UFxCSDmhbKzQb3 cSjQIzLGKwmjuhXR7eJ0UPXlOZ0J/CgLYYv7SioS5bZapuWVaxSIfxiYbdcVxluYiJHX lUBZwtBjIIfPH5H3OsgiGPy5+dvjaGcUuX855ZHpRDv2f5xMsXwhMRuX92G/suzxYc5K mXWJwowCLYHNCHAzVpdzWcMl9MBpm2m23jwbqd4cMLnLPDWodtYOwEnzKKdVgh/XpWau Gg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t2y9kujut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Sep 2023 01:40:44 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38E15njl007764; Thu, 14 Sep 2023 01:40:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t0f581r12-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Sep 2023 01:40:43 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 38E1efpP038417; Thu, 14 Sep 2023 01:40:42 GMT Received: from ca-mkp2.ca.oracle.com.com (mpeterse-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.251.135]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3t0f581qyy-2; Thu, 14 Sep 2023 01:40:42 +0000 From: "Martin K. Petersen" To: Kees Cook , Azeem Shaikh Cc: "Martin K . Petersen" , linux-hardening@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] scsi: target: Replace strlcpy with strscpy Date: Wed, 13 Sep 2023 21:40:25 -0400 Message-Id: <169465549434.730690.14253964357330620522.b4-ty@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230831143638.232596-1-azeemshaikh38@gmail.com> References: <20230831143638.232596-1-azeemshaikh38@gmail.com> 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.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-13_19,2023-09-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 spamscore=0 mlxscore=0 mlxlogscore=717 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309140013 X-Proofpoint-GUID: OL_8MbQxqPqPazGAf-Yn2ihlsF1JXjHb X-Proofpoint-ORIG-GUID: OL_8MbQxqPqPazGAf-Yn2ihlsF1JXjHb 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 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 18:41:05 -0700 (PDT) On Thu, 31 Aug 2023 14:36:38 +0000, Azeem Shaikh 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]. > In an effort to remove strlcpy() completely [2], replace > strlcpy() here with strscpy(). > > [...] Applied to 6.6/scsi-fixes, thanks! [1/1] scsi: target: Replace strlcpy with strscpy https://git.kernel.org/mkp/scsi/c/5c584fe6098a -- Martin K. Petersen Oracle Linux Engineering