From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2211C30E0F4 for ; Thu, 22 Jan 2026 10:32:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769077960; cv=none; b=WwO8HO7nI2OsQKKTDfH8P8KGlbNB+JZkWz++5NcYvMoqQX7CgucLhPdNjJOfGfxj2BYEjvH5fowaIk8GLB6vUgSQUdChjxTLOt5ODathJWzul9CUzci3zuQm6/Ve6GgSoGvfcrimQSlgjBMnhkFqYArt1vCaB09g0Px5l89tPs0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769077960; c=relaxed/simple; bh=k3wigtvvgitXmNYhbQcxlAS/1cAtiw6JShYdcjcXWgc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gQ0t0wcvgifxvk1u1HqpLL6g38YFcWAXmh5Fe1DYalJk8jKPyZ3TavFyixX4lKzhgjY1waflnHuXThBFm6oViEpVSXNpUp6BD9JtAS3/PPeeX4G09vCWaEb9ZETMp4Nb+lfyxgR+bglmWw7oSs1GZHBGM7ucClPMCvbkEf5veLk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GopdvMk2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GopdvMk2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F2B7C116C6; Thu, 22 Jan 2026 10:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769077959; bh=k3wigtvvgitXmNYhbQcxlAS/1cAtiw6JShYdcjcXWgc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GopdvMk22g+PZk/+/gUQU104GzpyK2EYIiA29AMbxC2zw/km9FvXh2j6Wwf+5R7EU GVJrokrOqoyf3QR+LRdBhzHYw3dPOIhQNC7/p8/dE7D9Mi104IHeY60jxfIDeh13Dr Ig+dNeto7UTGbRxsfgvwVELVyV9QZL4HO4/Cmr3Bpv/3G8fOu9pBOF3r3jBQkdPa2v 3BU/s7RNByAuVom5DcJG9fOYkurclVkanfm0pYRZ0vY8llNN/zotKZkINO2Qdv6mHG Wkn51FhVSxbxkLI6qCah1VxDfNUwlAMCHy9Ha68mAB7cNdF2MOhnja04L79Fe2mENi WqcVLIaxCP2vg== Date: Thu, 22 Jan 2026 12:32:33 +0200 From: Mike Rapoport To: Maciej Wieczor-Retman Cc: Andrew Morton , Uladzislau Rezki , Maciej Wieczor-Retman , Alexander Potapenko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 06/13] mm/execmem: Untag addresses in EXECMEM_ROX related pointer arithmetic Message-ID: References: <50701245bae3d2c543f518d206539ba71367075c.1768845098.git.m.wieczorretman@pm.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50701245bae3d2c543f518d206539ba71367075c.1768845098.git.m.wieczorretman@pm.me> On Tue, Jan 20, 2026 at 02:41:43PM +0000, Maciej Wieczor-Retman wrote: > From: Maciej Wieczor-Retman > > ARCH_HAS_EXECMEM_ROX was re-enabled in x86 at Linux 6.14 release. > vm_reset_perms() calculates range's start and end addresses using min() > and max() functions. To do that it compares pointers but, with KASAN > software tags mode enabled, some are tagged - addr variable is, while > start and end variables aren't. This can cause the wrong address to be > chosen and result in various errors in different places. > > Reset tags in the address used as function argument in min(), max(). > > execmem_cache_add() adds tagged pointers to a maple tree structure, > which then are incorrectly compared when walking the tree. That results > in different pointers being returned later and page permission violation > errors panicking the kernel. > > Reset tag of the address range inserted into the maple tree inside > execmem_vmalloc() which then gets propagated to execmem_cache_add(). > > Signed-off-by: Maciej Wieczor-Retman > Acked-by: Alexander Potapenko Acked-by: Mike Rapoport (Microsoft) -- Sincerely yours, Mike.