From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A506C10F00 for ; Sat, 7 Mar 2020 11:00:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E10A02073C for ; Sat, 7 Mar 2020 11:00:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726109AbgCGLAK (ORCPT ); Sat, 7 Mar 2020 06:00:10 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:55794 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgCGLAK (ORCPT ); Sat, 7 Mar 2020 06:00:10 -0500 Received: from ip5f5bf7ec.dynamic.kabel-deutschland.de ([95.91.247.236] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jAXBg-0001tv-6r; Sat, 07 Mar 2020 11:00:08 +0000 Date: Sat, 7 Mar 2020 12:00:07 +0100 From: Christian Brauner To: minyard@acm.org Cc: linux-kernel@vger.kernel.org, Corey Minyard , stable@vger.kernel.org, Adrian Reber , Oleg Nesterov , Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin Subject: Re: [PATCH v2] pid: Fix error return value in some cases Message-ID: <20200307110007.fmtaaqt2udsgohtp@wittgenstein> References: <20200306172314.12232-1-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200306172314.12232-1-minyard@acm.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 06, 2020 at 11:23:14AM -0600, minyard@acm.org wrote: > From: Corey Minyard > > Recent changes to alloc_pid() allow the pid number to be specified on > the command line. If set_tid_size is set, then the code scanning the > levels will hard-set retval to -EPERM, overriding it's previous -ENOMEM > value. > > After the code scanning the levels, there are error returns that do not > set retval, assuming it is still set to -ENOMEM. > > So set retval back to -ENOMEM after scanning the levels. > > Fixes: 49cb2fc42ce4 "fork: extend clone3() to support setting a PID" > Signed-off-by: Corey Minyard > Cc: # 5.5 > Cc: Adrian Reber > Cc: Christian Brauner > Cc: Oleg Nesterov > Cc: Dmitry Safonov <0x7f454c46@gmail.com> > Cc: Andrei Vagin Thanks! I've pulled the patch now and applied. I think that restores the old behavior. If you don't mind, I'll add a comment on top of it saying something like: "ENOMEM is not the most obvious choice but it's the what we've been exposing to userspace for a long time and it's also documented behavior. So we can't easily change it to something more sensible." Acked-by: Christian Brauner