Re: [PATCH V2] Serial: core: Add compat ioctl support

From: Viken Dadhaniya
Date: Thu Feb 02 2023 - 05:15:35 EST


Hi Greg,

"Can you point us at the out-of-tree code please?"

Please refer: https://git.codelinaro.org/clo/la/kernel/msm-5.10/-/blob/KERNEL.PLATFORM.1.0.r3-01300-kernel.0/drivers/tty/serial/msm_geni_serial.c#L750

Thanks

Viken Dadhaniya


On 1/25/2023 5:54 PM, Greg KH wrote:
On Wed, Jan 25, 2023 at 05:04:18PM +0530, Viken Dadhaniya wrote:
Current serial core driver doesn't support compat_ioctl
due to which 32-bit application is not able to send
ioctls to driver on a 64-bit platform.

Added compat_ioctl support in serial core to handle
ioctls from 32-bit applications on a 64-bit platform.

Signed-off-by: Viken Dadhaniya <quic_vdadhani@xxxxxxxxxxx>
---
drivers/tty/serial/serial_core.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index b9fbbee598b8..ad4c3a5a3d29 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1601,6 +1601,12 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
return ret;
}
+static long
+uart_compat_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
+{
+ return (long)uart_ioctl(tty, cmd, arg);
How does this "fix" your out-of-tree driver at all? What command is
being sent that has this incorrect that this simple "pass through" is
going to solve?

Can you point us at the out-of-tree code please?

thanks,

greg k-h