From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 17 May 2021 08:16:35 +0200 From: Christoph Hellwig Subject: Re: [PATCH 3/6] [v2] hexagon: use generic strncpy/strnlen from_user Message-ID: <20210517061635.GA23581@lst.de> References: <20210515101803.924427-1-arnd@kernel.org> <20210515101803.924427-4-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210515101803.924427-4-arnd@kernel.org> To: Arnd Bergmann Cc: linux-arch@vger.kernel.org, Arnd Bergmann , Christoph Hellwig , Al Viro , Vineet Gupta , Yoshinori Sato , Brian Cain , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jeff Dike , Richard Weinberger , Anton Ivanov , Sid Manning , Andrew Morton , Mike Rapoport , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-riscv@lists.infradead.org, linux-um@lists.infradead.org List-ID: On Sat, May 15, 2021 at 12:18:00PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > Most per-architecture versions of these functions are broken in some form, > and they are almost certainly slower than the generic code as well. > > Remove the ones for hexagon and instead use the generic version. > This custom version reads the data twice for strncpy() by doing an extra > strnlen(), and it apparently lacks a check for user_addr_max(). I'd be tempted to just remove the first paragraph and reword the second as: Remove the hexagon implementation of strncpy/strnlen and instead use the generic versions. The hexago version of strncpy reads the data twice by doing an extra strnlen(), and it apparently lacks a check for user_addr_max().