* Regression in 32-bit-compat TIOCGPTPEER ioctl due to 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9
@ 2019-01-15 5:27 Robert O'Callahan
2019-01-15 7:25 ` Eric W. Biederman
0 siblings, 1 reply; 4+ messages in thread
From: Robert O'Callahan @ 2019-01-15 5:27 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: LKML
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.
Rob
--
Su ot deraeppa sah dna Rehtaf eht htiw saw hcihw, efil lanrete eht uoy
ot mialcorp ew dna, ti ot yfitset dna ti nees evah ew; deraeppa efil
eht. Efil fo Drow eht gninrecnoc mialcorp ew siht - dehcuot evah sdnah
ruo dna ta dekool evah ew hcihw, seye ruo htiw nees evah ew hcihw,
draeh evah ew hcihw, gninnigeb eht morf saw hcihw taht.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Regression in 32-bit-compat TIOCGPTPEER ioctl due to 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9
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
2019-01-15 19:36 ` Robert O'Callahan
0 siblings, 1 reply; 4+ messages in thread
From: Eric W. Biederman @ 2019-01-15 7:25 UTC (permalink / raw)
To: Robert O'Callahan; +Cc: LKML, Greg Kroah-Hartman
"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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Regression in 32-bit-compat TIOCGPTPEER ioctl due to 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9
2019-01-15 7:25 ` Eric W. Biederman
@ 2019-01-15 19:36 ` Robert O'Callahan
2019-01-17 11:46 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Robert O'Callahan @ 2019-01-15 19:36 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: LKML, Greg Kroah-Hartman
On Tue, Jan 15, 2019 at 8:25 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
> Can you confirm this fixes it for you?
Sorry --- I made a mistake. It looks like this is already fixed on
master, by commit e21120383f2dce32312f63ffca145ff8a87d41f5 (though I
don't think Al Viro knew he was fixing this bug). So, nothing to do
here.
Thanks,
Rob
--
Su ot deraeppa sah dna Rehtaf eht htiw saw hcihw, efil lanrete eht uoy
ot mialcorp ew dna, ti ot yfitset dna ti nees evah ew; deraeppa efil
eht. Efil fo Drow eht gninrecnoc mialcorp ew siht - dehcuot evah sdnah
ruo dna ta dekool evah ew hcihw, seye ruo htiw nees evah ew hcihw,
draeh evah ew hcihw, gninnigeb eht morf saw hcihw taht.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Regression in 32-bit-compat TIOCGPTPEER ioctl due to 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9
2019-01-15 19:36 ` Robert O'Callahan
@ 2019-01-17 11:46 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-17 11:46 UTC (permalink / raw)
To: Robert O'Callahan; +Cc: Eric W. Biederman, LKML
On Wed, Jan 16, 2019 at 08:36:49AM +1300, Robert O'Callahan wrote:
> On Tue, Jan 15, 2019 at 8:25 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
> > Can you confirm this fixes it for you?
>
> Sorry --- I made a mistake. It looks like this is already fixed on
> master, by commit e21120383f2dce32312f63ffca145ff8a87d41f5 (though I
> don't think Al Viro knew he was fixing this bug). So, nothing to do
> here.
As you found a regression from 4.13 - 4.19, shouldn't we backport some
fix to the 4.14 and 4.19 kernels for this?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-17 11:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-01-15 19:36 ` Robert O'Callahan
2019-01-17 11:46 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).