All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] random: don't forget compat_ioctl on unrandom
@ 2019-12-17 17:24 Jason A. Donenfeld
  2019-12-17 17:39 ` Jason A. Donenfeld
  2019-12-17 19:36 ` Arnd Bergmann
  0 siblings, 2 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2019-12-17 17:24 UTC (permalink / raw)
  To: linux-kernel, arnd; +Cc: Jason A. Donenfeld, Greg Kroah-Hartman

Recently, there's been some compat ioctl cleanup, in which large
hardcoded lists were replaced with compat_ptr_ioctl. One of these
changes involved removing the random.c hardcoded list entries and adding
a compat ioctl function pointer to the random.c fops. In the process,
urandom was forgotten about, so this commit fixes that oversight.

Fixes: 507e4e2b430b ("compat_ioctl: remove /dev/random commands")
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/char/random.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 909e0c3d82ea..cda12933a17d 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -2175,6 +2175,7 @@ const struct file_operations urandom_fops = {
 	.read  = urandom_read,
 	.write = random_write,
 	.unlocked_ioctl = random_ioctl,
+	.compat_ioctl = compat_ptr_ioctl,
 	.fasync = random_fasync,
 	.llseek = noop_llseek,
 };
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] random: don't forget compat_ioctl on unrandom
  2019-12-17 17:24 [PATCH] random: don't forget compat_ioctl on unrandom Jason A. Donenfeld
@ 2019-12-17 17:39 ` Jason A. Donenfeld
  2019-12-17 19:36 ` Arnd Bergmann
  1 sibling, 0 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2019-12-17 17:39 UTC (permalink / raw)
  To: LKML, Arnd Bergmann; +Cc: Greg Kroah-Hartman

Ooof, typing too fast. "unrandom" in the subject should be "urandom", of course.

On Tue, Dec 17, 2019 at 6:25 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> Recently, there's been some compat ioctl cleanup, in which large
> hardcoded lists were replaced with compat_ptr_ioctl. One of these
> changes involved removing the random.c hardcoded list entries and adding
> a compat ioctl function pointer to the random.c fops. In the process,
> urandom was forgotten about, so this commit fixes that oversight.
>
> Fixes: 507e4e2b430b ("compat_ioctl: remove /dev/random commands")
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  drivers/char/random.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index 909e0c3d82ea..cda12933a17d 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -2175,6 +2175,7 @@ const struct file_operations urandom_fops = {
>         .read  = urandom_read,
>         .write = random_write,
>         .unlocked_ioctl = random_ioctl,
> +       .compat_ioctl = compat_ptr_ioctl,
>         .fasync = random_fasync,
>         .llseek = noop_llseek,
>  };
> --
> 2.24.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] random: don't forget compat_ioctl on unrandom
  2019-12-17 17:24 [PATCH] random: don't forget compat_ioctl on unrandom Jason A. Donenfeld
  2019-12-17 17:39 ` Jason A. Donenfeld
@ 2019-12-17 19:36 ` Arnd Bergmann
  2019-12-17 19:56   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2019-12-17 19:36 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: linux-kernel, Greg Kroah-Hartman

On Tue, Dec 17, 2019 at 6:25 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> Recently, there's been some compat ioctl cleanup, in which large
> hardcoded lists were replaced with compat_ptr_ioctl. One of these
> changes involved removing the random.c hardcoded list entries and adding
> a compat ioctl function pointer to the random.c fops. In the process,
> urandom was forgotten about, so this commit fixes that oversight.
>
> Fixes: 507e4e2b430b ("compat_ioctl: remove /dev/random commands")
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Thanks for debugging this. I had already sent the same
patch a few days ago after the first report:

https://lore.kernel.org/lkml/20191207185837.4030699-1-arnd@arndb.de/

Greg, can you please apply one of these and send it to Linus for 5.5-rc3?

     Arnd

> ---
>  drivers/char/random.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index 909e0c3d82ea..cda12933a17d 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -2175,6 +2175,7 @@ const struct file_operations urandom_fops = {
>         .read  = urandom_read,
>         .write = random_write,
>         .unlocked_ioctl = random_ioctl,
> +       .compat_ioctl = compat_ptr_ioctl,
>         .fasync = random_fasync,
>         .llseek = noop_llseek,
>  };
> --
> 2.24.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] random: don't forget compat_ioctl on unrandom
  2019-12-17 19:36 ` Arnd Bergmann
@ 2019-12-17 19:56   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-12-17 19:56 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Jason A. Donenfeld, linux-kernel

On Tue, Dec 17, 2019 at 08:36:48PM +0100, Arnd Bergmann wrote:
> On Tue, Dec 17, 2019 at 6:25 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> >
> > Recently, there's been some compat ioctl cleanup, in which large
> > hardcoded lists were replaced with compat_ptr_ioctl. One of these
> > changes involved removing the random.c hardcoded list entries and adding
> > a compat ioctl function pointer to the random.c fops. In the process,
> > urandom was forgotten about, so this commit fixes that oversight.
> >
> > Fixes: 507e4e2b430b ("compat_ioctl: remove /dev/random commands")
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> 
> Thanks for debugging this. I had already sent the same
> patch a few days ago after the first report:
> 
> https://lore.kernel.org/lkml/20191207185837.4030699-1-arnd@arndb.de/
> 
> Greg, can you please apply one of these and send it to Linus for 5.5-rc3?

Ugh, I missed your first one, sorry, I thought that was for Ted and
missed that it was due to a patch that came from my tree.  I've queued
Jason's patch up now.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-17 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 17:24 [PATCH] random: don't forget compat_ioctl on unrandom Jason A. Donenfeld
2019-12-17 17:39 ` Jason A. Donenfeld
2019-12-17 19:36 ` Arnd Bergmann
2019-12-17 19:56   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.