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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y6Pv5WWtM63DwCAl@kroah.com>
Date:   Thu, 22 Dec 2022 06:49:25 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Viken Dadhaniya <quic_vdadhani@...cinc.com>
Cc:     jirislaby@...nel.org, linux-serial@...r.kernel.org,
        linux-kernel@...r.kernel.org, quic_msavaliy@...cinc.com,
        quic_vnivarth@...cinc.com, quic_vtanuku@...cinc.com,
        quic_arandive@...cinc.com
Subject: Re: [PATCH V1 1/1] Serial: core: Add compat ioctl support

On Thu, Dec 22, 2022 at 10:19:25AM +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.

Are you sure?

> 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@...cinc.com>
> ---
>  drivers/tty/serial/serial_core.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index b9fbbee598b8..5ffa0798db3b 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1601,6 +1601,22 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
>  	return ret;
>  }
>  
> +/**
> + * uart_compat_ioctl: uart compat IOCTL function.
> + * @tty: pointer to tty structure.
> + * @cmd: command code passed by user-space.
> + * @arg: argument  passed by user-space.
> + *
> + * This function will call normal uart IOCTL.
> + *
> + * Return: 0 for success, Negative number for error condition.

Why create kernel doc for a static function?  uart_ioctl() does not have
this, right?

> + */
> +static long
> +uart_compat_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
> +{
> +	return (long)uart_ioctl(tty, cmd, arg);
> +};

Really?  Why has this never shown up before as an issue?

How was this tested?  What is currently broken that now works properly
(or the other way around?)

This patch implies that _every_ driver with an ioctl must create a
compat_ioctl() callback, are you sure that is the case?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ