Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp510870rdb; Fri, 26 Jan 2024 02:27:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZJrp3PLOMdlPl7ca4SPbFWpvlDOeDfciLaPwZe0iJUXy+uQkPVEnu3y1j//T03nyvFMsP X-Received: by 2002:a05:620a:29c7:b0:783:bd38:aca2 with SMTP id s7-20020a05620a29c700b00783bd38aca2mr1564318qkp.103.1706264828439; Fri, 26 Jan 2024 02:27:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706264828; cv=pass; d=google.com; s=arc-20160816; b=cpzDMwz4tjKlmmf7O6cOJgtH1Zkn3Nf0PqykWQNJZHGdRlGdWWU+Hg46Eiugi6VbOJ Cy2U2aCA+rfgH9baC3UZ2I0+E+5DN2RKgGCp1AHQdlRieeRlyNlbfGqGmLF8rLN+9OSc Ng7jutaZ8Px8krfN+TZvF+5qLzPjGuDAHUT/HycF2rsWpQAg5rd50DByGc/Lo3i++Nfc EXpzYUEzssKu3JaZBrtglIvVCH+O98xUR/hg+3ecZblxVzB+RHIdCIGVfzgNivFD9vdz e0uQ7BEgL1Hk8jdzeaGqjqtTsaQpf1NWLdze1ytXoJPcCzlMSDXPc3M2MynYO9W6aNp/ td0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=x2loWJgtIiYAU3JkiPQ2Kgc6YLbmwtXrr/lssGc0Kos=; fh=8+GJxlcep9VuX64bnr42Ootj3sw4Na4W42s6ZvHls+A=; b=H3J7LxZg8P5KG0KzBS+4aQOElj2lR7E4c2RyFIrzuFxW2f9jcbN9ds2gKhkp0A+ixN PwPLkNo8m7Ik8jBggN7MaArEYPHPyqbKzKPzTWsNksJFgC8Gv4+PB3gVnw3ZO44txXNp ufm3kDhG5QFlDts92ngQIUJD7hL076Ssjra/UW2Ph6nvE2PWlJL/H3OX7skqBoW34D23 l6GhCA3slI7bIQvyIjo5TIQLVhxAMtJmsBrdvNPKnXyOAf1o6J9uMK2A2Eznyazgp7Em VZMnHRxRuaBr5/273PR5e1UFkNoc7a41N2XB8qrDsJGUeYBm+1vWpv0yFNZC/sTGFCGE XxHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=QSiMTsIJ; arc=pass (i=1 spf=pass spfdomain=tesarici.cz dkim=pass dkdomain=tesarici.cz dmarc=pass fromdomain=tesarici.cz); spf=pass (google.com: domain of linux-kernel+bounces-39961-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39961-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u20-20020a05620a023400b00781d12ac757si976433qkm.783.2024.01.26.02.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 02:27:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39961-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=QSiMTsIJ; arc=pass (i=1 spf=pass spfdomain=tesarici.cz dkim=pass dkdomain=tesarici.cz dmarc=pass fromdomain=tesarici.cz); spf=pass (google.com: domain of linux-kernel+bounces-39961-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39961-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9F2471C2D445 for ; Fri, 26 Jan 2024 10:21:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC83B1DA21; Fri, 26 Jan 2024 09:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tesarici.cz header.i=@tesarici.cz header.b="QSiMTsIJ" Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253]) (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 B2E2A51C2F for ; Fri, 26 Jan 2024 09:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=77.93.223.253 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706262914; cv=none; b=r8da5+l0CUMZ2fZcn8Np1hblAIhGIytDL4Aprcmcz8YFXOWbQwdDZk0dx4GD0KJXMa4WgT/vGm2DCBRV/qaPGZuUgBGL+mjmbjk2rrY+Wl/6w9rhsY4mWFy5LI/Jr6lUvT4nKeQuy5q4McezCmDZG4x9BMxy2Edth0UonqARVJA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706262914; c=relaxed/simple; bh=98uBaqksOvo0/XWg1JQiFaXFzJAFgQLh1B1y254w2Xw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DX6qlND+QyGZoPyW2DkWsJqDNKvNWvwntbH5aCwJMx73WwbtSHmAIjMfGsBQcRTzziGrz7YOV+ET08TLXjtLRaD/Bm1tS56FSORqrGpDnfFk70wHjxueaRE8XfscsJZt62vEhcLHcIP7syMalOGN99l08W5ZeaosOkSW/jm9KKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tesarici.cz; spf=pass smtp.mailfrom=tesarici.cz; dkim=pass (2048-bit key) header.d=tesarici.cz header.i=@tesarici.cz header.b=QSiMTsIJ; arc=none smtp.client-ip=77.93.223.253 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tesarici.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tesarici.cz Received: from meshulam.tesarici.cz (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bee.tesarici.cz (Postfix) with ESMTPSA id 638D518D315; Fri, 26 Jan 2024 10:55:07 +0100 (CET) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail; t=1706262907; bh=98uBaqksOvo0/XWg1JQiFaXFzJAFgQLh1B1y254w2Xw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QSiMTsIJxe31DkozMCoyJVoren/wta82mBeBHLVS6ZMxhSyeGQW5Nlhqj0lMpIoTH /sjCikjm280U0Sp4MB7LoIaOkgstCZNlz4FJkUO9WMj9fd0JYxCH0mNcHeQljXpQDJ qXVBPD0vmn4tsoZSr4vbYxTT+ukPLbKNfg+OBhzVHDMpBYLc1iWnTu8u6/08laDPaH bY9rLJxJ8IWA3GPhIhWatpqud/QCZ0T0H4dHvahnBBvxf/SOOiiAqL/7UpCoRlv7lx xOuVKFIXVgLEDMq3pq2w1xG+RewZgaRwWKTGUn9OWtgIM/SVWSRQ9godb5T+jcTvnj fAohKhJTuhTAQ== Date: Fri, 26 Jan 2024 10:55:05 +0100 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Richard Weinberger Cc: Petr Tesarik , anton ivanov , Johannes Berg , linux-um , linux-kernel , Roberto Sassu , Petr Tesarik Subject: Re: [PATCH 0/2] um: improve UML page fault handling Message-ID: <20240126105505.38440835@meshulam.tesarici.cz> In-Reply-To: <20240105075109.4f0e2785@meshulam.tesarici.cz> References: <20231215121431.680-1-petrtesarik@huaweicloud.com> <435201914.200552.1704410531143.JavaMail.zimbra@nod.at> <20240105075109.4f0e2785@meshulam.tesarici.cz> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.39; x86_64-suse-linux-gnu) 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 5 Jan 2024 07:51:09 +0100 Petr Tesa=C5=99=C3=ADk wrote: > Helo Richard, >=20 > Am Fri, 5 Jan 2024 00:22:11 +0100 (CET) > schrieb Richard Weinberger : >=20 > > ----- Urspr=C3=BCngliche Mail ----- =20 > > > Von: "Petr Tesarik" > > > An: "richard" , "anton ivanov" , "Johannes Berg" > > > , "linux-um" , "linux-kernel" > > > CC: "Roberto Sassu" , petr@tesarici.cz= , "Petr Tesarik" > > > > > > Gesendet: Freitag, 15. Dezember 2023 13:14:29 > > > Betreff: [PATCH 0/2] um: improve UML page fault handling =20 > > =20 > > > From: Petr Tesarik > > >=20 > > > Improve UML handling of segmentation faults in kernel mode. Although > > > such page faults are generally caused by a kernel bug, it is annoying > > > if they cause an infinite loop, or panic the kernel. More importantly, > > > a robust implementation allows to write KUnit tests for various guard > > > pages, preventing potential kernel self-protection regressions. > > >=20 > > > Petr Tesarik (2): > > > um: do not panic on kernel mode faults > > > um: oops on accessing an non-present page in the vmalloc area =20 > >=20 > > I think this is a good thing to have. =20 >=20 > Thanks for the feedback. >=20 > > For the implementation side, this needs to use the oops_* helpers > > from kernel/panic.c and taint the kernel, etc... =20 >=20 > Yes, I did see that coming but wanted to get some confirmation that > it's worth the effort. >=20 > > See arch/x86/kernel/dumpstack.c die() and friends. =20 >=20 > This implementation also calls die notifiers, but AFAICS different > architectures are not very consistent in their use. Do you also > require die notifiers for the UML implementation? It seems I won't have time for this in the near future... Can I start by sending a trivial patch that panics the kernel if kernel mode tries to access a vmalloc guard page? That's something I can do immediately, and it's still better than getting page faults in an infinite loop... Petr T