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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F791C2BD09 for ; Mon, 1 Jul 2024 15:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=M7CLHoVDAWUuSCiq/pt8D3d6afDAL+3aj6vs4h+fuFQ=; b=ML7w7Zwr05bzioSuLuGZiPPyN5 TC6u4ESVpnoZ/8xheenDVeV2moagR8LAvHdahcfHRqOyHC2aCTyMgPda4GByK+r5XLc/pGb1BzU86 Gc1qVVbrH98yOLj5BLL+MAtgekZbhDq9IIntr3vr+84Nev3NdBpaRWmjoJrbvXw89APO13E4ntogC nm6jqwBt6EtXuwLzjx+iLI3NcdRdFM7Ek2GbMK554Z6Sp9/0Pv8J+nOIcTW3JEM9B6Vp3gL3gtBmW WY4lyiG33/r4FcOBXmrDRpikIeSvCWFKc0WcueMIJX529KSgWFOdAjm1l5OZoOSL8OSGP+uWrYGKo lzVgR/bA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOJ7i-00000003yuj-0wNL; Mon, 01 Jul 2024 15:39:22 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOJ7W-00000003ypq-3a7T for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2024 15:39:12 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A5290CE1787; Mon, 1 Jul 2024 15:39:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C64C5C116B1; Mon, 1 Jul 2024 15:39:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719848347; bh=CDbBeTvr+5wXXFfoeHEpMAUlbiSssKcGL82z6iSD4AU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l46ptC4FnytzBDrRTiI8bdZeLXfZ/OOkiV2dJLYek3WJy798DwuCGPq1Jnese3bY4 ci6cAE9Ld7TwCvCx1RPIG4McMNKrwm4lLCtHPLW+u6pAHjqBzB8HKev3jFcAyHx8Vm XUtHDM4nAgNYpe3cllG9KYS3tKtSQYocl6CSqnm97s5i9ca/CZ9kSpcCF3rFUjBidE jU9OF3ULjEsj5l1vcKpexfAdZpKWyBjXO1G6J+/2ZSf5vGlBedTzHBJi9qaHKAGrpt CUNN5Ansmav+fHoHAwH7CCfv3kO0g6vc1p7dUSrEDkxqVb5k7bro2ok8EBCGLOQc2B 8JzKSwZs9BjEA== Date: Mon, 1 Jul 2024 08:39:07 -0700 From: Kees Cook To: David Woodhouse Cc: Simon Horman , Peter Hilber , linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org, "Ridoux, Julien" , virtio-dev@lists.linux.dev, "Luu, Ryan" , "Christopher S. Hall" , Jason Wang , John Stultz , "Michael S. Tsirkin" , netdev@vger.kernel.org, Richard Cochran , Stephen Boyd , Thomas Gleixner , Xuan Zhuo , Marc Zyngier , Mark Rutland , Daniel Lezcano , Alessandro Zummo , Alexandre Belloni , linux-hardening@vger.kernel.org Subject: Re: [RFC PATCH v2] ptp: Add vDSO-style vmclock support Message-ID: <202407010838.D45C67B86@keescook> References: <20231218073849.35294-1-peter.hilber@opensynergy.com> <684eac07834699889fdb67be4cee09319c994a42.camel@infradead.org> <671a784b-234f-4be6-80bf-5135e257ed40@opensynergy.com> <4a0a240dffc21dde4d69179288547b945142259f.camel@infradead.org> <20240630132859.GC17134@kernel.org> <4d49e640143a557861a75a65678485965611b638.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d49e640143a557861a75a65678485965611b638.camel@infradead.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240701_083911_125804_08667361 X-CRM114-Status: GOOD ( 17.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 01, 2024 at 09:02:38AM +0100, David Woodhouse wrote: > On Sun, 2024-06-30 at 14:28 +0100, Simon Horman wrote: > > > > W=1 allmodconfig builds with gcc-13 flag the following. > > Reading the documentation of strncpy() in fortify-string.h, > > I wonder if strscpy() would be more appropriate in this case. > > It's never going to matter in practice, as the buffer is 32 bytes, so > "vmclock%d" would never get to the end even if was a 64-bit integer. > > But as a matter of hygiene and best practice, yes strscpy() would be > more appropriate. Fixed in git, thanks. Thanks! You can even use the 2-argument version. :) -- Kees Cook