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=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 72DD4C433B4 for ; Mon, 17 May 2021 06:47:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59CE96105A for ; Mon, 17 May 2021 06:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234451AbhEQGsb (ORCPT ); Mon, 17 May 2021 02:48:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:44568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231722AbhEQGs2 (ORCPT ); Mon, 17 May 2021 02:48:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1D43261285; Mon, 17 May 2021 06:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621234032; bh=pMN6O+M8sQ4Rj/zyx2sQy8ks3b4mlNWVU0NXEn+1Tp4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=udvr1+VZ1vu+ehIbXixwtx0wBazcHjD0esq/EvN+f7kI8jiaTkOwJey7z5j9HLcGS 7grDvd7r5x6/dXjg22Tc6JGuvSInBojF81TaLL3p4+qm2TRZr4l6q2ssJCWgtrJbIt b/yGCfMyJd+Xg1i+nGk5iiX3cm2C1hYrQNHIO//zxpRLJTGnWh6b+019jMyRVuTODP DtwnQUcRaiTuGt8wL4gql/dF2cv8dL/M/NXP11tF2EXzHGELtzUHZmf/RdLiZCXrHF xQxVFvGagUiMeirW4uWfJLAxnc8mpc0VwZK3qW9V5uVKs61R8WbA7jS6nm5xl9S3K3 6YPJNdeeG1OVQ== Received: by mail-wr1-f41.google.com with SMTP id j14so3390449wrq.5; Sun, 16 May 2021 23:47:12 -0700 (PDT) X-Gm-Message-State: AOAM531tSYfz3m5/rwqiONJvM+VUu7btT6a7uAlD0KZSDF+Nqotl5S5f SaKq1yHZK8O+C4HwZK3ZCAnP1S6ozqLSevdgHhI= X-Google-Smtp-Source: ABdhPJyrn4xFZhSiNWNYYjvVM2f1w22j28McNwZhsb6mSRFn1AgPXVcsEBX4LdWdWP/IVT2Gb7C9YpHbhQO6YC8l4Aw= X-Received: by 2002:a05:6000:18a:: with SMTP id p10mr11437167wrx.99.1621234030583; Sun, 16 May 2021 23:47:10 -0700 (PDT) MIME-Version: 1.0 References: <20210515101803.924427-1-arnd@kernel.org> <20210515101803.924427-4-arnd@kernel.org> <20210517061635.GA23581@lst.de> In-Reply-To: <20210517061635.GA23581@lst.de> From: Arnd Bergmann Date: Mon, 17 May 2021 08:46:02 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/6] [v2] hexagon: use generic strncpy/strnlen from_user To: Christoph Hellwig Cc: linux-arch , 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 , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux Kernel Mailing List , "moderated list:H8/300 ARCHITECTURE" , "open list:QUALCOMM HEXAGON..." , linux-m68k , linux-riscv , linux-um Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 8:16 AM Christoph Hellwig wrote: > > 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(). Changed to your version now, thanks! Arnd