Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1355024pxt; Sat, 7 Aug 2021 08:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaC7VwupcieIFrYoWOLRpLa/Ce7siDanT+lUvHmlTtCPa5hr1Z3eXaZXAbSdcALqK638B+ X-Received: by 2002:a92:cdae:: with SMTP id g14mr336748ild.123.1628349540455; Sat, 07 Aug 2021 08:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628349540; cv=none; d=google.com; s=arc-20160816; b=IWQz/HSwbkFIZOEBzCKHmBgKTPbInaPMutNhBRaG+4LgUaoPjekUBI0EjXinhNypEH hCIAMtGGUCkcThCU0Hiyv9p8ClBw1WeLqXHCFJDvSSVwEdFWqIisGffU7UoaBek7ZAJU IzxxJypWOQkgU4SFC+e9LJbBoNJ/Ubu/NbTsUv4/Gs5ZpRDrNwxWfq7F33N8+YGWoQZd 3DxPGsogA2QVPFSSxS0hSTsBmOb0CEhHrOmkvODAEUFSSim+3B4oaFgTCINbqbv/h7gB AWjG7G2iuqtMIUS3aLmnWf7qKBuxkXnBEdvN3LSL8yrGCqGvoFQ6lWf87R5BlAkgEus9 numw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=IYhxCvk52CvVljm80PH4f+lrwpsZXHv3TFi7euUSkFY=; b=rqbPQteB9CKGXAdkrPLHmTa9sdQFXj97DxPQgjbHZieAi9lO5SU/2Ubkaj/BQDYwD3 AGB9aZg5p65oXkA3mxdx32zhgEECdVsDsRPBtIWt7v6I9FDlu4mItbwBSpCuNZhOgj5E eRi0G5tTkJ1RZXhSMJwX6/Hqt0m/R38Bvsp1OFNOJZAYUi4qEjwwpqrLCif5c3sZGi2X R8sUdDQfX1A8rTrzHDMQCw0GEDLmdWhGneqAdmM+8/sK8usnNa+drd7rbC+GHFY8++Sc bdbgPDepI2hnRa+kR27VZUPuH20O3Upwtf44poL3HjH9RRejV3Bzgl59Bu+S/3G13Rdd a2mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si12165019ils.86.2021.08.07.08.18.48; Sat, 07 Aug 2021 08:19:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232447AbhHGPSE (ORCPT + 99 others); Sat, 7 Aug 2021 11:18:04 -0400 Received: from smtprelay0032.hostedemail.com ([216.40.44.32]:38956 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231159AbhHGPSD (ORCPT ); Sat, 7 Aug 2021 11:18:03 -0400 Received: from omf02.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 662FC18238842; Sat, 7 Aug 2021 15:17:43 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA id EEE8B1D42FA; Sat, 7 Aug 2021 15:17:41 +0000 (UTC) Message-ID: <0c1d7c01821f1f0891fd8f13c1e8f9a68bb21717.camel@perches.com> Subject: Re: [PATCH] drivers/input: Remove all strcpy() uses in favor of strscpy() From: Joe Perches To: Len Baker , Kees Cook Cc: "Russell King (Oracle)" , Dmitry Torokhov , Lee Jones , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , linux-hardening@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 07 Aug 2021 08:17:39 -0700 In-Reply-To: <20210807140245.GA2688@titan> References: <20210801144316.12841-1-len.baker@gmx.com> <20210801145959.GI22278@shell.armlinux.org.uk> <20210801155732.GA16547@titan> <202108010934.FA668DEB28@keescook> <20210807140245.GA2688@titan> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspamout03 X-Rspamd-Queue-Id: EEE8B1D42FA X-Spam-Status: No, score=0.76 X-Stat-Signature: pwijksomz6gtkkoep9eeicnahht4ctew X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19wOvYjIgVqLuXn/xjQleZQQKop/qZhuMg= X-HE-Tag: 1628349461-59007 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2021-08-07 at 16:02 +0200, Len Baker wrote: > On Sun, Aug 01, 2021 at 09:44:33AM -0700, Kees Cook wrote: [] > > One thing is clear: replacing strlcpy() with strscpy() is probably the > > easiest and best first step to cleaning up the proliferation of str*() > > functions. > > Thanks for all this info. I will work on it (clean up the proliferation > of str*() functions). btw: It's not possible to sed as the return value is different, but here is a cocci script that converts strlcpy to strscpy when the return value is unused. @@ expression e1, e2, e3; @@ - strlcpy( + strscpy( e1, e2, e3); This cocci script was used on sound/ awhile back. see commit 75b1a8f9d62e.