Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1839402ybn; Thu, 26 Sep 2019 03:02:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbD/m7FntOxK3cZPNZIlNdvxTkVrGCOB1aWTJ/kvKXLN07Rwu9cZH4rM/mX5xhFbDByi2H X-Received: by 2002:a17:906:4554:: with SMTP id s20mr2237050ejq.257.1569492149329; Thu, 26 Sep 2019 03:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569492149; cv=none; d=google.com; s=arc-20160816; b=Kd92L8p/cbRe/CMZJ60nZxc/rFh9qfNiluZxc9P5qq2KygVYJHZqPxr+wv71xG/B7T MZ+B+WUhwbsReO0wXUcA2vSzCkd56eRIjkr4msFf1LsST8FVr9bIw6ha7+CkAh13iVhU aPMs++HP3TOSE0bdB/dbHOc+76oZwGNfHz0JSnL7l76OVXSuQeucZuW54uTlKfvTFBkp zZ1nckYpeTAXdojJ3SRFj+fCabFWtELoh4VUwc+zpQI9r+xL+KnDqhCa1DbS+4zMFMWK pr5raRL175ydCz0H/h4pNNOrDXzXAsQsVU91tqxZKmc+husZvYRAxL3eJ695seVWkmwA wBMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=FAMS3MLaSXy2H+bSFfuV+sHSTtkQfabSAPwfV1ghkNY=; b=HruAWC4SaGfl/+0b/Q5nUHNeKEnv7AlCiAtjrOcFnmln3pRXR6Lu9kQjU6DWiczmUx 9yabT4HNdX0UDHWBk9xUvOWDhy/+H81HFqQOpfZ8gPTeXlr6+AZVPCdUnI4Htr1FK6nQ VsbuUZuh9BAuFBpHZFWaSXEW/rzqcEBqJNuVfSgWbmbLhF8IZWoetzt/0uAhUsTmovOR goqUM/hdjO/+6j/lkj9U3WfjA4pV7VP6ijDr1Ug2Wv/xJH3/KgQ110bJ7EhZUVpApkY6 DeYiyNFkDNB6AHWFlHnn93yLm0okEUpCwle2mGLNYS+inrnmHlAka0ocApDMcGyjWfbX NBZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K7O5+35b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z33si1092218edz.314.2019.09.26.03.02.06; Thu, 26 Sep 2019 03:02:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K7O5+35b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727951AbfIYVuN (ORCPT + 99 others); Wed, 25 Sep 2019 17:50:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:52220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727054AbfIYVuN (ORCPT ); Wed, 25 Sep 2019 17:50:13 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 493A72146E; Wed, 25 Sep 2019 21:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569448212; bh=0hElOx3BzQbrRg4qLp+t1hnvhiKVtH9mNvFATszNKeU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=K7O5+35b6Ac+m64iTBbK2S6SB+lhgxNCKhjM7IcdVSDsv1wm7VwMvx8Y6X/oB6XEk 4u5uDYsizKBl250xDMeM150DYHz5cAUc3Ysh6oykM1xh2Oz8ds2ZhW5teJoNQwajnj 9nIEmyflO26x5euUTVsqw+gs4DY2MTPCjo/SjYYI= Date: Wed, 25 Sep 2019 14:50:11 -0700 From: Andrew Morton To: Joe Perches Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Jonathan Corbet , Stephen Kitt , Kees Cook , Nitin Gote , jannh@google.com, kernel-hardening@lists.openwall.com, Rasmus Villemoes Subject: Re: [PATCH V2 1/2] string: Add stracpy and stracpy_pad mechanisms Message-Id: <20190925145011.c80c89b56fcee3060cf87773@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Jul 2019 06:51:36 -0700 Joe Perches wrote: > Several uses of strlcpy and strscpy have had defects because the > last argument of each function is misused or typoed. > > Add macro mechanisms to avoid this defect. > > stracpy (copy a string to a string array) must have a string > array as the first argument (dest) and uses sizeof(dest) as the > count of bytes to copy. > > These mechanisms verify that the dest argument is an array of > char or other compatible types like u8 or s8 or equivalent. > > A BUILD_BUG is emitted when the type of dest is not compatible. > I'm still reluctant to merge this because we don't have code in -next which *uses* it. You did have a patch for that against v1, I believe? Please dust it off and send it along?