Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1318059pxt; Sat, 7 Aug 2021 07:11:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf9hndxTYOV0FUjKY8MHoCZT3+eihbyaOjoe+ES6HHi/Gzax1LDWsLU0GG3tqqrepfzVIG X-Received: by 2002:a92:cd0f:: with SMTP id z15mr149935iln.239.1628345478570; Sat, 07 Aug 2021 07:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628345478; cv=none; d=google.com; s=arc-20160816; b=IucryL7iT/6ZLDuX9Hd8/Qdl8SSQeUF8Fu2zpqqvyQtVbfEcXxWyfZ24m8qHwubWB1 E7XB4PVtWEitcVoEcrKqdHdHR3Qs4ZWkC2l1wUK2PHhZ+JTXC3CeiE6Z+xng8OYQdIZr a+ge5pYO7xsgXLKTjGQqJMKmkA0gRaVIfjJtApQzVTd7SuENFzmaGIFJVggJo0dqbpqS m77tK3lma7PdrTgUZTySquCHIwD5S9W/Km7kjCj+C2yv3VOm/zcEvFzZmzPD7baGgy22 7SaZjl0McapGjWKRjwqML2TFqJ0WJBxdB40JW6fVGivmx7e1Y+nAd4vNG+hh9H2VELUi 3NtQ== 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=JrYv05nggb5SHQ4orD+FEhjmScQCT9UV4nnpVPMJYXk=; b=iJ+UUxFuMOI9y74iiUMMh04OzAHuveKZN8/Bbfn7ZLa1L1EkxwjSDFcSaso62Ht/iz HyUF5p/PdB5BzxN/iD8/AWLL90we6oglbihu9uVHDPOhj1lnfr++Rz8XoXT8wBfqyXiS vovrxBTSfIfflkDPol0J3dNw1g35d8t6cjZjJWtT0f5fu056E1591HuBBTfiS32KIxQp TuGnbVyNC4NblIf1CgTZ737/XE2AIR4T8DgOYtrhZ7cLNqfb6dQmCMh8MENPZDAWcIK9 3nYSoTNdWhtCaKliZ/5it2MtwcaSw8b3r0q2O3f3HfuR9gvCc3GRi0tKiHGRXbid2aHy maqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=JAEdCpjT; 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 r3si12228024jan.7.2021.08.07.07.11.06; Sat, 07 Aug 2021 07:11:18 -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=JAEdCpjT; 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 S232363AbhHGOKm (ORCPT + 99 others); Sat, 7 Aug 2021 10:10:42 -0400 Received: from mout.gmx.net ([212.227.15.18]:55143 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232313AbhHGOKh (ORCPT ); Sat, 7 Aug 2021 10:10:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1628345415; bh=2XyimEmEYl/lKBquM6tBAeYoKZJpmmbSuZhTtFJNPfQ=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=JAEdCpjTpcvxUtqH9t5WGPE93ZpRSGN77jaBFcDDpn3AQ9nSK+8dO/nFrsHU4iyDH Dy0Roz/TZKSe3GTw8viANuw8LMGDDjqdO7sRvrb111Ss6YBeVIFqz4OMv4qoVr7CDc jyoumrYrV29Dm+7EqgVMvJYVQpyGGHsSGw0C9+ug= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from titan ([79.150.72.99]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MHXFr-1mPrZH2nZ3-00DTpV; Sat, 07 Aug 2021 16:10:14 +0200 Date: Sat, 7 Aug 2021 16:10:09 +0200 From: Len Baker To: Joe Perches Cc: Kees Cook , "Russell King (Oracle)" , Len Baker , 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: <20210807141009.GB2688@titan> References: <20210801144316.12841-1-len.baker@gmx.com> <20210801145959.GI22278@shell.armlinux.org.uk> <922b0d99b6397adc44761abaed12c019dc0b9e88.camel@perches.com> <4962ac72a94bc5826960dab855b5e2f47a4d1b9a.camel@perches.com> <202108020912.3807510B4B@keescook> <30984a540fb8e340c12e52054cdf7d6478b8b960.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30984a540fb8e340c12e52054cdf7d6478b8b960.camel@perches.com> X-Provags-ID: V03:K1:ZDyRuhCSgMs++8d5awfaqKJBTxJVs4wIK4CaVmZFFcgvZo3+JNH JVsTnL949m6zxijXU+WNWKKhSkOXAB+0m1UvrdXOezJZ56WJJkkMuVE6r8UFebu918XBpoC 7a3lJ1m60uKxhKZhVapCdhBKfeTo9HsPpS68ibikj1+RNhKQ/1i4sITVUJ5/jHoIbyJ5DTQ YsW+ZuPBQBKB704ol1mcg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Apm4scjDcJ8=:expUrFCzODpmgOcIy7HXlX XpdnE0c/36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L74+Ak6Or5w+iBwc/GAJxAW2q+Fz Icpzed3X4xTE8PkdLZeKZH2g57h3sNe7vZlaQ8Pze/nb3U1KU3IT81TiA== Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joe, On Mon, Aug 02, 2021 at 11:57:40AM -0700, Joe Perches wrote: > On Mon, 2021-08-02 at 09:13 -0700, Kees Cook wrote: > > I'm wondering, instead, if we could convert strcpy() into this instead > > of adding another API? I.e. convert all the places that warn (if this > > were strcpy), and then land the conversion. > > Perhaps not as strcpy is a builtin. > > It might be easier as a cocci script. Something like: > > @@ > char [] dest; > constant char [] src; > @@ > > * strcpy(dest, src) > > There are some additional test that needs to be added so that > only length(src) > length(dest) is reported. > Thanks for the ideas. I will think on this. Regards, Len