* FAILED: patch "[PATCH] tty: fix misapplied compat_ptr() in tty_compat_ioctl()" failed to apply to 5.15-stable tree
@ 2026-11-25 11:33 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-11-25 11:33 UTC (permalink / raw)
To: jirislaby, gregkh; +Cc: stable
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 895dc0eaa2779ff46a0b2a20b5ce9eb0b1125cb2
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026112515-sinuous-decaf-4d71@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 895dc0eaa2779ff46a0b2a20b5ce9eb0b1125cb2 Mon Sep 17 00:00:00 2001
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Date: Tue, 3 Nov 2026 12:16:39 +0100
Subject: [PATCH] tty: fix misapplied compat_ptr() in tty_compat_ioctl()
Since commit f0193d3ea73b below, `cmd` was converted with compat_ptr(),
while `arg` was passed to ld->ops->ioctl() unmodified. Fix it so `cmd`
stays `cmd` and `arg` gets converted through compat_ptr() as intended.
Notes:
2) compat_ptr() did nothing to `cmd`, provided it is uint,
1) compat_ptr() is no-op everywhere (was different on s390 before
8e0b986c59c6 ("s390: Remove compat support")),
3) `arg` might not have been chopped correctly until 8e0b986c59c6. But I
am not sure why noone noticed all those (7) years (from f0193d3ea73b
to 8e0b986c59c6)?
Fixes: f0193d3ea73b ("change semantics of ldisc ->compat_ioctl()")
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: stable@vger.kernel.org # applicable from 4.20 to 6.18 incl
Assisted-by: LLM
Link: https://patch.msgid.link/63e9d84a1e8e23852423206cf3f8907aafc88f17.1793704520.git.jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 1a6c8a1bc764..150052f6d9db 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2969,8 +2969,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
if (ld->ops->compat_ioctl)
retval = ld->ops->compat_ioctl(tty, cmd, arg);
if (retval == -ENOIOCTLCMD && ld->ops->ioctl)
- retval = ld->ops->ioctl(tty, (unsigned long)compat_ptr(cmd),
- arg);
+ retval = ld->ops->ioctl(tty, cmd, (unsigned long)compat_ptr(arg));
tty_ldisc_deref(ld);
return retval;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 12:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 11:33 FAILED: patch "[PATCH] tty: fix misapplied compat_ptr() in tty_compat_ioctl()" failed to apply to 5.15-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox