Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp105490ybl; Tue, 20 Aug 2019 16:30:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYXJK+O3+RAXLszLuNAc8/KEuZeJFUluI+bUBcI4NiZtUwMhWqIyxYJvAUUZHFs0jtR+de X-Received: by 2002:a62:38d7:: with SMTP id f206mr32930641pfa.102.1566343810894; Tue, 20 Aug 2019 16:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566343810; cv=none; d=google.com; s=arc-20160816; b=q99DhJfOkuIIfGpfrt2inCAOrlSdcs3XOot7kqx/nQ8Nmti15TGeCBlqErcL8uoFYh AjCQMmfzyId40YWfKstsV4WCwRoeTR1z87VOJw25RWKyrzKC+7t87Gp4q/8Oedw4XxcO YFsENEg7pr5CTWh8QRSK1LvbCVn7+eaJxRffyefS7cLzRPBm1OY9CjWLoHWTyM6O+Gef 5rfDm8EUJ3EGLUcUokof6Cahjg55rBdajzeThpoPFQBEPeFNwy7OksNJTfeb/WKagA/I 83i8pt9wCbyjd3dUBw1/853yYZQdeHpaJlp9LOwMjAMaIB+HWl6uEv6+ge69CeW/cGzl 5RHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XMlMUEKr5XRMEcS7O2CjglWq7iJta7ZlUj0ydKdkNX0=; b=IzL55UXBBGLnCz77UoKH6me7SDE5SnbBr4EZNoJOD468nb0CE0OPpqiG80HEhQJe3U dkGIfwmgpRFnjXAdMs70luLqtkb2fBN/HxkYBZ8nY4NTFJcOhEKrkYOG3SjeeAWjzU+F HuDyH4IVnu6CRipnuX78AInep/EnnhIBMHZacBfQWN99Qd/tHJHn7+Qvp926c6Qf31K6 L7ZDfebeP8M/DbcjZf8GPbyyMKkhIZltbqQfUUZzmquZu0LEtSLRwPA3EahOEBfFiGaC VsNlx14ryDZYnJ4ouGHURGaPmGA7/GUn7yRCgBqqIEGEOpGaYIZC1V6mdvLKVV5QzZpM 71jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=iHh8YbqJ; 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 x22si13152362plr.115.2019.08.20.16.29.54; Tue, 20 Aug 2019 16:30:10 -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=@linux-foundation.org header.s=google header.b=iHh8YbqJ; 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 S1726277AbfHTX24 (ORCPT + 99 others); Tue, 20 Aug 2019 19:28:56 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37955 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfHTX24 (ORCPT ); Tue, 20 Aug 2019 19:28:56 -0400 Received: by mail-lf1-f65.google.com with SMTP id h28so351131lfj.5 for ; Tue, 20 Aug 2019 16:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XMlMUEKr5XRMEcS7O2CjglWq7iJta7ZlUj0ydKdkNX0=; b=iHh8YbqJQq/qqg3MN7n649EblEqXoT6lv/jNvF13p1Io12yotnNW5VDOJQVPXyJ/w1 JaSOZsSrO52CAp1T+Wotk0juqAvaieKA809jbwzdvgdw+gNCyA/AE5ttYg9tcWp2I3XA 9/R87UNQ/J+HKwDYreUrt6rqcLPdnyTqkY9kI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XMlMUEKr5XRMEcS7O2CjglWq7iJta7ZlUj0ydKdkNX0=; b=eZekWbr+NXKeEiFApYItqURKf4ZhRY01VJlrseo1/Fps7ls/BmRhCk3UqIuPacYFz0 RGML0axbnqVgFhkC3A4K2cuxOjFW+UEuU4q1OejZJO70LFupoFBWK91x+8yg6Aph1UeT /+xJPuS7v04GSA0MCH8QwkjLOuV1/0JK0g0NaUdvn/7Kzu2fqPIryBm0/mdKubMEV45N gFDAgi+Rpy9ueXxXLmE7+WEciMOV7EVKG3cek1ID/dCgaBsQXTe6UsVcbdgKajtbcxRJ 0pVw45zigBv7Xh3EE+oLVQnbq7Z8Ebh8k9CLHnTu0/KH+79kHs9vhPNiUsEBfktSoY75 EJsQ== X-Gm-Message-State: APjAAAU6Espwufn7dYzAUjRWZ0Zt88z77vZ5OlxRELX8pnbx6Qw20t4X 2AsNKE6sBcEw9Uozu//xnM+54BRW8A0= X-Received: by 2002:ac2:5b49:: with SMTP id i9mr16487055lfp.116.1566343733271; Tue, 20 Aug 2019 16:28:53 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id j22sm3021281ljg.17.2019.08.20.16.28.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Aug 2019 16:28:52 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id m24so358521ljg.8 for ; Tue, 20 Aug 2019 16:28:52 -0700 (PDT) X-Received: by 2002:a2e:9a84:: with SMTP id p4mr5487770lji.52.1566343731704; Tue, 20 Aug 2019 16:28:51 -0700 (PDT) MIME-Version: 1.0 References: <9c7a79b4d21aea52464d00c8fa4e4b92638560b6.camel@perches.com> <6a5f470c1375289908c37632572c4aa60d6486fa.camel@perches.com> <4398924f28a58fca296d101dae11e7accce80656.camel@perches.com> <20190820092451.791c85e5@canb.auug.org.au> <14723fccc2c3362cc045df17fc8554f37c8a8529.camel@perches.com> In-Reply-To: <14723fccc2c3362cc045df17fc8554f37c8a8529.camel@perches.com> From: Linus Torvalds Date: Tue, 20 Aug 2019 16:28:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: rfc: treewide scripted patch mechanism? (was: Re: [PATCH] Makefile: Convert -Wimplicit-fallthrough=3 to just -Wimplicit-fallthrough for clang)QUILT To: Joe Perches Cc: Stephen Rothwell , Julia Lawall , "Gustavo A. R. Silva" , LKML , clang-built-linux@googlegroups.com, Linux Next Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 19, 2019 at 5:08 PM Joe Perches wrote: > > 2: would be Julia Lawall's stracpy change done > with coccinelle: (attached) I'm not actually convinced about stracpy() and friends. It seems to be yet another badly thought out string interface, and there are now so many of them that no human being can keep track of them. The "badly thought out" part is that it (like the original strlcpy garbage from BSD) thinks that there is only one size that matters - the destination. Yes, we fixed part of the "source is also limited" with strscpy(). It didn't fix the problem with different size limits, but at least it fixed the fundamentally broken assumption that the source has no size limit at all. Honestly, I really really REALLY don't want yet another broken string handling function, when we still have a lot of the old strlcpy() stuff in the tree from previous broken garbage. The fact is, when you copy strings, both the destination *AND* the source may have size limits. They may be the same. Or they may not be. This is particularly noticeable in the "str*_pad()" versions. It's simply absolutely and purely wrong. I will note that we currently have not a single user or strscpy_pad() in the whole kernel outside of the testing code. And yes, we actually *do* have real and present cases of "source and destination have different sizes". They aren't common, but they do exist. So I'm putting my foot down on yet another broken string copy interface from people who do not understand this fundamental issue. Linus