Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp479447ybh; Sat, 7 Mar 2020 03:00:43 -0800 (PST) X-Google-Smtp-Source: ADFU+vsWV4CY54bLmXz6CnPSX0uK3inTg9qYqpA5q5onXL8ybPytM7pAxdqxOM/dYMXKP//eZSOC X-Received: by 2002:a05:6830:10da:: with SMTP id z26mr5706503oto.27.1583578843593; Sat, 07 Mar 2020 03:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583578843; cv=none; d=google.com; s=arc-20160816; b=lKaMOeIHUf9bbweqBGsFHHx+seTmSmhaRhZ/8MXtDW5HXpNvlcuktLLC8iGkpkq/i8 WAlItmxADG336vrRFZf7SstzR5vZiLKhNFIQAB4xlC6D7r0CX8t476u0TtxosmVUspu/ pAl6j9EYGlb4aOKL1ybXy6qWU7Ns23xhTqQWdeIGFgdYMvgqMG4pt1uHlwXHpNQsmfcC 6f6aIQWzvnwjsQzZSsaqpdqeGv8tZZooY/FH8W0wo/PoO5VT8qLrAeC6KVQjv71UrSeM AQS4d197oSjVSs02F1sZ0XeOj3i6jg6DHWGmH+UREpQjB+Km9xO9XEPOCXV8W7F/MVEd iFqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7+pYR46TLS3VvZdXUZM3jqgDHrOzV7fZhKbnldX7blM=; b=UsFd8RBPgGcHxD352lGsXdX18PPy6ZTk+PGlQ7SsTlIYMuS68+A2/jjcFmN0TrOL+3 CGdIsZa563EcLp93XvmLJZdeycPxEmGzcYlldxz3xLDO6r7IaX/7oVIjLcZKojWGFTRE Zr9EoYEzBLpI32l6VDqun2o8QJCuvqXhwSFL4AF5bKsP/e7jnZ3M5cgC/jZL9dGzRsZB 1EpYlIVAdroMMTVHP3C9ywZiUHqtUS0Vl+QUj2TuINRd6wlagnu477BsCWIEJ5ZeIb26 S7cYpAkKvkGe7M/5cDkb0rSeFyF8SxXFBB5N1DTaPLEShIrdrGmhNuROjp5fQWHIkPqJ EbvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si3113526otd.209.2020.03.07.03.00.29; Sat, 07 Mar 2020 03:00:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726086AbgCGLAK (ORCPT + 99 others); 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