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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADA49C001B0 for ; Fri, 11 Aug 2023 12:34:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235756AbjHKMd7 (ORCPT ); Fri, 11 Aug 2023 08:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbjHKMd5 (ORCPT ); Fri, 11 Aug 2023 08:33:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47BF830C1 for ; Fri, 11 Aug 2023 05:33:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D866C67031 for ; Fri, 11 Aug 2023 12:33:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E65AEC433C7; Fri, 11 Aug 2023 12:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691757236; bh=1FHav62wGjkvJfOtUkSd7cOKVq97NsYIFXy+uWXuPQo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LHYfk427SN+8jcuF4CGk2ctHNHJrOyNVbxrKiyAnLNkdP8HSx8OAFvXv5wAo92046 R/q+eDvY+nJpxiPoTGYLEOzMPqipfJEi1VedDPSTfsauAK29sLPTgD/3seErq/9zrL R+2ts+V9OJZl6OM0Gwb3AVOSQBwP8/uRIFPJgzyuwpK/XKTg1M18WwTmGWFGb/3Nd7 5bpp1y38+bQBDnORdZhVikVDAlzEJAFJYSPMOpI/X6umIIXpeHGd8WRRlTe7jBouA7 DAoYTFfeKQHEGBQKzI7pxIdhuTEnxMeSRhBe4+IrlRXI25vHOSfNwNdLR7I+RNJSiv GqzwqbnkjCftg== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Alexandre Ghiti , Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alan Kao , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Bo YU , Aurelien Jarno Subject: Re: [PATCH -fixes] riscv: uaccess: Return the number of bytes effectively copied In-Reply-To: References: <20230811110304.1613032-1-alexghiti@rivosinc.com> Date: Fri, 11 Aug 2023 14:33:53 +0200 Message-ID: <87r0o9ahce.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexandre Ghiti writes: > On 11/08/2023 13:03, Alexandre Ghiti wrote: >> It was reported that the riscv kernel hangs while executing the test >> in [1]. >> >> Indeed, the test hangs when trying to write a buffer to a file. The >> problem is that the riscv implementation of raw_copy_from_user() does not >> return the number of bytes written when an exception happens and is fixed >> up. > > > I'll respin another version as the changelog and the title are=20 > incorrect: the uaccess routines should not return the number of bytes=20 > copied but actually the number of bytes not copied (this is what this=20 > patch implements). > > I'll wait for feedbacks before doing so! Yikes! Nice catch. Functions like fault_in_readable() will fail horribly w/o this. I wonder why we haven't seen this problem more? Feel free to add my RB to your next spin! Reviewed-by: Bj=C3=B6rn T=C3=B6pel