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 3C1F0C433EF for ; Wed, 9 Feb 2022 18:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239761AbiBISgy (ORCPT ); Wed, 9 Feb 2022 13:36:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239697AbiBISgb (ORCPT ); Wed, 9 Feb 2022 13:36:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C7DFC05CB9D for ; Wed, 9 Feb 2022 10:36:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 11664B821BD for ; Wed, 9 Feb 2022 18:36:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 463ECC340E7; Wed, 9 Feb 2022 18:36:18 +0000 (UTC) Date: Wed, 9 Feb 2022 18:36:15 +0000 From: Catalin Marinas To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, nd@arm.com, broonie@kernel.org, shuah@kernel.org, skhan@linuxfoundation.org, will@kernel.org Subject: Re: [PATCH v3 1/6] kselftest/arm64: mte: user_mem: introduce tag_offset and tag_len Message-ID: References: <20220209152240.52788-1-joey.gouly@arm.com> <20220209152240.52788-2-joey.gouly@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220209152240.52788-2-joey.gouly@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Wed, Feb 09, 2022 at 03:22:35PM +0000, Joey Gouly wrote: > These can be used to place an MTE tag at an address that is not at a > page size boundary. > > The kernel prior to 295cf156231c ("arm64: Avoid premature usercopy failure"), > would infinite loop if an MTE tag was placed not at a PAGE_SIZE boundary. > This is because the kernel checked if the pages were readable by checking the > first byte of each page, but would then fault in the middle of the page due > to the MTE tag. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Brown > Cc: Shuah Khan > Reviewed-by: Mark Brown > Tested-by: Mark Brown > Reviewed-by: Shuah Khan Reviewed-by: Catalin Marinas 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 3CA84C433EF for ; Wed, 9 Feb 2022 18:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=epnGcbYiGStYJ9j+NEK/GgE9a9WfDatyexBCJmFqsyo=; b=VZPPCLKti5BsKM JMVhmTUzqotYUQQWmIKh6f8DwWj4Qx5mbeQE1gWNisOK0oWMBkqOLFXFhSQc0TsZk7tEpzSMpGlNV 4A92zOWf6y75Jphws/HvVF96c0yDDuHri3P7hO811owRkU5J5Fz2BT88KJU3SCDzxiVxFLqsybRyq kYJNrxBobnF2fqZAiZEGNyDcN8m8wtx04ejkeL9+OvWVfo+PZgFXT/HUZfQkh9fQuLRoZikyz9uqL dwRSYYKAmdJ98puxBbHkuVDrjJI9ZvSWtvRDaWqS+e6zniY3pYVnjgT0aLdI/nuMvAuhAb0eQtzzS M9CZNUCRto1Mk9+tkkrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHrpP-00180G-V1; Wed, 09 Feb 2022 18:36:32 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHrpG-0017x1-MJ for linux-arm-kernel@lists.infradead.org; Wed, 09 Feb 2022 18:36:24 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5046CB82385; Wed, 9 Feb 2022 18:36:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 463ECC340E7; Wed, 9 Feb 2022 18:36:18 +0000 (UTC) Date: Wed, 9 Feb 2022 18:36:15 +0000 From: Catalin Marinas To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, nd@arm.com, broonie@kernel.org, shuah@kernel.org, skhan@linuxfoundation.org, will@kernel.org Subject: Re: [PATCH v3 1/6] kselftest/arm64: mte: user_mem: introduce tag_offset and tag_len Message-ID: References: <20220209152240.52788-1-joey.gouly@arm.com> <20220209152240.52788-2-joey.gouly@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220209152240.52788-2-joey.gouly@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220209_103622_901062_86435809 X-CRM114-Status: GOOD ( 13.10 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 09, 2022 at 03:22:35PM +0000, Joey Gouly wrote: > These can be used to place an MTE tag at an address that is not at a > page size boundary. > > The kernel prior to 295cf156231c ("arm64: Avoid premature usercopy failure"), > would infinite loop if an MTE tag was placed not at a PAGE_SIZE boundary. > This is because the kernel checked if the pages were readable by checking the > first byte of each page, but would then fault in the middle of the page due > to the MTE tag. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Brown > Cc: Shuah Khan > Reviewed-by: Mark Brown > Tested-by: Mark Brown > Reviewed-by: Shuah Khan Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel