Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1881041pxt; Sun, 8 Aug 2021 04:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPvE5aKZ7F1b+qsNKSEZCetK4PZJU0TZ8i2R8MzeVornZKCi8oSfsk6gS71J6auNlF1llX X-Received: by 2002:a17:906:f9d9:: with SMTP id lj25mr18163331ejb.319.1628423033021; Sun, 08 Aug 2021 04:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628423033; cv=none; d=google.com; s=arc-20160816; b=Uf9G8xLTo7JAoaRfU4RMX+n5V5bQPI6U9SHBJ/bmFUWGcA9QKBxoM0GcZaZQy2LJtG EFNP6zlBBtkW5Vxg6H2jjouJgQgueMUCJQoQqafnV0c89t6cXx78cot9EVpD8YSbrqpF mec3gmaJuRDDN7JZVUo+P5SnfcN4vj6X1yw0JRNhi74n6Caoh5Bfy2Wbhz6oRKhKrzrY /8LpQ1JjFx/WPTf3nJu99q3Gwt6nvw76vs/uaLftY0vCG+Ri6aIFIHbD+nFjlOkfSivs O7dVuhaV5kFO0Evn/gE0jab2F77DuB+vDxx5Ly0AkOHrXG19A0MVJy3Pn6CrxQmN/axM CSnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rmlBw0qZiNIt7XurVa2jboq7S8k5fSkjyjp/YFiKFrs=; b=rV4F+J8GJGOc941xErugoQbEMpS3B/sKNHbVqvs7SScP9G5R7lGAV3Hx1SbWni1QhQ 4nLKvJ1XPjpCKn0BBJkxtSBx4UhDJk0tyrQjRGyXiSTPsjd3Cac3uZ7avZfpi0sq3iZO UbzRKLwE9i811xBIgsTujOcPT1Y6GV0ttTBZ5SSTCTdysteZIhxAlaooSQqJt3C/dgNa T1aRHd9lv0emNpZtCE2E4KFD5plMZLSut21oyjJyq/Nyf76EYIvC72CdsE7MLzti6ivS knQ5O2RjHXzCXGiuZgfTe8AnhyMEF7uBI4H/f7zK5/hbuWMKSDc1aqHmrZj5jVlIRyKC z2zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=C9NVFolz; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si15561698edj.183.2021.08.08.04.43.30; Sun, 08 Aug 2021 04:43:53 -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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=C9NVFolz; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230397AbhHHLbY (ORCPT + 99 others); Sun, 8 Aug 2021 07:31:24 -0400 Received: from mout.gmx.net ([212.227.15.15]:52729 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbhHHLbX (ORCPT ); Sun, 8 Aug 2021 07:31:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1628422255; bh=W5chU5//YfU3n5/LhSUUVSldCLiEe1+cMgrkYXazda0=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=C9NVFolz1ZsuztP7hj7CJh6tZUOPaGkLRIeA11yOMplKcp81SspAM4UApgNIyzct0 tM8nRFXsYv5+bS9hjP+tDhl3VE1QcY+h+xUO5jQcyD1h7EZOiI11dzIzTCpRKTzhkE N27zc9Typcu5BRft/5MU7uZdmw/zIGmLeyxn1Tog= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from titan ([79.150.72.99]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MiaY9-1moFlA2Fl9-00fitP; Sun, 08 Aug 2021 13:30:55 +0200 Date: Sun, 8 Aug 2021 13:30:43 +0200 From: Len Baker To: Joe Perches Cc: Len Baker , Kees Cook , "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 Subject: Re: [PATCH] drivers/input: Remove all strcpy() uses in favor of strscpy() Message-ID: <20210808113043.GA3042@titan> References: <20210801144316.12841-1-len.baker@gmx.com> <20210801145959.GI22278@shell.armlinux.org.uk> <20210801155732.GA16547@titan> <202108010934.FA668DEB28@keescook> <20210807140245.GA2688@titan> <0c1d7c01821f1f0891fd8f13c1e8f9a68bb21717.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c1d7c01821f1f0891fd8f13c1e8f9a68bb21717.camel@perches.com> X-Provags-ID: V03:K1:yhtkYHOcv/CHfzZdfq4WcAMbmVNEMTMq971wsGS9ywr1epjn7nE 1anGABKOQFM/27iH0g27l/ljraDexB9IRu9iidvy8X/LpM2joGccUuJYn98zRJNpxcwF1hH 4kVyEgb9uCeY8Onw6RSereN+/KNXvT3RnXvdOJrUxK7RXnDvSFgiQIMNPInOon9nvXKypme +cp9kDx3Wn2kEYwZssgJA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:wbeyWHOiozo=:5WOgHNeL5Q45hm6gMdYeBG WtTe2QQjS0HdeW5zyT6ibXFFhDJc3tdwylJNHtEWpt2TyFEj5WYb3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JqWAGTpT/WL0OoH3iTaFhGOnTgXXMOKYUA== Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sat, Aug 07, 2021 at 08:17:39AM -0700, Joe Perches wrote: > 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 t= he > > > 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 proliferatio= n > > 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. Thanks a lot for your help on this. I will take into account all this info= . Regards, Len