public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Robert O'Callahan" <robert@ocallahan.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: Regression in 32-bit-compat TIOCGPTPEER ioctl due to 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9
Date: Tue, 15 Jan 2019 01:25:03 -0600	[thread overview]
Message-ID: <87won67580.fsf@xmission.com> (raw)
In-Reply-To: <CAOp6jLa8rRw2ZQN9yWYZv_USrZw98D+U2rnk9V7M2EVY7O=VpQ@mail.gmail.com> (Robert O'Callahan's message of "Tue, 15 Jan 2019 18:27:00 +1300")

"Robert O'Callahan" <robert@ocallahan.org> writes:

> This commit refactored the implementation of TIOCGPTPEER, moving "case
> TIOCGPTPEER" from pty_unix98_ioctl() to tty_ioctl().
> pty_unix98_ioctl() is called by pty_unix98_compat_ioctl(), so before
> the commit, TIOCGPTPEER worked for 32-bit userspace. Unfortunately
> tty_compat_ioctl() does not call tty_ioctl() so after the commit,
> TIOCGPTPEER from 32-bit userspace fails with ENOTTY.
>
> Testcase in https://bugzilla.kernel.org/show_bug.cgi?id=202271.
>
> I found this bug running the rr test suite.

Can you confirm this fixes it for you?

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index bfe9ad85b362..1b0847976b28 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2815,6 +2815,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
        case TCXONC:
        case TIOCMIWAIT:
        case TIOCSERCONFIG:
+       case TIOCGPTPEER:
                return tty_ioctl(file, cmd, arg);
        }


Thank you,
Eric Biederman

  reply	other threads:[~2019-01-15  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15  5:27 Regression in 32-bit-compat TIOCGPTPEER ioctl due to 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9 Robert O'Callahan
2019-01-15  7:25 ` Eric W. Biederman [this message]
2019-01-15 19:36   ` Robert O'Callahan
2019-01-17 11:46     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87won67580.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert@ocallahan.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox