[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120419151556.GA31543@kroah.com>
Date: Thu, 19 Apr 2012 08:15:56 -0700
From: Greg KH <greg@...ah.com>
To: Carlos Chinea <carlos.chinea@...ia.com>
Cc: linux-kernel@...r.kernel.org, linus.walleij@...aro.org,
artem.bityutskiy@...ux.intel.com, shubhrajyoti@...com
Subject: Re: [PATCH 5/6] HSI: hsi_char: Remove max_data_size from sysfs
On Thu, Apr 19, 2012 at 03:05:26PM +0300, Carlos Chinea wrote:
> Remove max_data_size sysfs entry. Otherwise is possible
> to have a buffer overrun if its value is increased after
> the device is open.
>
> Signed-off-by: Carlos Chinea <carlos.chinea@...ia.com>
> ---
> drivers/hsi/clients/hsi_char.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/hsi/clients/hsi_char.c b/drivers/hsi/clients/hsi_char.c
> index 88a050d..3ad91f6 100644
> --- a/drivers/hsi/clients/hsi_char.c
> +++ b/drivers/hsi/clients/hsi_char.c
> @@ -123,7 +123,7 @@ struct hsc_client_data {
> static unsigned int hsc_major;
> /* Maximum buffer size that hsi_char will accept from userspace */
> static unsigned int max_data_size = 0x1000;
> -module_param(max_data_size, uint, S_IRUSR | S_IWUSR);
> +module_param(max_data_size, uint, 0);
You can just change this to be read-only, that way userspace can see
what the value is, and it can't be changed.
But that's up to you, not an issue at all.
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists