Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751808Ab0DJQZ5 (ORCPT ); Sat, 10 Apr 2010 12:25:57 -0400 Received: from waste.org ([173.11.57.241]:58671 "EHLO waste.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062Ab0DJQZ4 (ORCPT ); Sat, 10 Apr 2010 12:25:56 -0400 Subject: Re: [PATCH] random: Forbid llseek on random chardev From: Matt Mackall To: Frederic Weisbecker Cc: Andrew Morton , LKML , Arnd Bergmann In-Reply-To: <1270909064-7845-1-git-send-regression-fweisbec@gmail.com> References: <1270909064-7845-1-git-send-regression-fweisbec@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Sat, 10 Apr 2010 11:25:50 -0500 Message-ID: <1270916750.28124.23.camel@calx> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1709 Lines: 53 On Sat, 2010-04-10 at 16:17 +0200, Frederic Weisbecker wrote: > From: Arnd Bergmann > > 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 > Cc: Matt Mackall > Cc: Andrew Morton > Signed-off-by: Frederic Weisbecker > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/