From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933863AbcI2PFa (ORCPT ); Thu, 29 Sep 2016 11:05:30 -0400 Received: from smtprelay0091.hostedemail.com ([216.40.44.91]:46937 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932280AbcI2PFY (ORCPT ); Thu, 29 Sep 2016 11:05:24 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3868:3870:3871:3872:3874:4250:4321:5007:6119:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12438:12740:12760:13069:13141:13230:13311:13357:13439:14096:14097:14659:14721:21080:21094:21323:30012:30051:30054:30064:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: vase43_4ad9e1353b74e X-Filterd-Recvd-Size: 1982 Message-ID: <1475160742.2027.2.camel@perches.com> Subject: Re: [PATCH v2 2/8] pipe: move limit checking logic into pipe_set_size() From: Joe Perches To: Vegard Nossum , "Michael Kerrisk (man-pages)" , Andrew Morton Cc: Willy Tarreau , socketpair@gmail.com, Tetsuo Handa , Jens Axboe , Al Viro , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1e7bdfb3-0772-c152-8da1-3d22b56682b3@oracle.com> References: <3701b2c5-2c52-2c3e-226d-29b9deb29b50@gmail.com> <1e7bdfb3-0772-c152-8da1-3d22b56682b3@oracle.com> Content-Type: text/plain; charset="ISO-8859-1" Date: Thu, 29 Sep 2016 07:52:22 -0700 Mime-Version: 1.0 X-Mailer: Evolution 3.21.91-1ubuntu1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-09-29 at 13:26 +0200, Vegard Nossum wrote: > On 08/29/2016 02:21 AM, Michael Kerrisk (man-pages) wrote: > > This is a preparatory patch for following work. Move the F_SETPIPE_SZ > > limit-checking logic from pipe_fcntl() into pipe_set_size(). This > > simplifies the code a little, and allows for reworking required in > > a later patch that fixes the limit checking in pipe_set_size() > > > + if ((too_many_pipe_buffers_hard(pipe->user) || > > + too_many_pipe_buffers_soft(pipe->user)) && > > + capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN)) > > + return -EPERM; > Some might say the indentation is off here. Not sure why checkpatch > didn't care. Parenthesis alignment is a CHECK not a WARNING. It's only reported with --strict or if the code is in drivers/staging, net/, or drivers/net/