Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1519818rwl; Thu, 5 Jan 2023 15:04:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXst1iqe2af7jotsROxW7Zccc+a9KZnRcxj7eosso8siRWMBwTOC3tW7lJuZ2GvnI6/LJkGe X-Received: by 2002:a05:6a20:3c8a:b0:af:8128:757 with SMTP id b10-20020a056a203c8a00b000af81280757mr85367194pzj.61.1672959857167; Thu, 05 Jan 2023 15:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672959857; cv=none; d=google.com; s=arc-20160816; b=rTIr1gB+1RmCDv6r5RTcNW8ejWXr/zN6AEEXbVsktf/yzz4ovC3Yrpk09w3D7ItOaz qWQJcWpFJ7ZXb28r5eiahFVazrQPX3Juu6Tln5tIs7YYgnLbGslWPe2LgXPJfLx8G1zZ uATA2afzYe7YDHlPFhIaD0PmDhp77TOfA7N2BdFkSqGKjX/C4n3i2Wcw/e1CmXKujwwC XLtc6hbEb2vNrO8YIUhanNBWsYpelGrQaXJYtpcmfh2wgV1o68SZJUKDuE2b9pexoRRu LM+faOKWJpICJNl+jsUnqQoZOwu9QOwx8aaJczQlab0Jry6HnnV34vhmqcfohEnTUOky ykRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=INhUx6/3Xhk2/xGcSTChC+f55M0MZlL+ygV3JkGy+qw=; b=IF1XZNP7JDwOfkaNPqgasgNcooedGQbEdWYxCRyF/wXylZ6YvtBAFkzA7xtvM8ra8d ZKx69YyYXxIWY3Rkh8z9reNC7YU2//SLxC2/fYBho7/rcL6w/OiA3kF1+sUtjwVFf5/c Nt4L3Zxu4Z9ulPJyw/qTRNaLI9yfWzlbMRxqfvn8T52sVaC5zbQ4dTg+2ykj7AjmUpi+ 1bJnJylcdhsoGPx31cbRMiawoG+dtDGbql2br8k3OQGzxjoU74XRIZRUpRxvwZJ4R/e2 CCZlvKw4q/zDYfhAyoB68tGgSC3f1yy+VA9vzppIUjS61Jv6dIUZw9f+Enaj0MSivHYN i2UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=d3U57LHD; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a63cf06000000b004960bccc53esi36886539pgg.698.2023.01.05.15.04.03; Thu, 05 Jan 2023 15:04:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=d3U57LHD; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235882AbjAEW5s (ORCPT + 99 others); Thu, 5 Jan 2023 17:57:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236421AbjAEW5i (ORCPT ); Thu, 5 Jan 2023 17:57:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 910EC671A9; Thu, 5 Jan 2023 14:57:36 -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 60E1BB81C0D; Thu, 5 Jan 2023 22:57:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2E39C433F0; Thu, 5 Jan 2023 22:57:31 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="d3U57LHD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1672959449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=INhUx6/3Xhk2/xGcSTChC+f55M0MZlL+ygV3JkGy+qw=; b=d3U57LHDK5/g5g3S5DBYHkQoCwcYk8ZV6a0oM3Z6SewXdvSOqXsdHHaQbe31rTK2/sDwM8 uMa3NJfzLzSkKnpUMBkGoQwKDNdqTWO6cQbSV8C+gyuenY/YH3A7RWhDB0eL4EaO20uqvQ CziJ/xm7YuUGNCJojapunpRX30XKVzA= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8daf678c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 5 Jan 2023 22:57:29 +0000 (UTC) Date: Thu, 5 Jan 2023 23:57:26 +0100 From: "Jason A. Donenfeld" To: Yann Droneaud Cc: Linus Torvalds , Andy Lutomirski , Ingo Molnar , 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 , Jann Horn , Christian Brauner , linux-mm@kvack.org Subject: Re: [PATCH v14 2/7] mm: add VM_DROPPABLE for designating always lazily freeable mappings Message-ID: References: <20230101162910.710293-3-Jason@zx2c4.com> <10302240-51ec-0854-2c86-16752d67a9be@opteya.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <10302240-51ec-0854-2c86-16752d67a9be@opteya.com> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Jan 05, 2023 at 10:57:48PM +0100, Yann Droneaud wrote: > Hi, > > Le 03/01/2023 à 21:44, Jason A. Donenfeld a écrit : > > On Tue, Jan 03, 2023 at 12:15:57PM -0800, Linus Torvalds wrote: > >> On Tue, Jan 3, 2023 at 12:03 PM Jason A. Donenfeld wrote: > >>> That buffering cannot be done safely currently > >> .. again, this is "your semantics" (the (b) in my humbug list), not > >> necessarily reality for anybody else. > > Yea that's fair. Except, of course, I maintain that my semantics are > > important ones. :) > > > I concur. > > To hold secret material, we need MADV_WIPEONFORK | MADV_DONTDUMP and the side effect of mlock() (pages' content never written to swap), inherited across fork(). > And I want mlock() without paying the price. > > Jason's proposed semantics, which I call MADV_WIPEONSWAP, provide a mean to hold /unlimited/ amount secrets in userspace memory (not limited by RLIMIT_MEMLOCK). > The only constraint for userspace is to handle the case pages are wiped, which is already the case of userspace arc4random()'s implementation. If you're actually serious about wanting a generic mechanism for userspace, I think the moral of yesterday's poo-poo'ing all over this cool new idea is that the Linux innercircle doesn't really care for "security things" as a motivator and just takes the shortest and easiest route toward swatting it away like a gadfly, assuming that the concerns are unreal or niche or paranoid or whatever. This is obviously nothing new - it's an old complaint beaten to death for years, with people who are diehard it about eventually getting burnt out and leaving. So, practically speaking, if you want this to exist, I think you have to find some other cool use cases. Like, see if the database cache people would actually love this. Or if it could be used as an opportunistic renderer cache in Chrome that wouldn't result in OOMing with lots of tabs. Or if shared process compiler servers could benefit from it. "Droppable cache" is likely useful lots of places. So just find SOMETHING that doesn't mean having to convince folks of a new security model that justifies tickling mm/ innards in uncomfortable ways. Jason