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-next>] [day] [month] [year] [list]
Message-ID: <AANLkTikqds12LikuGfYZN-BKGsxPAwoehXRUZo_jBqd9@mail.gmail.com>
Date:	Sun, 28 Nov 2010 21:09:03 +0100
From:	Vegard Nossum <vegard.nossum@...il.com>
To:	Al Viro <viro@...iv.linux.org.uk>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: proc: proc_self_follow_link() weirdness

Hi,

I came across this code in fs/proc/base.c:

static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
{
        struct pid_namespace *ns = dentry->d_sb->s_fs_info;
        pid_t tgid = task_tgid_nr_ns(current, ns);
        char *name = ERR_PTR(-ENOENT);
        if (tgid) {
                name = __getname();
                if (!name)
                        name = ERR_PTR(-ENOMEM);
                else
                        sprintf(name, "%d", tgid);
        }
        nd_set_link(nd, name);
        return NULL;
}

This looks a bit weird to me; it seems that nd_set_link() will get
called with name = ERR_PTR(-ENOMEM) if __getname() fails. Is this the
intended behaviour? Shouldn't it return this ERR_PTR() instead?


Vegard
--
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