Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751550AbdINQ5S (ORCPT ); Thu, 14 Sep 2017 12:57:18 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38247 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484AbdINQ5Q (ORCPT ); Thu, 14 Sep 2017 12:57:16 -0400 Subject: Re: [PATCH RFC 0/3] A few round_pipe_size() and pipe-max-size fixups To: mtk.manpages@gmail.com, Joe Lawrence Cc: lkml , "linux-fsdevel@vger.kernel.org" , Alexander Viro , "Luis R. Rodriguez" , Kees Cook , Mikulas Patocka References: <1504622676-2992-1-git-send-email-joe.lawrence@redhat.com> From: Randy Dunlap Message-ID: <201487e9-235c-8604-50f2-02bd1170d8e8@infradead.org> Date: Thu, 14 Sep 2017 09:57:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 892 Lines: 28 On 09/14/17 06:26, Michael Kerrisk (man-pages) wrote: > Hello Joe, > > On 5 September 2017 at 16:44, Joe Lawrence wrote: >> While backporting Michael's "pipe: fix limit handling" [1] patchset to a >> distro-kernel, Mikulas noticed that current upstream pipe limit handling >> contains a few problems: >> >> 1 - round_pipe_size() nr_pages overflow on 32bit: this would >> subsequently try roundup_pow_of_two(0), which is undefined. Hi, Sorry I missed the initial posting of this. The man page for F_SETPIPE_SZ (http://man7.org/linux/man-pages/man2/fcntl.2.html) says: "Attempts to set the pipe capacity below the page size are silently rounded up to the page size." That implies to me that setting pipe size to 0 would round up to PAGE_SIZE. Doesn't patch 1/3 change that to return -EINVAL? Otherwise all 3 patches look good to me. thanks, -- ~Randy