public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: green@linuxhacker.ru
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] acpi/ec: Deny write access unless requested by module param
Date: Wed, 17 Feb 2016 15:27:31 +0100	[thread overview]
Message-ID: <2729982.5vh6UKHT1H@skinner> (raw)
In-Reply-To: <1454742488-2231898-1-git-send-email-green@linuxhacker.ru>

On Saturday, February 06, 2016 02:08:08 AM green@linuxhacker.ru wrote:
> From: Oleg Drokin <green@linuxhacker.ru>
> 
> In debugfs it's not enough to just set file mode to read-only to
> deny write access to a file, instead just don't provide
> the write method unless write access is really requested.
> 
> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Thomas Renninger <trenn@suse.com>

Thanks!

> ---
> I assume allowing run-time changes via /sys/module is preferrable,
> opposed to forced module unload and reload to change this option,
> but I can submit another patch to only depend on the module parameter
> too, please let me know.
> 
>  drivers/acpi/ec_sys.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
> index bea8e42..6c7dd7a 100644
> --- a/drivers/acpi/ec_sys.c
> +++ b/drivers/acpi/ec_sys.c
> @@ -73,6 +73,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char
> __user *buf, loff_t init_off = *off;
>  	int err = 0;
> 
> +	if (!write_support)
> +		return -EINVAL;
> +
>  	if (*off >= EC_SPACE_SIZE)
>  		return 0;
>  	if (*off + count >= EC_SPACE_SIZE) {


  reply	other threads:[~2016-02-17 14:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06  7:08 [PATCH] acpi/ec: Deny write access unless requested by module param green
2016-02-17 14:27 ` Thomas Renninger [this message]
2016-03-10 23:32 ` Rafael J. Wysocki

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=2729982.5vh6UKHT1H@skinner \
    --to=trenn@suse.de \
    --cc=green@linuxhacker.ru \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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