From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28217C00140 for ; Thu, 18 Aug 2022 22:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344875AbiHRWPC (ORCPT ); Thu, 18 Aug 2022 18:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241586AbiHRWPC (ORCPT ); Thu, 18 Aug 2022 18:15:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F63CB6D0E; Thu, 18 Aug 2022 15:15:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B9E6FB8246F; Thu, 18 Aug 2022 22:14:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 599B9C433D7; Thu, 18 Aug 2022 22:14:55 +0000 (UTC) Date: Thu, 18 Aug 2022 18:15:06 -0400 From: Steven Rostedt To: Wolfram Sang Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Tejun Heo , Zefan Li , Johannes Weiner , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Petr Mladek , Sergey Senozhatsky , John Ogness , John Stultz , Thomas Gleixner , Stephen Boyd , bpf@vger.kernel.org, cgroups@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH] kernel: move from strlcpy with unused retval to strscpy Message-ID: <20220818181506.0d838d02@gandalf.local.home> In-Reply-To: <20220818210202.8227-1-wsa+renesas@sang-engineering.com> References: <20220818210202.8227-1-wsa+renesas@sang-engineering.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Thu, 18 Aug 2022 23:02:01 +0200 Wolfram Sang wrote: > Follow the advice of the below link and prefer 'strscpy' in this > subsystem. Conversion is 1:1 because the return value is not used. > Generated by a coccinelle script. > > Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Grumble. "So it's a completely useless function if you can't implicitly trust the source string - but that is almost always why people think they should use it!" But in my cases I actually do trust the source string. They are all generated from the kernel (not user input). With the exception of the trace_inject, which I didn't write, and that should definitely be converted. But eh, I'm not going to argue this one. -- Steve