Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp361831lqh; Fri, 31 May 2024 03:50:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVF1WgVm4dbFUvCkbHAEDGI9AQdFNpJk8o18XAoaO4XY2Gc2OjKCYihO+tq7BH5bUjvmazJStA4HEr8Bv57PMLvGa4Xe9RXaJ6XxSVDdQ== X-Google-Smtp-Source: AGHT+IFOml7M/J51AXNVS+n8Pc2uGHB+mgbIrPYFjMi/zzt49KHANw0I7D1v39PVgT1Ft0S9o0Ca X-Received: by 2002:a05:6870:858b:b0:24c:b769:3cfe with SMTP id 586e51a60fabf-2508ba1ab2dmr1634505fac.28.1717152608924; Fri, 31 May 2024 03:50:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717152608; cv=pass; d=google.com; s=arc-20160816; b=DvYA9hv+AaqhAzCTJ7S4F9mI0toYXR/gYrHbxHzYtOCPJxcJCciVzIBqrTmD9B02w6 0LmD2WFJtfP8K8wLkw8ymDhKXQUhEdivfn7iTa3KYdZ0x6QroATpOyerGhtFvtvx8sJX tbEkEtnyLIjONzpYluo8ANR4mVLzhDL2fBEf/oPSjh6ChRH6cInnxmdNiO9CfeUTrD+K rv4ga+EEIEtCvH3z3jNKCBOsN0AuedJO9h0hiVffrgaKjxuW2UNN5PXDUjAy3uALnKt5 HoBTnuKZcLeqhSONZzPRAmFDCEYATO3jFMfPnS6+R0dyIfJHdJqHKYzyVKnBYHL9KpBF 6GBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=8rRp80lBW4FzoN8ncda3wP8nvCP0z9lrK+Jc/IWYduo=; fh=Hc6Gy9N52jAEGM74VD90p/1GEQpjOz6Gs90M/sPLshA=; b=KJhb313A8SwXZmtm5cRxQhz7PcpOQLcEUPwEkoYwWJP+j6+2PJLEB3eD1Ct8UsYrtl ag14luWrWVw/oYxBjoVvarW4j53zGGx+u0THW85CPACuaDKXHjanc5sgl58DZ2gq5MCp 8yG6xSP+6WsSSHBAt3e4ZwyPitGpVPb2Kn0EejKDhJHRcCOsbiqlDs8mppHZKzoQqQse soM5xxtq6EUNYwNRSQPBF6uzeh4fEL3+HX8cng1OdkDKhkS5fnS/u0vnpmp2P91/23xO H4w4zdy8wD1tpZ/XvAtHZ/GUpW4Oj4yaDTnVTh450CVNubVbwEnP2W1eDIzfN5YJuc/5 8Y5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HsWkXc6v; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-crypto+bounces-4609-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4609-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540f5f70si1395755a12.16.2024.05.31.03.50.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 03:50:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4609-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HsWkXc6v; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-crypto+bounces-4609-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4609-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7F2C8288F8F for ; Fri, 31 May 2024 10:50:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7395E157481; Fri, 31 May 2024 10:49:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HsWkXc6v" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BED9156677 for ; Fri, 31 May 2024 10:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717152581; cv=none; b=jZ9yzg3X/b2aficth9IM6VpYFNq8gu9bJX8cggK7vdoewAHhjljLLJqZl15aXtNATDChi1P7OaZFKtC9fgV3dCBh8AhiQ2IlltNZmJ8oB7zR/CyAQ8pxJiUrW4yt86QSbL9mlPWHAu2MV+o2j6uYo4mwxqXz2GMEpfIsy6/V02w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717152581; c=relaxed/simple; bh=rGZ05Wtl7/tFqqeKIfV5yhM9avsTsSpt/wX8DUBeUl8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=SgP0VowGiAX+kVD7mk80PmpKzVUPLUtxnms9zThsM/gQALAELhy30FqEM+cgPiAzKGAVnOpRsy7WZeBgVciAdxLgWYS1kX37B4+MlyHe/k92/gNllDjXzmoMRo29179U9EtqbCrqqQWW+u6XtLA44P3HZapQJgJhXPQvCu4Yd6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=HsWkXc6v; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-57a22af919cso8943a12.1 for ; Fri, 31 May 2024 03:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717152577; x=1717757377; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8rRp80lBW4FzoN8ncda3wP8nvCP0z9lrK+Jc/IWYduo=; b=HsWkXc6vy3EByAB77Ul9Zsx8LSEDqCaS97xpcWD1S0rgCDbugyzcodDnIX5Ll9QzSq L+iFuGtE1cvJCF+MJ79ypkPiMHFaoEg4ys/QwM9U8Ugqtpmy10O5ySti3ido5YjJRzrH PaDlTUsD9/fI2JkEaR8DWsj3dOU8qkKatA25NOS7JS3c9FeJ7GMdJIWpGVG6RBKOM4Nf 4bAHjlC6464A49PpcdupEPOYlA8VbgumeFLmefyHQ4Smagk7tWzywW52/aYVvruvYIjO WvA1ZKBsjPOzX+22PcvvsE7xlt9DyYuEqAXpne4NV1ldrqJyGugVp8Lya1vmOy8hvUgI ohdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717152577; x=1717757377; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8rRp80lBW4FzoN8ncda3wP8nvCP0z9lrK+Jc/IWYduo=; b=tEtllpuPFbrBXqdYa/rvnYaM3rsrd7PgBetjsFYUvN7/MXU7f3ez+ujyUfvAsFbOUZ 4N7Q1XJoyY5CCHjHLKHugvqua6Y/zjUwGE7SVGeemIqNeKxbrVRXQg6cSGvghB0FIj0D sZ97QuEaUNuGkz3zciDpSvmH9ZjxmH9RbTf+Z9K8IPdieuNJcQcfgN4zHVaRShR994qp g6pCcR40FmmbHBlLDweU/y4YaBfUD3axs6SOMVWVzZbUKtRbnJrS0Q8XNgQE9iI17a6f ZUdkCWR+5Y6i1jNK3Wb4aW1yhbCHoklOkedZivWqX/hrE0LGL65TW4ztwuKhUx1qnyyu /Eig== X-Forwarded-Encrypted: i=1; AJvYcCXBW2FLX/U4frUgEACzEl7vgm6n03bjFQf/Xr5O5HsJShoY9vL+n7JlBDJvNbH/DEqjdLfPvQ9PC+LBz9Q7ekoQqcD+ljNCG+UGaar3 X-Gm-Message-State: AOJu0YylUkh3PgHopuWPuWqO1zXPYdnZ6WjEPrHrQ98S7+jgec3VC4BE SHwp+YB3EID/URt9z9jyXuzIgffDcP6PU0LJmcDsCLe6jcpUv04fWP5y01E+t10XR4jIjNpOjI+ qkbQVsu2VgO0/CvSRYGJ+xZN8Z+jABkoyZ741 X-Received: by 2002:a05:6402:148b:b0:572:988f:2f38 with SMTP id 4fb4d7f45d1cf-57a33c6bab5mr160899a12.6.1717152576620; Fri, 31 May 2024 03:49:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240528122352.2485958-1-Jason@zx2c4.com> <20240528122352.2485958-2-Jason@zx2c4.com> In-Reply-To: <20240528122352.2485958-2-Jason@zx2c4.com> From: Jann Horn Date: Fri, 31 May 2024 12:48:58 +0200 Message-ID: Subject: Re: [PATCH v16 1/5] mm: add VM_DROPPABLE for designating always lazily freeable mappings To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, tglx@linutronix.de, linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , "Carlos O'Donell" , Florian Weimer , Arnd Bergmann , Christian Brauner , David Hildenbrand , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2024 at 2:24=E2=80=AFPM Jason A. Donenfeld wrote: > c) If there's not enough memory to service a page fault, it's not fatal. [...] > @@ -5689,6 +5689,10 @@ vm_fault_t handle_mm_fault(struct vm_area_struct *= vma, unsigned long address, > > lru_gen_exit_fault(); > > + /* If the mapping is droppable, then errors due to OOM aren't fat= al. */ > + if (vma->vm_flags & VM_DROPPABLE) > + ret &=3D ~VM_FAULT_OOM; Can you remind me how this is supposed to work? If we get an OOM error, and the error is not fatal, does that mean we'll just keep hitting the same fault handler over and over again (until we happen to have memory available again I guess)? Or is there something in this series that somehow redirects userspace execution to getrandom() in that case? > + > if (flags & FAULT_FLAG_USER) { > mem_cgroup_exit_user_fault(); > /*