From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rajat Jain <rajatja@google.com>
Cc: linux-kernel@vger.kernel.org, rajatxjain@gmail.com
Subject: Re: [PATCH v2] sysfs: Fix internal_create_group() for named group updates
Date: Sat, 16 Jun 2018 10:37:40 +0200 [thread overview]
Message-ID: <20180616083740.GA23039@kroah.com> (raw)
In-Reply-To: <20180616081837.62730-1-rajatja@google.com>
On Sat, Jun 16, 2018 at 01:18:37AM -0700, Rajat Jain wrote:
> There are a couple of problems with named group updates in the code
> today:
>
> * sysfs_update_group() will always fail for a named group, because
> internal_create_group() will try to create a new sysfs directory
> unconditionally, which will ofcourse fail with -EEXIST.
>
> * We can leak the kernfs_node for grp->name if some one tries to:
> - rename a group (change grp->name), or
> - update a named group, to an unnamed group
>
> It appears that the whole purpose of sysfs_update_group() was to
> allow changing the permissions or visibility of attributes and not
> the names. So make it clear in the comments, and allow it to update
> an existing named group.
>
> Signed-off-by: Rajat Jain <rajatja@google.com>
> ---
> v2: Use pr_warn() instead of WARN()
Looks good, I'll queue it up after 4.18-rc1 is out, thanks for the
update so quickly.
greg k-h
next prev parent reply other threads:[~2018-06-16 8:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-16 1:29 [PATCH] sysfs: Fix internal_create_group() for named group updates Rajat Jain
2018-06-16 7:11 ` Greg Kroah-Hartman
2018-06-16 8:09 ` Rajat Jain
2018-06-16 8:18 ` [PATCH v2] " Rajat Jain
2018-06-16 8:37 ` Greg Kroah-Hartman [this message]
2018-06-16 17:49 ` [PATCH v3] " Rajat Jain
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=20180616083740.GA23039@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rajatja@google.com \
--cc=rajatxjain@gmail.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