lkml.org 
[lkml]   [2010]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] random: Forbid llseek on random chardev
From
Date
On Sat, 2010-04-10 at 16:17 +0200, Frederic Weisbecker wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Seeking on /dev/random and /dev/urandom is pointless.

It is indeed pointless, though that doesn't mean no one does it.
Forbidding a no-op seems a rather unfriendly way to fix this.

> Using generic_file_llseek means we no longer need to
> take the BKL if anyone tries to seek on these.

Comment doesn't match the patch?

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> drivers/char/random.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index 2fd3d39..513c685 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -1169,6 +1169,7 @@ const struct file_operations random_fops = {
> .poll = random_poll,
> .unlocked_ioctl = random_ioctl,
> .fasync = random_fasync,
> + .open = nonseekable_open,
> };
>
> const struct file_operations urandom_fops = {
> @@ -1176,6 +1177,7 @@ const struct file_operations urandom_fops = {
> .write = random_write,
> .unlocked_ioctl = random_ioctl,
> .fasync = random_fasync,
> + .open = nonseekable_open,
> };
>
> /***************************************************************



--
http://selenic.com : development and support for Mercurial and Linux




\
 
 \ /
  Last update: 2010-04-10 18:29    [W:0.094 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site