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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70594C433E1 for ; Thu, 27 Aug 2020 19:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B1492087E for ; Thu, 27 Aug 2020 19:37:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbgH0ThJ (ORCPT ); Thu, 27 Aug 2020 15:37:09 -0400 Received: from smtprelay0021.hostedemail.com ([216.40.44.21]:39708 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726250AbgH0ThJ (ORCPT ); Thu, 27 Aug 2020 15:37:09 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 548AB180A68C2; Thu, 27 Aug 2020 19:37:07 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: hill72_3d03ab42706f X-Filterd-Recvd-Size: 2409 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Thu, 27 Aug 2020 19:37:04 +0000 (UTC) Message-ID: <98787c53f0577952be3f0ec0f7e58d618a165c33.camel@perches.com> Subject: Re: [PATCH v3] lib/string.c: implement stpcpy From: Joe Perches To: Kees Cook , Andy Shevchenko Cc: Masahiro Yamada , Nick Desaulniers , clang-built-linux , stable , Andy Lavr , Arvind Sankar , Rasmus Villemoes , Sami Tolvanen , Andrew Morton , Andy Shevchenko , Alexandru Ardelean , Yury Norov , Linux Kernel Mailing List Date: Thu, 27 Aug 2020 12:37:03 -0700 In-Reply-To: <202008271126.2C397BF6D@keescook> References: <20200825135838.2938771-1-ndesaulniers@google.com> <202008261627.7B2B02A@keescook> <202008271126.2C397BF6D@keescook> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-08-27 at 11:30 -0700, Kees Cook wrote: > Most of the uses of strcpy() in the kernel are just copying between two > known-at-compile-time NUL-terminated character arrays. We had wanted to > introduce stracpy() for this, but Linus objected to yet more string > functions. https://lore.kernel.org/kernel-hardening/24bb53c57767c1c2a8f266c305a670f7@sk2.org/T/ I still think stracpy is a good idea. Maybe when the strcpy/strlcpy uses are removed it'll be more acceptable. And here's a cocci script to convert most of them. https://lore.kernel.org/kernel-hardening/b9bb5550b264d4b29b2b20f7ff8b1b40d20def6a.camel@perches.com/