From: Greg KH <gregkh@linuxfoundation.org>
To: Viken Dadhaniya <quic_vdadhani@quicinc.com>
Cc: jirislaby@kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org, quic_msavaliy@quicinc.com,
quic_vnivarth@quicinc.com, quic_vtanuku@quicinc.com,
quic_arandive@quicinc.com
Subject: Re: [PATCH V1 1/1] Serial: core: Add compat ioctl support
Date: Thu, 22 Dec 2022 06:49:25 +0100 [thread overview]
Message-ID: <Y6Pv5WWtM63DwCAl@kroah.com> (raw)
In-Reply-To: <20221222044925.27846-1-quic_vdadhani@quicinc.com>
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@quicinc.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
next prev parent reply other threads:[~2022-12-22 5:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 4:49 [PATCH V1 1/1] Serial: core: Add compat ioctl support Viken Dadhaniya
2022-12-22 5:49 ` Greg KH [this message]
2023-01-25 11:27 ` Viken Dadhaniya
2023-01-25 12:22 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y6Pv5WWtM63DwCAl@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=quic_arandive@quicinc.com \
--cc=quic_msavaliy@quicinc.com \
--cc=quic_vdadhani@quicinc.com \
--cc=quic_vnivarth@quicinc.com \
--cc=quic_vtanuku@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox