From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964913AbeAJCaA (ORCPT + 1 other); Tue, 9 Jan 2018 21:30:00 -0500 Received: from mail-pl0-f53.google.com ([209.85.160.53]:41832 "EHLO mail-pl0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933578AbeAJC37 (ORCPT ); Tue, 9 Jan 2018 21:29:59 -0500 X-Google-Smtp-Source: ACJfBosYZ7LyL9/JD+ikg0OxPpX0gs1E8oIEt6POI4GTsqdp5kUYs9CNNgzHCYZteybFHt3U2YYwHQ== Date: Tue, 9 Jan 2018 18:29:54 -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 Subject: Re: [PATCH 1/7] pipe, sysctl: drop 'min' parameter from pipe-max-size converter Message-ID: <20180110022954.GA931@zzz.localdomain> References: <20180108053542.6472-1-ebiggers3@gmail.com> <20180108053542.6472-2-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:20:45PM -0800, Kees Cook wrote: > On Sun, Jan 7, 2018 at 9:35 PM, Eric Biggers wrote: > > From: Eric Biggers > > > > Before validating the given value against pipe_min_size, > > do_proc_dopipe_max_size_conv() calls round_pipe_size(), which rounds the > > value up to pipe_min_size. Therefore, the second check against > > pipe_min_size is redundant. Remove it. > > Well, it's not redundant: it provides a hint to anyone trying to tweak > the sysctl about the minimum value. I think this should stay, but that > pipe_min_size should be made const. > > -Kees > It *is* redundant, because it doesn't do anything. round_pipe_size() already rounds the value up to the minimum. Eric