linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Maier <maier@linux.ibm.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wade Mealing <wmealing@redhat.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()"
Date: Wed, 17 Jun 2020 13:05:54 +0200	[thread overview]
Message-ID: <5cde1d94-275e-2555-b13d-0b04a7a70fc7@linux.ibm.com> (raw)
In-Reply-To: <20200617103412.GA2027053@kroah.com>

On 6/17/20 12:34 PM, Greg Kroah-Hartman wrote:
> From: Wade Mealing <wmealing@redhat.com>
> 
> Turns out that the permissions for 0400 really are what we want here,
> otherwise any user can write to this file.

Minor confusion on my side:
Did you mean "read from" instead of "write to"?
I.e. only owner may read but not group nor others.
Whereas using CLASS_ATTR_RO would resolve into 0444.

> 
> [fixed formatting and made static - gregkh]
> 
> Reported-by: Wade Mealing <wmealing@redhat.com>
> Cc: stable <stable@vger.kernel.org>
> Fixes: f40609d1591f ("zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()")
> Link: https://bugzilla.redhat.com/show_bug.cgi?id=1847832
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>   drivers/block/zram/zram_drv.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 6e2ad90b17a3..270dd810be54 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -2021,7 +2021,8 @@ static ssize_t hot_add_show(struct class *class,
>   		return ret;
>   	return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
>   }
> -static CLASS_ATTR_RO(hot_add);
> +static struct class_attribute class_attr_hot_add =
> +	__ATTR(hot_add, 0400, hot_add_show, NULL);
> 
>   static ssize_t hot_remove_store(struct class *class,
>   			struct class_attribute *attr,
> 


-- 
Mit freundlichen Gruessen / Kind regards
Steffen Maier

Linux on IBM Z Development

https://www.ibm.com/privacy/us/en/
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

  reply	other threads:[~2020-06-17 11:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 10:34 [PATCH] Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()" Greg Kroah-Hartman
2020-06-17 11:05 ` Steffen Maier [this message]
2020-06-17 11:36   ` Greg Kroah-Hartman
2020-06-17 11:49 ` [PATCH v2] " Greg Kroah-Hartman
2020-06-18 17:13   ` Steffen Maier
2020-06-23  7:03   ` Minchan Kim
2020-06-17 12:31 ` [PATCH] " Willy Tarreau
2020-06-17 12:32   ` Willy Tarreau

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=5cde1d94-275e-2555-b13d-0b04a7a70fc7@linux.ibm.com \
    --to=maier@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=wmealing@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).