Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932765AbcDEBlf (ORCPT ); Mon, 4 Apr 2016 21:41:35 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:49974 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757072AbcDEBld (ORCPT ); Mon, 4 Apr 2016 21:41:33 -0400 From: "Eric W. Biederman" To: Linus Torvalds Cc: "H. Peter Anvin" , Peter Hurley , Greg KH , Jiri Slaby , Aurelien Jarno , Andy Lutomirski , Florian Weimer , Al Viro , Serge Hallyn , Jann Horn , "security@kernel.org" , security@ubuntu.com, security@debian.org, Willy Tarreau , Linux Kernel Mailing List , "Eric W. Biederman" Date: Mon, 4 Apr 2016 20:29:18 -0500 Message-Id: <1459819769-30387-2-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1459819769-30387-1-git-send-email-ebiederm@xmission.com> References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <1459819769-30387-1-git-send-email-ebiederm@xmission.com> X-XM-AID: U2FsdGVkX18KHuR3jRn7s69/+VUqjb7oHjj+t8g5F2c= X-SA-Exim-Connect-IP: 67.3.249.252 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 211 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 4.4 (2.1%), b_tie_ro: 3.2 (1.5%), parse: 1.14 (0.5%), extract_message_metadata: 13 (6.1%), get_uri_detail_list: 1.25 (0.6%), tests_pri_-1000: 6 (2.8%), tests_pri_-950: 1.11 (0.5%), tests_pri_-900: 0.92 (0.4%), tests_pri_-400: 17 (7.9%), check_bayes: 16 (7.5%), b_tokenize: 4.8 (2.3%), b_tok_get_all: 5 (2.4%), b_comp_prob: 1.29 (0.6%), b_tok_touch_all: 2.5 (1.2%), b_finish: 0.64 (0.3%), tests_pri_0: 159 (75.5%), check_dkim_signature: 0.62 (0.3%), check_dkim_adsp: 4.6 (2.2%), tests_pri_500: 6 (2.7%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 02/13] devpts: More obvious check for the system devpts in pty allocation X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 746 Lines: 24 This makes the logic of the test clearer, and removes a confusing use of opts.newinstance, which allows later changes not to worry if newinstance is set on the primary mount of devpts or not. Signed-off-by: "Eric W. Biederman" --- fs/devpts/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index c14d51795577..9f22c959d1f7 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -622,7 +622,7 @@ retry: mutex_lock(&allocated_ptys_lock); if (pty_count >= pty_limit - - (fsi->mount_opts.newinstance ? pty_reserve : 0)) { + ((devpts_mnt->mnt_sb == sb) ? pty_reserve : 0)) { mutex_unlock(&allocated_ptys_lock); return -ENOSPC; } -- 2.6.3