Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2726208imm; Sun, 29 Jul 2018 01:53:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc8HhTLR26DIsC/gaS8gNDzcjm4MeexvIfmFvLLF9Gxtb9WBxR41AgHGkfVTEtdhfuhDeBv X-Received: by 2002:a65:60cf:: with SMTP id r15-v6mr12124179pgv.41.1532854381610; Sun, 29 Jul 2018 01:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532854381; cv=none; d=google.com; s=arc-20160816; b=zv8kfHsKTJ0UXAsnrBSPE3JmM5ZQQS+uEyb2GCcURffoZdkJ3iIwjgjj2Ga5PnTjMx tAoBUdqBhKVyT8JOktspixrgIeCPTCLQCn6JJuw6JVaMfWBcCaP0UmMl/MbSHe0jhTWN 0BS1noU5IiFJXZVSfj7XBQ0L+AuCYT4x9pwUplq1enx3pdf1bN4Qmr/ML7TToXzVBmWx qld0N524v8HBrCAR003P1RbPYHpXUG1rcojXil/1uJgYAZ4XqHBq9aKPD54dB9IpsCxW 0BBIO0c0NjNq0npa0VO0t6bfckpbhON/CLRpTPpG2OUsEwJqs36peDEtSQfOfjuouxZh iXWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization :arc-authentication-results; bh=SrsUAkez1Cx4/y9ScViZOaQ6aGYGxaU6Bw7PTCvt61Y=; b=gqZfkZ9YNJJ6Rhbti/dISni79UFH4UBadd3h8P+iyBCZi+BSjOSuthvOt6pCc9dq1k XtACpQ4xc3b2thrxdI0hXHmD5dlIOz6vVHDqXvMkOVO7bDJENFvSBvshCszbd0EHUng6 AxsE5pd1jKpU/9LnVzCSIROgWGsxv69xRlBiWmoCdExjQGnbLYDH0qME/07E9GqlM3XK rVspBUmDYle0xL2jx61tILKWyBXO15aSr5TC+3WN0roIsrSrPntQlVpscn7IEJETb4sk jT1yCWSj4spdzi4lOMlR4xgUJLAkWpXQJIGSF0MfrnBWOTrS1V1mF546BwZCNRMZYsux PoDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10-v6si7469389plu.506.2018.07.29.01.52.15; Sun, 29 Jul 2018 01:53:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726247AbeG2KTp (ORCPT + 99 others); Sun, 29 Jul 2018 06:19:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58470 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726022AbeG2KTo (ORCPT ); Sun, 29 Jul 2018 06:19:44 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5260840201C9; Sun, 29 Jul 2018 08:50:02 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-116.rdu2.redhat.com [10.10.120.116]) by smtp.corp.redhat.com (Postfix) with ESMTP id 315B6111E412; Sun, 29 Jul 2018 08:50:01 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <153271267980.9458.7640156373438016898.stgit@warthog.procyon.org.uk> <153271287586.9458.6001928723332685410.stgit@warthog.procyon.org.uk> To: Jann Horn Cc: dhowells@redhat.com, Al Viro , Linux API , Linus Torvalds , linux-fsdevel@vger.kernel.org, kernel list Subject: Re: [PATCH 29/38] vfs: syscall: Add fsconfig() for configuring and managing a context [ver #10] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19864.1532854200.1@warthog.procyon.org.uk> Date: Sun, 29 Jul 2018 09:50:00 +0100 Message-ID: <19865.1532854200@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Sun, 29 Jul 2018 08:50:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Sun, 29 Jul 2018 08:50:02 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jann Horn wrote: > [...] > > + case fsconfig_set_binary: > > + param.type = fs_value_is_blob; > > + param.size = aux; > > + param.blob = memdup_user_nul(_value, aux); > > + if (IS_ERR(param.blob)) { > > + ret = PTR_ERR(param.blob); > > + goto out_key; > > + } > > + break; > > This means that a namespace admin (iow, an unprivileged user) can > allocate 1MB of unswappable kmalloc memory per userspace task, right? > Using userfaultfd or FUSE, you can then stall the task as long as you > want while it has that allocation. Is that problematic, or is that > normal? That's not exactly the case. A userspace task can make a temporary allocation, but unless the filesystem grabs it, it's released again on exit from the system call. Note that I should probably use vmalloc() rather than kmalloc(), but that doesn't really affect your point. I could also pass the user pointer through to the filesystem instead - I wanted to avoid that for this interface, but it make sense in this instance. David