Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp161797rbe; Wed, 28 Feb 2024 16:04:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQd3yiyk2Mm9tWCj1aHqqClfUqoPiAsobBAYaTr6XRaedx16MNA8OzqJNQdI3/DS7XCjoFD3STM9oFHxnJ1P/LzmqERroDOkaf03+nPQ== X-Google-Smtp-Source: AGHT+IFmTEUAGkTz3PDczBh9jFFKo3BbHLLuc7c7SoybTosZ1+2NMYKtH2PhMVaYbBnazAKRXTJO X-Received: by 2002:a05:620a:991:b0:787:da35:49bc with SMTP id x17-20020a05620a099100b00787da3549bcmr653990qkx.72.1709165040475; Wed, 28 Feb 2024 16:04:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709165040; cv=pass; d=google.com; s=arc-20160816; b=Zx18U+l9Rlubfrsg8i2nQrX3sRfFGAzFpmDxFYS/+AIJP8CBE39Z8fGDYEolJwRlu4 IH15EpknBhvxXe5tZNeVbZOe+fJjAq0hUIu1sQu64jHnhphwQ/vv8OzqaEGgyRZMbCpY fADEyx0mUd8TvgFtoEyIz5i/gqkB6f8kYM/BYtFJOIuEOkGL7MO8tsRiaoEzLU02SPUu I0z7whFIHIcErgOQjZHTU/ymlTXCAb3gkxr84N9Go7wC7n8B07Bdo4OEj+W3ZtIfdf1J t7npnO+KMeHuJNrLVV5hmlzQVvikOoL4fu8lQuvhsFGIyJYYcMdQeAEB+I9E/3Pq+uvA bnjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pwLo+SlOHd8K2sY22rmYO9CHmiOYoa90iOQ05o2rFZY=; fh=Ohnzr4J4xucS8cB8EsWZuKDvBq45VyyCITM7DssAU2A=; b=E1X+76Qk4/EOS6sBuyxkMHzWgYvSFTMW6BjzUF5n8Pa2d4y7MXXydLtUgPjelwFGQh r7cEefYyU4U728X5t3DMXmDgzn2+43hXQHixcq69BXCxO5L/OELzBtX6Qvzcq27tc+Jb LybSPmCI0NYDxtNVw7I7e5EdheCw3CeazyGS8nmkf5Px1fOT6mfdd04AU1O01UZQ7l/5 RUGMyVGUw/OJhbF7qsppMs+D9zeztWk5G41GTKYxsxCXnHP2atSvivoGyIpddJQPJ2Ch Q7ysouCXu5Yixn1LFKGx6h6XWDZq9OE9eojtpKrbAnBPJSQomJpaFbOBe6saJ+revy/p XHDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aYNrdHUY; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-85865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wi16-20020a05620a571000b00787b6a6cd86si266467qkn.593.2024.02.28.16.04.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 16:04:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aYNrdHUY; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-85865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D99151C238F4 for ; Thu, 29 Feb 2024 00:03:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 019652116; Thu, 29 Feb 2024 00:03:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="aYNrdHUY" Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA8A0168B8 for ; Thu, 29 Feb 2024 00:03:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709165028; cv=none; b=aNj5AtZJgMVpgNMDUIROszPI8zI3CviuI1CbCC8eMEzqfkcHhvn1cJFgPAEHJWBtFd4QU6bev5fuGIZPfEgTRji2Qzk47OU9zZxrIOrLtCnM73BSoBF4/pwRrhUiHlkdWHhVygNco+DuFjMEbuwiwNw6j65/Of+h3hS92I4ivYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709165028; c=relaxed/simple; bh=OFgQwXsMv2PCEP7cboBXKNq0QnFBUPWLxnww317nqsQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qWVVg5Vw5ihuP6xZxQWvAeeS278dWEKbHe8UqLzIypdJAQ5rGSyyv/0DApePX/sYKEwluwkU7xXdxIv4UDCkuykf6nK3fBZ1gyr8xiOCxOCn8lV7SPZHJAbVKXj8oDYhb0eOwVlb2AVpJrtWntvW+fxN0lEXet/HtlbSXcASBuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=aYNrdHUY; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6da9c834646so229643b3a.3 for ; Wed, 28 Feb 2024 16:03:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709165026; x=1709769826; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pwLo+SlOHd8K2sY22rmYO9CHmiOYoa90iOQ05o2rFZY=; b=aYNrdHUYuyJGyk0h8wM585jDjVnxI2bOCC378+Bt1xtQkKPR8xJgMAjR+6Wz0wh4GO UzS/MtcE6YusEKbCPLQ9a5eRFG3f5KU00Gpru7VlfWPs0vOc89wzv1TpI7nJpmDNPmS6 PinP9pCql/WHCNc8/OOt4d1AcJ4GF6FyUPHtk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709165026; x=1709769826; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pwLo+SlOHd8K2sY22rmYO9CHmiOYoa90iOQ05o2rFZY=; b=Dd89xA4grjSlVADxvJniQiobPCKVJ4Kb5HO3/SyHvi/mjosajeDmX5Ub3rG7tw0nf+ EzHBwfbPU5lQIXcHkLgCejjB4t7TPx2swmHWAVtebiKQqXSxUUEp03A73Zq2zzqQg4ua fbtVF4Qu1cvnm4TDvolfkHZQy6pHV8jnkIoBxSBPoLI2mNxZBHPRX6nE+1WBZNYA5wRa ght3OaFoke387WzPRpvW+ivDIAhKaKsiI3+c1CQ9wUND6ZQJuur0WigzTuOiu6LvG+zd keyDq+CGXbDBRQI9HeSNjgIkB+iQVSaBbdTJ4uLiICk349dYx+ppeN2MCipYv4zwo1jk UiJg== X-Forwarded-Encrypted: i=1; AJvYcCW0nts6DMTlzYnsNFGV/fiiwzHKmZ8uA9Nv82vhr8T/W0HH8I+rcPmYhNOEBPx3uSyJ/oIo4va8ZfSqjmsgXaWqIpONTlpfVITqt3xd X-Gm-Message-State: AOJu0Yx59dNPayBFW9TyR7/Qe3JVeam6k2pH1Ga6xJ4v70FF7DZwpnMM 9yKMiu0vWHMZdsn1x2EzpIZlQUfWwtHPRqfJgnDnDS3m7OOEDcbQ2utSgWwZ5w== X-Received: by 2002:aa7:9e50:0:b0:6e5:7075:7235 with SMTP id z16-20020aa79e50000000b006e570757235mr712201pfq.23.1709165026244; Wed, 28 Feb 2024 16:03:46 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id s36-20020a056a0017a400b006e53d2c0618sm34321pfg.65.2024.02.28.16.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 16:03:45 -0800 (PST) Date: Wed, 28 Feb 2024 16:03:45 -0800 From: Kees Cook To: Justin Stitt Cc: Sathya Prakash Veerichetty , Kashyap Desai , Sumit Saxena , Sreekanth Reddy , "James E.J. Bottomley" , "Martin K. Petersen" , Suganath Prabu Subramani , Ariel Elior , Manish Chopra , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Saurav Kashyap , Javed Hasan , GR-QLogic-Storage-Upstream@marvell.com, Nilesh Javali , Manish Rangankar , Don Brace , mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com, netdev@vger.kernel.org, storagedev@microchip.com Subject: Re: [PATCH v2 2/7] scsi: mpt3sas: replace deprecated strncpy with strscpy Message-ID: <202402281603.E33A62C096@keescook> References: <20240228-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v2-0-dacebd3fcfa0@google.com> <20240228-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v2-2-dacebd3fcfa0@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240228-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v2-2-dacebd3fcfa0@google.com> On Wed, Feb 28, 2024 at 10:59:02PM +0000, Justin Stitt wrote: > The replacement in mpt3sas_base.c is a trivial one because desc is > already zero-initialized meaning there is no functional change here. > > For mpt3sas_transport.c, we know edev is zero-initialized as well while > manufacture_reply comes from dma_alloc_coherent(). No functional change > here either. > > For all cases, use the more idiomatic strscpy() usage of: > strscpy(dest, src, sizeof(dest)) > > Signed-off-by: Justin Stitt Reviewed-by: Kees Cook -- Kees Cook