Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1451410imm; Thu, 19 Jul 2018 01:44:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcIAPciSN6PmSK2QbPvT2Lwsq50W6CnOs8c0unHMiV7CTFPQC6YM8XIMuWJY3YGzydAn1vw X-Received: by 2002:a65:4107:: with SMTP id w7-v6mr8766224pgp.302.1531989892304; Thu, 19 Jul 2018 01:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531989892; cv=none; d=google.com; s=arc-20160816; b=odRVY3at++MhqPwoywYMo9BtGPmNL2zGywnDin2lc1doXhW4fV40AzbSN8QeKFEQRI i4pSWA0dZhi3N//zS8JX+iAdcZjSVbfVs0CZKLLBZdFSzEhHIITv8Q/bV5G6YIGJ6FVs PJex2EfGhRfJESV4o2UwMfBV+dqxmy1GA+FK9/H7H1Xvw52xSAu2ONOLPeBMKihY0EE0 DYPtey65J3S45m8SYRKK3f4g5iyWYRkksWVeQ5vDFRv01P76FS6F8SJfjPBPkH6mU8KZ X24Q8OeVsC/UQ2dWRCvA+v5QC4nCLMwCRwbJwGWg5p3mzV/pJ719rJ2fJd+H6LP56XdT AEkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=EkSFjcgUxnl8asIKE3cL4xQEJDYglhPXXggN7glmMEQ=; b=WlcgVOijhV2rlj0CUzPYGoRRm/bJpqqyML8/oCgRTZsexoP5Lka3fkX273xu/D9E9B 6g8u39piHtwhaUsb1fAAvfJsgMLkmqX9YpVSryS9dUtfPD5dCk8lisus4bQ255b9QvcQ ihNzzmiY6mIf85OKGfgKnIc9z0XVL4lMF4TTdfjqwBbij113LbQRC13HedmzRxLaOzzt 6/SEz3P5zlAnRXK00VnJbkr//tTreG8VHBfLFq5MXjYqjHYzJB+TEd7pUTtBqzMwS4Vi OFuba/+dldQs4B5DkCnXd4I0CCyoLXivDm05KPpXS1PJ0uT1hVqeXzkLkfdXn2zO9RR8 Hd8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mHYSWca6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1-v6si5230274pld.323.2018.07.19.01.44.37; Thu, 19 Jul 2018 01:44:52 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mHYSWca6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730684AbeGSJZ4 (ORCPT + 99 others); Thu, 19 Jul 2018 05:25:56 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34869 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727551AbeGSJZ4 (ORCPT ); Thu, 19 Jul 2018 05:25:56 -0400 Received: by mail-ed1-f66.google.com with SMTP id b10-v6so6483950edi.2 for ; Thu, 19 Jul 2018 01:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=EkSFjcgUxnl8asIKE3cL4xQEJDYglhPXXggN7glmMEQ=; b=mHYSWca6qfCqdgNPHHp6CN3Yt46xhpaFR53XMSrhx/Xa2VMbPkjn5EMoiox6hTTEAh wvZVUx5CLMe3m05Ftp+iV51QRj+aoxHKsd6eD0cED8XZBhJZEn8kRvZNtzLwZiNQP+T3 u1ypyqDHAb6V9WJ/yv4pLPx3kjZm4DNteY+YxA/qGZA5ACkP93mXKaTrlcH9BAxd0E2W fwNGWcrGvQAIwFI9vACJjwodUvg6i/TpFb8S78VvvKdfV9qBzncxhp2rjOGetEesZZSK 6qEg35TLinUXR1QEosKaRRudxjnlFFCMFW0c5WQiIB6umvVCUjz/XT9wB9c+smOsSH6x rH9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=EkSFjcgUxnl8asIKE3cL4xQEJDYglhPXXggN7glmMEQ=; b=iRZG2y/IP/lWygbByTQ7NHQBtKU2yE4gMoCqOfxViP/83nr3bTwTlxAv2yezsGnl8h JFYzR0rJXrrceMPvK/X0vVyuxt6RybIsCyDpmHTBUCBpNlcIu+VxKR0Uqn7obux1H7xG wPx/75dampZf7PXF0ApFWu5LXmIf9Sg0cteab24M9OOGoljSTV5DlRs+2176BcAZQy99 z04XWkvo2ie047iu+yQKx/gIrv9oZOwU9dNGD8YhbM5CmSZATmpIpClgErVRw3aisT5w eVVzTTu5Nfr3Uix/BIAA7pOv0GoZa3r3wngCkn5UF9fZM7mynAlUnXIF3iAm/rnB2iWO /C7A== X-Gm-Message-State: AOUpUlEq5GRkwp3gPw5x+z6aq1hF4LM+ZRSrO7tpNNVgvJTMzR26CzfY 2eGiFStLfeqZA5E6I/AMwJtM1+ph X-Received: by 2002:a50:fd93:: with SMTP id o19-v6mr9977324edt.73.1531989829841; Thu, 19 Jul 2018 01:43:49 -0700 (PDT) Received: from squirrel.local ([2001:981:5f7c:1:8e70:5aff:fe05:accc]) by smtp.gmail.com with ESMTPSA id j16-v6sm1477981edj.71.2018.07.19.01.43.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jul 2018 01:43:49 -0700 (PDT) Date: Thu, 19 Jul 2018 10:43:46 +0200 From: Matthijs van Duin To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, Aleksa Sarai , Arnd Bergmann , Eric W Biederman Subject: [PATCH] pty: fix O_CLOEXEC for TIOCGPTPEER Message-ID: <20180719084346.GA2360@squirrel.local> Mail-Followup-To: Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, Aleksa Sarai , Arnd Bergmann , Eric W Biederman MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It was being ignored because the flags were not passed to fd allocation. Fixes: 54ebbfb16034 ("tty: add TIOCGPTPEER ioctl") Signed-off-by: Matthijs van Duin --- drivers/tty/pty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index b0e2c4847a5d..678406e0948b 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -625,7 +625,7 @@ int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags) if (tty->driver != ptm_driver) return -EIO; - fd = get_unused_fd_flags(0); + fd = get_unused_fd_flags(flags); if (fd < 0) { retval = fd; goto err; -- 2.18.0