[systemd-bugs] [Bug 65382] New: src/shared/dev-setup.c is creating /dev/core symlink without checking if /proc/kcore is present

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jun 4 18:08:12 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=65382

          Priority: medium
            Bug ID: 65382
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: src/shared/dev-setup.c is creating /dev/core symlink
                    without checking if /proc/kcore is present
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: minor
    Classification: Unclassified
                OS: All
          Reporter: ssuominen at gentoo.org
          Hardware: All
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

This was filed by "Coacher" at downstream here, http://bugs.gentoo.org/472060

At the end of systemd-204/src/shared/dev-setup.c you'll find,

void dev_setup(const char *prefix) {
        const char *j, *k;

        static const char symlinks[] =
                "/proc/kcore\0"      "/dev/core\0"
                "/proc/self/fd\0"    "/dev/fd\0"
                "/proc/self/fd/0\0"  "/dev/stdin\0"
                "/proc/self/fd/1\0"  "/dev/stdout\0"
                "/proc/self/fd/2\0"  "/dev/stderr\0";

        NULSTR_FOREACH_PAIR(j, k, symlinks) {

                if (prefix) {
                        char *linkname;

                        if (asprintf(&linkname, "%s/%s", prefix, k) < 0) {
                                log_oom();
                                break;
                        }

                        symlink_and_label(j, linkname);
                        free(linkname);
                } else
                        symlink_and_label(j, k);
        }
}

Which should check if the target is present before symlinking to it if I
understood correctly.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130605/b312d3a8/attachment.html>


More information about the systemd-bugs mailing list