From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964858AbeAJCev (ORCPT + 1 other); Tue, 9 Jan 2018 21:34:51 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:41311 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbeAJCet (ORCPT ); Tue, 9 Jan 2018 21:34:49 -0500 X-Google-Smtp-Source: ACJfBouVB0GkYz3ex5Mx6CEJckQ1KeaRCbd7T5WhSpizcmWGRjvWnLwOYeEidHHMStBlJEAPX5gTKg== Date: Tue, 9 Jan 2018 18:34:45 -0800 From: Eric Biggers To: Kees Cook Cc: "linux-fsdevel@vger.kernel.org" , Alexander Viro , Joe Lawrence , Michael Kerrisk , Willy Tarreau , Mikulas Patocka , "Luis R . Rodriguez" , LKML , Eric Biggers , "# 3.4.x" Subject: Re: [PATCH 3/7] pipe: actually allow root to exceed the pipe buffer limits Message-ID: <20180110023445.GB931@zzz.localdomain> References: <20180108053542.6472-1-ebiggers3@gmail.com> <20180108053542.6472-4-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 09, 2018 at 02:23:32PM -0800, Kees Cook wrote: > On Sun, Jan 7, 2018 at 9:35 PM, Eric Biggers wrote: > > From: Eric Biggers > > > > pipe-user-pages-hard and pipe-user-pages-soft are only supposed to apply > > to unprivileged users, as documented in both Documentation/sysctl/fs.txt > > and the pipe(7) man page. > > > > However, the capabilities are actually only checked when increasing a > > pipe's size using F_SETPIPE_SZ, not when creating a new pipe. > > Therefore, if pipe-user-pages-hard has been set, the root user can run > > into it and be unable to create pipes. Similarly, if > > pipe-user-pages-soft has been set, the root user can run into it and > > have their pipes limited to 1 page each. > > > > Fix this by allowing the privileged override in both cases. > > Should this be controlled per-namespace instead of via init-ns caps? > I don't think so. Users shouldn't be able to bypass the limits by creating a user namespace. Eric