Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp161606rbb; Fri, 23 Feb 2024 16:05:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU6Jz9eGUWGYnzahNuhvbEeB1Gs7KYsPi1Oe6c3/JCXCY6eGJ+u8ypNOrpGabILMIzFFpFZjVH+t+sAvqT7mZqn1ICdHm1yWJjNx0AS4Q== X-Google-Smtp-Source: AGHT+IF0dFQiSCrOWi3sZfCq7rgtTuiKanGlFhbYWwPyg+FEVl+nzqseHI2d646Ug8pB3isTmsX1 X-Received: by 2002:a05:620a:5745:b0:787:635d:abad with SMTP id wj5-20020a05620a574500b00787635dabadmr1356741qkn.63.1708733150492; Fri, 23 Feb 2024 16:05:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708733150; cv=pass; d=google.com; s=arc-20160816; b=0ep3s2nqzsYNDjfSNBG824grIVs8UTZM6j9dZOlUml5L4cD6akim7oBLsHe84wYcaI dhjk1A2mo6sKJUB5vfDm02+RdJ3bnJZd4bKDwIH22m+eaMKzFFv947Wp1+nCFki2wV7Z Ju02dhtjdtFzZ13wUserRKzSaPyiLvdexq7TZqCkEYyTKj5BcmAYHYfaptnzk+eV3Ltl 2kPnQbjtKMtrqrbMH13l0eJJDk6qgxImmch+FhvG/znqPRSRNhtNV+8dFPfV432ygwh0 TfhMI5dgmeYtOUOvsKTGa/mAbQfrWb5srKYwMsJ2Ds7epmYI2+daj7kO+0HZYVzrWAUR NWSQ== 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=ISFcMVB4Pi1paX6ZB9XWvqasqvLqqrENosxnYhDGUTM=; fh=70faUyA/Au2O5LBh3Lrq1vqLLPaDOy42vHsLTOxkvbg=; b=hBsEJdEPiFyCueGYwv2+QHR/8LA+hWCE3pZsC1i+r2H8vW5Iu6CPNjzbbm8hyMtXwx Gn2GYQPNG6jhNrgWE/ifp4YRkib9XKuFTtzLnnRDvf7gkyjpiyzK+z72CFrBFxAnglW2 gEv0SOqusA43VdK3kyAIL2+FVfGIT4Kb8l9c7lzNsvyGYHAaiKgI6/+esDW56ZITFim2 lXQzfbH0icUi0FMgnWNMHZbtrT79BrixlMQ09hPUcdKPoft1Eg7XKnR0ejBXj/vwMCkc /grf3zYR/0h2X8cHZmXtoQdKx6jQ4nhRIhVb8YqjhkWxx+uGuFRL+OnPKMQSJpjsK89X IErA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=h5dT+U2j; 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-79335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79335-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. [147.75.199.223]) by mx.google.com with ESMTPS id pj24-20020a05620a1d9800b007872e91d49dsi26288qkn.12.2024.02.23.16.05.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 16:05:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=h5dT+U2j; 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-79335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79335-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 3FFD11C23A67 for ; Sat, 24 Feb 2024 00:05:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76659A59; Sat, 24 Feb 2024 00:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="h5dT+U2j" Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 9CB51391 for ; Sat, 24 Feb 2024 00:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708733142; cv=none; b=GFC829s9LCqQktQGqyUlExtvRY9ZrtaSIOtVdI1SpPRmEx6IvWYttORhQlZlgtDAuvwhA0I1jL9KhFOD51koi2vh4Kduqieu1ex70XuCAMIvHo8AXZ6bnhwasXCwzb4ENYQEIi6r63g/5SmEH9gtz/6tu/b+pfPBU3WIUYegSE4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708733142; c=relaxed/simple; bh=BtNLLDRfUzf0j5Xx0MzJGDSaQOP9BLR490iANSNKg3I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Raab9Q9X8WfhC2Y65UElfJxOJ8dkxVS/s1mbuHSw8wja3YLVXhJtQkFWM8mvz+ExshBCGKtT0swZ5L0UrBcu5yun9XCuED+VE73XVEokMPTpgB3zI0Em3nr7XOs7YtGlj1O9krzJfjnErgEaoxujBgnXQMKcmyxwN6pY/Xhtjo8= 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=h5dT+U2j; arc=none smtp.client-ip=209.85.210.178 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-f178.google.com with SMTP id d2e1a72fcca58-6e47a104c2eso971779b3a.2 for ; Fri, 23 Feb 2024 16:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708733140; x=1709337940; 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=ISFcMVB4Pi1paX6ZB9XWvqasqvLqqrENosxnYhDGUTM=; b=h5dT+U2jOHgOh3n6I9Ce0rEW+mNzvHrbQUjqc+yCvqNMMG8bvW2as2dZb4mNmAQAPc MAh8dE8aRop4mHXczQP83Y10OjSlouO8niFtdvwjZEfbML0vHWv+H1KWam1RyWscDCjk hMsooris10osvVDd7CqTdxeqtu+IYeQhLtwT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708733140; x=1709337940; 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=ISFcMVB4Pi1paX6ZB9XWvqasqvLqqrENosxnYhDGUTM=; b=MM46N3p42RjzFFxndrpzu/n8ri8ZAqfKOjzLvVIDQFDgbgCoD4F8w9rJQErgGHEYB+ iX2YpkbVwP//DRumJ1SzwcCFqCJK9/dM9Cexz/rt70zyEMimgc4yfqSrLVzUrv1A+hAo Q98Wc3AWDjrjEEKlpzAYDanIzMIefCbDJAxoTH5ULJKzdXdvqHaHaSZO6zs8Kv9okYVN dQSzfqhkqFhv1Xo8+a9jBVTVPrZw8yXDMGATA3EEPK9UkgNW2JnOiRjqcU8zbV7o0TaA B/kR0whtfnLGXmoiD56pE+SQhqzl1AWG//jxNySEnA6kKybu5DyHODrAZcIDAaCW67HY GtPg== X-Forwarded-Encrypted: i=1; AJvYcCWdCQpDdIu12nB5MsugyefyoWzS2T7W9HVrhc0c2K9FwTSE5yxtWBWD/ZvZ3vlOBEdsdtnd2bZh2spomWHyTqARJuCxu6BUUhsC/SnW X-Gm-Message-State: AOJu0Yx/KJBg2+F1XjUgUS8Yfe/7Zdi9Izso7AQFRtK7Xn4tre5L0W9O F1OU4cz6Q/sTRDvW5qHNCUXOW2DHT2XPFiqvzoUmPOGQr+9wfok8TAeK6BLOeQ== X-Received: by 2002:a05:6a00:9396:b0:6e3:b7cb:b105 with SMTP id ka22-20020a056a00939600b006e3b7cbb105mr1558704pfb.18.1708733139964; Fri, 23 Feb 2024 16:05:39 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id w67-20020a626246000000b006e25d43630asm46314pfb.108.2024.02.23.16.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 16:05:39 -0800 (PST) Date: Fri, 23 Feb 2024 16:05:39 -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 2/7] scsi: mpt3sas: replace deprecated strncpy with strscpy Message-ID: <202402231605.3DABED3@keescook> References: <20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-0-9cd3882f0700@google.com> <20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-2-9cd3882f0700@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: <20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-2-9cd3882f0700@google.com> On Fri, Feb 23, 2024 at 10:23:07PM +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