From: Greg Kroah-Hartman Date: Wed, 5 Feb 2025 08:45:52 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v6.6.76~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d40a74a0dcc38d556ee4d3c70d3223ce1349a602;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: ptp-properly-handle-compat-ioctls.patch --- diff --git a/queue-6.1/ptp-properly-handle-compat-ioctls.patch b/queue-6.1/ptp-properly-handle-compat-ioctls.patch new file mode 100644 index 0000000000..73cb12b492 --- /dev/null +++ b/queue-6.1/ptp-properly-handle-compat-ioctls.patch @@ -0,0 +1,52 @@ +From 8c29a76b76bb089095af8d29efec226a005274ca Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 25 Jan 2025 10:28:38 +0100 +Subject: ptp: Properly handle compat ioctls +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Thomas Weißschuh + +[ Upstream commit 19ae40f572a9ce1ade9954990af709a03fd37010 ] + +Pointer arguments passed to ioctls need to pass through compat_ptr() to +work correctly on s390; as explained in Documentation/driver-api/ioctl.rst. +Detect compat mode at runtime and call compat_ptr() for those commands +which do take pointer arguments. + +Suggested-by: Arnd Bergmann +Link: https://lore.kernel.org/lkml/1ba5d3a4-7931-455b-a3ce-85a968a7cb10@app.fastmail.com/ +Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.") +Signed-off-by: Thomas Weißschuh +Reviewed-by: Cyrill Gorcunov +Reviewed-by: Arnd Bergmann +Acked-by: Richard Cochran +Link: https://patch.msgid.link/20250125-posix-clock-compat_ioctl-v2-1-11c865c500eb@weissschuh.net +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ptp/ptp_chardev.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/ptp/ptp_chardev.c ++++ b/drivers/ptp/ptp_chardev.c +@@ -4,6 +4,7 @@ + * + * Copyright (C) 2010 OMICRON electronics GmbH + */ ++#include + #include + #include + #include +@@ -124,6 +125,9 @@ long ptp_ioctl(struct posix_clock *pc, u + struct timespec64 ts; + int enable, err = 0; + ++ if (in_compat_syscall() && cmd != PTP_ENABLE_PPS && cmd != PTP_ENABLE_PPS2) ++ arg = (unsigned long)compat_ptr(arg); ++ + switch (cmd) { + + case PTP_CLOCK_GETCAPS: diff --git a/queue-6.1/series b/queue-6.1/series index e65b9f269b..82b24c0e81 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -277,3 +277,4 @@ usb-gadget-f_tcm-don-t-free-command-immediately.patch staging-media-max96712-fix-kernel-oops-when-removing-module.patch media-imx-jpeg-fix-potential-error-pointer-dereference-in-detach_pm.patch btrfs-output-the-reason-for-open_ctree-failure.patch +ptp-properly-handle-compat-ioctls.patch