Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp1031222pxy; Sun, 15 Aug 2021 07:45:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuO+vfeL0UdtLP5tXUjWfQUfRJ/9aEb5z7HrVcz37cl3k4LKBbOM6YZJdIK27Kpq2leJ0f X-Received: by 2002:a05:6638:168f:: with SMTP id f15mr5372984jat.85.1629038701451; Sun, 15 Aug 2021 07:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629038701; cv=none; d=google.com; s=arc-20160816; b=xsWp4oGQsxVt4EHjXpyrLMEQ3Egikpisl+wui1pz1/TqclSiSvHX0vtncvMsnAenwV AWG5XvMY1hhhzIaqHsG1X8J5cnpUcRQUtIqCu36MWiJPaeRIbYQZ4Lh6zlohSeFNWnom ZJVAlqZ30m7BpljgePV8Ac866TaVLV4VyU7/rNrG1+dmsffXNQ63ICqsUujh1qPOTlAp 7XcwrSzW79N7Cv5vEAy0v12Sc09i0gjSRPrwTxNbt4o53fZFiaL5QZdZKxdMHGMhY3Pg MjPDtFgNnb1oHYiZkB1M0/C64QKDVBOWOWpi7pfaWe8MG5bnEBN34f3SU6rMqKlN7cUE MpLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=AVAsmr82m4A5NtguAPSK1krdd6UjJ+shsTqmVQpxkgQ=; b=nqUIrLSr3Oq7CQ6g2Mi5KBgvcr+7YfJHVSueDxDiJznBBegcrQou47/02l++rfQurj jEOOZtKq6tVHsRr93s64CblcQ74KYxvybLIpn91S/pmseg8jXgO/v4mrQZNBwkyj9cW2 8j24ikWzJ4YBmyoiWagXFk4BP1kpgksaJliA0ZleKx2E+TAbxRlzCikuWCjqNR/gCB+g mKrSWOOZe/wpOzFvI2VN9GLoM2uYK3MxRn2D+6g59FUtOLLn7i3HjSLrLTfEQJjvcUe0 Kj7P30xHVqjebZU9j+/gkSzVPW1ziCwHZb6ROv143CSvP5RcLdO2yB9pxcqEvRf7SgTd o2eQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si11007089iov.41.2021.08.15.07.44.48; Sun, 15 Aug 2021 07:45:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238541AbhHOOna (ORCPT + 99 others); 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