Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1024742rwb; Sat, 13 Aug 2022 14:40:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR570G91WJcg3fIDx/f3Tn8QD7yfgUZ8ZVessZXmBxnm2FpFDYha3u6t32I2lQN99gvWp7pT X-Received: by 2002:a05:6a00:1688:b0:52b:cf1f:807a with SMTP id k8-20020a056a00168800b0052bcf1f807amr9759132pfc.21.1660426800689; Sat, 13 Aug 2022 14:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660426800; cv=none; d=google.com; s=arc-20160816; b=IcBxjZYoJqpmkORA0+BpdLdQk2co9lmWmPZ/3Bt5P4iz1cS92TXfUTHksBlf5aghCu IGImDIpqIKnt1IMpv7He1OfLStKqxXqaOEEBuF4WZCt/QZ89NFDi85cEj7LCjoDFbAC+ wB9hoYB6qTxTuIWhRKfQZ0PEH1wxBGrhTzwy0oXjP8KLaPKpYWklX0NtBm/kZQnXzTna yqtgRvP30udpnJZ2eDQC/MVnKW5IFwVYQqtjFDZy6W/SCpIZBo0iwQM+gUfJZsufD2+c 7lIg1qc9UzcvoNiz1PasLTEOHfvG7yA/8xc6NNXsI9H45xhfePMQ54JmrXuuTK18MRbZ By0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pJARGpYDRG1Jl/rpwzXhVmN1AU3CPPfwsaLJnAGsXAU=; b=BcoPT4M4WQ0Q6gXSrCkBWYDHAsg1nZ674KymcJE9DUEpVX6ia1MbQoJRSCVT65O0Ic lqkdJXTa4Ev19+3gIhMWPXK4JGhgJuM225JXbBIsDPlZXPsZOuPXk1H54DjMTvjVUc8Y kEdW/4ib1VoJYA1b8/+xDr1Qk+Weirs3rnlDvDtL5OhXX4cGyMKYLMxJmgYM/sPr+GnM /02EGO5SyZxoJIm8Z/DMZdt7q94Nyh4suX/c0LW+92+o+uhLeQOPIXKOmZ+g4fHg3olV QvW5WdrX/bBBuDORTBX1wTWo0PpumAbASlXw7BNXROkbHM7y4eyUBJ4aH6GUkfK5jaUw MrVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cGbBvlx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi14-20020a17090b1e4e00b001efbdf44c12si12277951pjb.97.2022.08.13.14.39.31; Sat, 13 Aug 2022 14:40:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cGbBvlx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240989AbiHMViL (ORCPT + 99 others); Sat, 13 Aug 2022 17:38:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240986AbiHMViJ (ORCPT ); Sat, 13 Aug 2022 17:38:09 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA7127B0A for ; Sat, 13 Aug 2022 14:38:08 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id y3so5213789eda.6 for ; Sat, 13 Aug 2022 14:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=pJARGpYDRG1Jl/rpwzXhVmN1AU3CPPfwsaLJnAGsXAU=; b=cGbBvlx6n7XyT6C3og9s4r5BWLakWyXg0ooz0frMES8mhFJIpDwHSlooUIsagfxrFh a/EXAPLQOjke/H1apCB4rNCjDu+y5KJk5Bad7OIB5a94D2pKbjoVtNy+WnZdRypOiTIE +6PewrzivrtgxLIhNx5Cjrs+lkgEKK89hWFC0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=pJARGpYDRG1Jl/rpwzXhVmN1AU3CPPfwsaLJnAGsXAU=; b=z09uj/n47fGX55rkcVVyo9NRT2pslBS5gIgpgA4Phm/GIq3O0suPY8jKNmJGFhdbT7 oTqSzOL8zZwN6oJwaku+WzShHUdDBTbHYlctw6pjp6zZNVp5JT5cvFW3ftMPdhXCo6Eu 9sJiMtUUz+XyQmfWvysiCuvPGuk+oVcKi3PdxZytq7Qinm0lzhCZBS2ZwKdjwboZ0DgU HRL0DZAvdFrf3H01E0fX+4kS0OeEtDmcfBsvngoaqmod9Aqt4C4OPAwP8KTm0KME99vc sjb+RKMS1CoNyEbx4JGB60bYxl65oDbMfOqbxDKBWaxXC5KyB3Rwo3bq8knBgs1O7bfI /Y+w== X-Gm-Message-State: ACgBeo2elkqJpUBYImtqYf2l9bSZye5IcgEc8yC/gwVk60MN1b9+rcU6 wg0lSRlY7EjAu52S4eBclklyDLAi9j75iixg X-Received: by 2002:a05:6402:501d:b0:443:1c7:ccb9 with SMTP id p29-20020a056402501d00b0044301c7ccb9mr8650183eda.101.1660426687332; Sat, 13 Aug 2022 14:38:07 -0700 (PDT) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com. [209.85.128.41]) by smtp.gmail.com with ESMTPSA id 15-20020a170906318f00b007314a01766asm2250393ejy.211.2022.08.13.14.38.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Aug 2022 14:38:06 -0700 (PDT) Received: by mail-wm1-f41.google.com with SMTP id r83-20020a1c4456000000b003a5cb389944so2058919wma.4 for ; Sat, 13 Aug 2022 14:38:06 -0700 (PDT) X-Received: by 2002:a1c:f603:0:b0:3a5:23ca:3e7c with SMTP id w3-20020a1cf603000000b003a523ca3e7cmr6229444wmc.38.1660426685890; Sat, 13 Aug 2022 14:38:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sat, 13 Aug 2022 14:37:49 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PULL REQUEST] i2c-for-5.20-part2 To: Wolfram Sang , Julia Lawall Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 13, 2022 at 8:42 AM Wolfram Sang wrote: > > * subsystem-wide move from strlcpy to strscpy Hmm. Looking around, we still do have a lot of those 'strlcpy()' users, but 99% of them don't use the return value. And since 'strlcpy()' is complete and utter garbage exactly *BECAUSE* of the bad return value (it returns the length of the source string - but an untrusted and possibly unterminated source string is often the *problem* in the first place), that would make it fairly easy to convert the rest. I see two possibilities: (a) fix strlcpy() by making it return 'void', and leave all those 99% of users alone, and convert the (few) cases that actually look at the return value to strscpy (b) auto-convert (with a coccinelle script) all the 'strlcpy()' users that don't care about the return value, and leave a few broken users of strlcpy around I think (b) is the simpler thing, but I have no idea how to write a coccinelle patch that basically does "if return value of strlcpy is not used, convert the strlcpy to a strscpy". I'd love to get rid of strlcpy() entirely, since it's such a horribly badly designed thing. Linus