lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250125-posix-clock-compat-cleanup-v1-1-c8b0f377905b@weissschuh.net>
Date: Sat, 25 Jan 2025 11:20:49 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Anna-Maria Behnsen <anna-maria@...utronix.de>, 
 Frederic Weisbecker <frederic@...nel.org>, 
 Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, 
 Richard Cochran <richardcochran@...il.com>, Arnd Bergmann <arnd@...db.de>, 
 Cyrill Gorcunov <gorcunov@...il.com>, 
 Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH] posix-clock: Remove duplicate ioctl handler

The normal and compat ioctl handlers are identical,
which is fine as compat ioctls are detected and handled dynamically [0].
The duplicate definition however is unnecessary.
Just reuse the regular ioctl handler also for compat ioctls.

[0] https://lore.kernel.org/lkml/20250125-posix-clock-compat_ioctl-v2-1-11c865c500eb@weissschuh.net/

Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---
 kernel/time/posix-clock.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index 1af0bb2cc45c0aab843f77eb156992de469c8fb9..353dddea0dd0cb2b0b76b5d5c5c2e4c232006c37 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -90,26 +90,6 @@ static long posix_clock_ioctl(struct file *fp,
 	return err;
 }
 
-#ifdef CONFIG_COMPAT
-static long posix_clock_compat_ioctl(struct file *fp,
-				     unsigned int cmd, unsigned long arg)
-{
-	struct posix_clock_context *pccontext = fp->private_data;
-	struct posix_clock *clk = get_posix_clock(fp);
-	int err = -ENOTTY;
-
-	if (!clk)
-		return -ENODEV;
-
-	if (clk->ops.ioctl)
-		err = clk->ops.ioctl(pccontext, cmd, arg);
-
-	put_posix_clock(clk);
-
-	return err;
-}
-#endif
-
 static int posix_clock_open(struct inode *inode, struct file *fp)
 {
 	int err;
@@ -174,7 +154,7 @@ static const struct file_operations posix_clock_file_operations = {
 	.open		= posix_clock_open,
 	.release	= posix_clock_release,
 #ifdef CONFIG_COMPAT
-	.compat_ioctl	= posix_clock_compat_ioctl,
+	.compat_ioctl	= posix_clock_ioctl,
 #endif
 };
 

---
base-commit: b46c89c08f4146e7987fc355941a93b12e2c03ef
change-id: 20250125-posix-clock-compat-cleanup-c2b8d0aefa31

Best regards,
-- 
Thomas Weißschuh <linux@...ssschuh.net>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ