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=-15.5 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=unavailable 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 68A84C4320E for ; Sun, 15 Aug 2021 14:43:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F3446113D for ; Sun, 15 Aug 2021 14:43:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238576AbhHOOna (ORCPT ); Sun, 15 Aug 2021 10:43:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:36996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232465AbhHOOn3 (ORCPT ); Sun, 15 Aug 2021 10:43:29 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 2D9A760F21; Sun, 15 Aug 2021 14:42:56 +0000 (UTC) Date: Sun, 15 Aug 2021 15:45:55 +0100 From: Jonathan Cameron To: Len Baker Cc: Andy Shevchenko , Lars-Peter Clausen , David Laight , Kees Cook , linux-hardening@vger.kernel.org, linux-iio , Linux Kernel Mailing List Subject: Re: [PATCH v4] drivers/iio: Remove all strcpy() uses Message-ID: <20210815154555.6770bc8d@jic23-huawei> In-Reply-To: <20210815081949.GA1664@titan> References: <20210814135509.4500-1-len.baker@gmx.com> <20210815081949.GA1664@titan> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; 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-kernel@vger.kernel.org On Sun, 15 Aug 2021 10:19:49 +0200 Len Baker wrote: > Hi Andy, > > On Sat, Aug 14, 2021 at 10:36:18PM +0300, Andy Shevchenko wrote: > > On Sat, Aug 14, 2021 at 4:55 PM Len Baker wrote: > > > > > > strcpy() performs no bounds checking on the destination buffer. This > > > could result in linear overflows beyond the end of the buffer, leading > > > to all kinds of misbehaviors. So, remove all the uses and add > > > devm_kstrdup() or devm_kasprintf() instead. > > > > > > This patch is an effort to clean up the proliferation of str*() > > > functions in the kernel and a previous step in the path to remove > > > the strcpy function from the kernel entirely [1]. > > > > > > [1] https://github.com/KSPP/linux/issues/88 > > > > Thank you very much for doing this! > > Now I like the result, Agreed and applied to the togreg branch of iio.git, pushed out as testing for 0-day to poke at it and see if we missed anything. Thanks, Jonathan > > Reviewed-by: Andy Shevchenko > > Thank you too Andy (and folks) for your help on this. > > Regards, > Len