Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp144043rdb; Thu, 8 Feb 2024 01:23:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpWSZGZUuAQuwlHhEFoKfiMzcJtW3LoHfHizhS/qa/GZfRBv+137hHXMa0i0hdoFFThbFR X-Received: by 2002:a50:fc18:0:b0:55e:fcfa:607b with SMTP id i24-20020a50fc18000000b0055efcfa607bmr6591879edr.32.1707384210987; Thu, 08 Feb 2024 01:23:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384210; cv=pass; d=google.com; s=arc-20160816; b=nQMc7jSg12q0hEGqtbOM5gmRY0LMJCj/U5lJNRh433HfKoImy3f2f/+jBlkxD/wqLr LcuvNk+htLdfF+VkVwt7iRPyhI9lOl4rullAdcTyb52tQwpZUr0cr/JMUiI8vE3ji0is Io735bqdqGrUaSXGlXkSaUeLt12g9umwAE43J0+keTRAMlxZuUKm7IPraM0ZmKJvXrfD BIyZ9aVNKbeeFbNh2xG1rlnlO5Hxa5h7PopbHDiUlgW9T0wUaKlZolLNzBIAe1xfve2+ afC5QzV8Jy4fn5z/TAQTPFj1Cg6wFWqo2KV5omvDCM9yYBKN+pgGNVK7jeialEpvncpf gvFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=vb5dORbqze0SdpTtcMmBFKm/vy+xDGZxBk1OHiDwRbc=; fh=DDdGLdjwdl0FUKs86XcG6OZG5N/D0u4K6vZYGTXFULs=; b=SbzVnxl77aOI1mkI00LPfusI0Y9MVe9umMnRSv+1/mP+L3PPxHnIX8lUS9fnXaqjNH FROLRjUGKTKLvvi9DFUwTZBq24uycxMNixJVKkI47ijWaJVuZzCR5qWsBB6jjPXGHcuY QcS8pnhD8g8JnztK+2E5E32So7s3IOIr1u7OcpZQ3xRUS+SOub9rxFNMJ7D71eQX2Bf6 en2qYXvPCaQpLVYyGUJlreW0oFnUX5QQgBQyGiuIbfmRZ6CSwHq3d1SpWnvIRvCy51Np Fx1IInj7AtMUCxCrlr5nQJW/mIyGVGigoFIS2Z6lh8byMoTWCa2Dxn9vbYApkbOBE6W3 JruQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=19wkwW+6; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-57722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57722-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk X-Forwarded-Encrypted: i=2; AJvYcCVWhH7692Y8T0FXlSY5rD0OL+QetjS7tvlC2lVmuwF40imonaGYhjAeD9CGpT4z/lOM2IfCdwzmu5dmK3MPErAe4yW8cYqeoC5+qzkUHA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cq19-20020a056402221300b0055fafa89faesi687971edb.530.2024.02.08.01.23.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:23:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=19wkwW+6; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-57722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57722-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8A62F1F230CA for ; Thu, 8 Feb 2024 09:23:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E82946BFC2; Thu, 8 Feb 2024 09:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="19wkwW+6" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 734FC6F53E; Thu, 8 Feb 2024 09:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384072; cv=none; b=VM4qDwqRhCrEstw42OHE7fH/YcrJgp8937gHhSrp2+Am6lC8ThrJjeKHwTN97NrW1z17D953UrR2ZbJ9BC1m7+q3lNa1asExGzZLsshzwu6cSYpJsQFtxgJ4W0SKZxarTMaoyjHoWxjdK7TKiRv0NVn8WFPFUegyxdMQcJ211g4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384072; c=relaxed/simple; bh=7Osbsv9Uu5LnSEkPrNLL6eFwAd2oq5PdQu+OGCPcDYM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VxydNMVldUl5H57RHvQuJBTDDViP9TMslvqe9jpckIWDtSwj79yqMkAMFh97WRNA/jfRpHY8WGvWD2E4I6VgWly0g07vzPgVw1lTJi+1JUj83SnGAOHgQ5CtK5qIz8E3TqnM+96YLBuCpGJkO4WkLMh/XRlfwh/WwOSe+s/WWA0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=19wkwW+6; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vb5dORbqze0SdpTtcMmBFKm/vy+xDGZxBk1OHiDwRbc=; b=19wkwW+6sREDBf78amIq92Zl1u e0eDGWzYrrGtPBT4FJQqeLmWlR6shetElr7ZzQCoLltdJmNRw0G4p65NnJYLS2gWYBIG3kvGV6Zb2 CFEwQkt7+rau4DEIzj3JN+cbQOW5aH8P3W3GtuwGs6bHnQB31qUBihTOi6hWKSukGnetdMu40rso5 BCwYq62lFyF5fRzDyTdtThxAyJqGAZ+uC+eAisSBHqM5Hv8wSPjV0s8VV1W9GYxawEocCSD9GXL7k LRqcTe00XNGg5NXGm9EvurzWQCwplVd2IY/XPRawXuE4h+SXY2uu9DVLxciVr7wpLRW6YklafcQwd HHZQ/DXg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:38480) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rY0ad-00048s-1h; Thu, 08 Feb 2024 09:21:03 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rY0aX-0005QB-5C; Thu, 08 Feb 2024 09:20:57 +0000 Date: Thu, 8 Feb 2024 09:20:57 +0000 From: "Russell King (Oracle)" To: Zev Weiss Cc: linux-parisc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Helge Deller , Florent Revest , "James E.J. Bottomley" , "Mike Rapoport (IBM)" , Rick Edgecombe , "Borislav Petkov (AMD)" , Andrew Morton , Yang Shi , Stefan Roesch , Oleg Nesterov , David Hildenbrand , Josh Triplett , Ondrej Mosnacek , Miguel Ojeda , openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Sam James , stable@vger.kernel.org Subject: Re: [PATCH 0/2] ARM: prctl: Reject PR_SET_MDWE where not supported Message-ID: References: <20240208012620.32604-4-zev@bewilderbeest.net> 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: <20240208012620.32604-4-zev@bewilderbeest.net> Sender: Russell King (Oracle) Hi, Where is patch 1 of this series? It doesn't seem to have been Cc'd to linux-arm-kernel. Therefore, this can't be reviewed. Thanks. On Wed, Feb 07, 2024 at 05:26:18PM -0800, Zev Weiss wrote: > Hello, > > I noticed after a recent kernel update that my ARM926 system started > segfaulting on any execve() after calling prctl(PR_SET_MDWE). After > some investigation it appears that ARMv5 is incapable of providing the > appropriate protections for MDWE, since any readable memory is also > implicitly executable. > > (Note that I'm not an expert in either ARM arch details or the mm > subsystem, so please bear with me if I've botched something in the > above analysis.) > > The prctl_set_mdwe() function already had some special-case logic > added disabling it on PARISC (commit 793838138c15, "prctl: Disable > prctl(PR_SET_MDWE) on parisc"); this patch series (1) generalizes that > check to use an arch_*() function, and (2) adds a corresponding > override for ARM to disable MDWE on pre-ARMv6 CPUs. > > With the series applied, prctl(PR_SET_MDWE) is rejected on ARMv5 and > subsequent execve() calls (as well as mmap(PROT_READ|PROT_WRITE)) can > succeed instead of unconditionally failing; on ARMv6 the prctl works > as it did previously. > > Since this was effectively a userspace-breaking change in v6.3 (with > newer MDWE-aware userspace on older pre-MDWE kernels the prctl would > simply fail safely) I've CCed -stable for v6.3+, though since the > patches depend on the PARISC one above it will only apply cleanly on > the linux-6.6.y and linux-6.7.y branches, since at least at time of > writing the 6.3 through 6.5 branches don't have that patch backported > (due to further missing dependencies [0]). > > > Thanks, > Zev > > [0] https://lore.kernel.org/all/2023112456-linked-nape-bf19@gregkh/ > > Zev Weiss (2): > prctl: Generalize PR_SET_MDWE support check to be per-arch > ARM: prctl: Reject PR_SET_MDWE on pre-ARMv6 > > arch/arm/include/asm/mman.h | 14 ++++++++++++++ > arch/parisc/include/asm/mman.h | 14 ++++++++++++++ > include/linux/mman.h | 8 ++++++++ > kernel/sys.c | 7 +++++-- > 4 files changed, 41 insertions(+), 2 deletions(-) > create mode 100644 arch/arm/include/asm/mman.h > create mode 100644 arch/parisc/include/asm/mman.h > > -- > 2.43.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!