* cgroup dentry insufficiently initialized prior to calling d_instantiate.
@ 2013-05-10 22:02 Casey Schaufler
[not found] ` <518D6E7C.9050204-iSGtlc1asvQWG2LlvL+J4A@public.gmane.org>
2013-05-14 10:47 ` Li Zefan
0 siblings, 2 replies; 3+ messages in thread
From: Casey Schaufler @ 2013-05-10 22:02 UTC (permalink / raw)
To: tj-DgEjT+Ai2ygdnm+yROfE0A, lizefan-hv44wF8Li93QT0dZR+AlfA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
cgroups-u79uwXL29TY76Z2rM5mHXA, lkml-u79uwXL29TY76Z2rM5mHXA, LSM
Cc: Casey Schaufler
In kernel/cgroup.c in cgroup_add_file() we have:
dentry = lookup_one_len(name, dir, strlen(name));
if (IS_ERR(dentry)) {
error = PTR_ERR(dentry);
goto out;
}
mode = cgroup_file_mode(cft);
error = cgroup_create_file(dentry, mode | S_IFREG, cgrp->root->sb);
if (!error) {
cfe->type = (void *)cft;
cfe->dentry = dentry;
dentry->d_fsdata = cfe;
simple_xattrs_init(&cfe->xattrs);
list_add_tail(&cfe->node, &parent->files);
cfe = NULL;
}
dput(dentry);
cgroup_create_file() calls d_instantiate, which may
decide to look at the xattrs on the file. Smack always
does this and SELinux can be configured to do so, although
no one seems to be using that option. Since the dentry
has not been initialized panics in __d_xattr ensue. See
bugzilla 57791.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: cgroup dentry insufficiently initialized prior to calling d_instantiate.
2013-05-10 22:02 cgroup dentry insufficiently initialized prior to calling d_instantiate Casey Schaufler
[not found] ` <518D6E7C.9050204-iSGtlc1asvQWG2LlvL+J4A@public.gmane.org>
@ 2013-05-14 10:47 ` Li Zefan
1 sibling, 0 replies; 3+ messages in thread
From: Li Zefan @ 2013-05-14 10:47 UTC (permalink / raw)
To: Casey Schaufler; +Cc: tj, containers, cgroups, lkml, LSM
On 2013/5/11 6:02, Casey Schaufler wrote:
>
> In kernel/cgroup.c in cgroup_add_file() we have:
>
>
> dentry = lookup_one_len(name, dir, strlen(name));
> if (IS_ERR(dentry)) {
> error = PTR_ERR(dentry);
> goto out;
> }
>
> mode = cgroup_file_mode(cft);
> error = cgroup_create_file(dentry, mode | S_IFREG, cgrp->root->sb);
> if (!error) {
> cfe->type = (void *)cft;
> cfe->dentry = dentry;
> dentry->d_fsdata = cfe;
> simple_xattrs_init(&cfe->xattrs);
> list_add_tail(&cfe->node, &parent->files);
> cfe = NULL;
> }
> dput(dentry);
>
> cgroup_create_file() calls d_instantiate, which may
> decide to look at the xattrs on the file. Smack always
> does this and SELinux can be configured to do so, although
> no one seems to be using that option. Since the dentry
> has not been initialized panics in __d_xattr ensue. See
> bugzilla 57791.
>
cgroup_add_file() should initialize xattrs before calling d_instantiate(),
just like cgroup_create() does.
I'll prepare a patch to fix it. Thanks for the report!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: cgroup dentry insufficiently initialized prior to calling d_instantiate.
[not found] ` <518D6E7C.9050204-iSGtlc1asvQWG2LlvL+J4A@public.gmane.org>
@ 2013-05-14 10:47 ` Li Zefan
0 siblings, 0 replies; 3+ messages in thread
From: Li Zefan @ 2013-05-14 10:47 UTC (permalink / raw)
To: Casey Schaufler
Cc: tj-DgEjT+Ai2ygdnm+yROfE0A, cgroups-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
lkml-u79uwXL29TY76Z2rM5mHXA, LSM
On 2013/5/11 6:02, Casey Schaufler wrote:
>
> In kernel/cgroup.c in cgroup_add_file() we have:
>
>
> dentry = lookup_one_len(name, dir, strlen(name));
> if (IS_ERR(dentry)) {
> error = PTR_ERR(dentry);
> goto out;
> }
>
> mode = cgroup_file_mode(cft);
> error = cgroup_create_file(dentry, mode | S_IFREG, cgrp->root->sb);
> if (!error) {
> cfe->type = (void *)cft;
> cfe->dentry = dentry;
> dentry->d_fsdata = cfe;
> simple_xattrs_init(&cfe->xattrs);
> list_add_tail(&cfe->node, &parent->files);
> cfe = NULL;
> }
> dput(dentry);
>
> cgroup_create_file() calls d_instantiate, which may
> decide to look at the xattrs on the file. Smack always
> does this and SELinux can be configured to do so, although
> no one seems to be using that option. Since the dentry
> has not been initialized panics in __d_xattr ensue. See
> bugzilla 57791.
>
cgroup_add_file() should initialize xattrs before calling d_instantiate(),
just like cgroup_create() does.
I'll prepare a patch to fix it. Thanks for the report!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-14 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-10 22:02 cgroup dentry insufficiently initialized prior to calling d_instantiate Casey Schaufler
[not found] ` <518D6E7C.9050204-iSGtlc1asvQWG2LlvL+J4A@public.gmane.org>
2013-05-14 10:47 ` Li Zefan
2013-05-14 10:47 ` Li Zefan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.