lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830803101401s3b12bc85l53ef67f083ad761c@mail.gmail.com>
Date:	Mon, 10 Mar 2008 14:01:33 -0700
From:	"Paul Menage" <menage@...gle.com>
To:	"Li Zefan" <lizf@...fujitsu.com>
Cc:	"Andrew Morton" <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] cgroup: switch to proc_create()

On Mon, Mar 10, 2008 at 12:30 AM, Li Zefan <lizf@...fujitsu.com> wrote:
> There is a race between create_proc_entry() and the assignment
>  of file ops. proc_create() is invented to fix it.
>
>  Signed-off-by: Li Zefan <lizf@...fujitsu.com>

Acked-by: Paul Menage <menage@...gle.com>

Doesn't seem to be a serious race since there's nothing in userspace
at this point to read the file. But replacing four lines with one is
generally a good thing.

Paul

>  ---
>   kernel/cgroup.c |    5 +----
>   1 files changed, 1 insertions(+), 4 deletions(-)
>
>  diff --git a/kernel/cgroup.c b/kernel/cgroup.c
>  index 8d833b6..8d45126 100644
>  --- a/kernel/cgroup.c
>  +++ b/kernel/cgroup.c
>  @@ -2489,7 +2489,6 @@ int __init cgroup_init(void)
>   {
>         int err;
>         int i;
>  -       struct proc_dir_entry *entry;
>
>         err = bdi_init(&cgroup_backing_dev_info);
>         if (err)
>  @@ -2505,9 +2504,7 @@ int __init cgroup_init(void)
>         if (err < 0)
>                 goto out;
>
>  -       entry = create_proc_entry("cgroups", 0, NULL);
>  -       if (entry)
>  -               entry->proc_fops = &proc_cgroupstats_operations;
>  +       proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
>
>   out:
>         if (err)
>  --
>  1.5.4.rc3
>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ