Bug 855863 - systemd: unit_name_replace_instance invalid pointer use
Summary: systemd: unit_name_replace_instance invalid pointer use
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 855861
TreeView+ depends on / blocked
 
Reported: 2012-09-10 13:11 UTC by Florian Weimer
Modified: 2012-10-12 16:46 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-07 22:42:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2012-09-10 13:11:27 UTC
In the unit_name_replace_instance function in the src/shared/unit-name.c file, the pointer variable p is checked against NULL after it is used in a pointer difference.  This triggers undefined behavior.  In addition, the else branch of the if statement refers to the (meaningless) pointer difference:

        p = strchr(f, '@');
        ...
        a = p - f;
        if (p) {
            ...
        } else {
                r = new(char, a + strlen(e) + 1);

Comment 1 Lennart Poettering 2012-09-12 02:47:31 UTC
Fixed in git.

Comment 2 Fedora Update System 2012-09-20 19:54:15 UTC
systemd-190-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/systemd-190-1.fc18

Comment 3 Fedora Update System 2012-09-22 06:35:27 UTC
Package systemd-191-2.fc18, rtkit-0.11-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-191-2.fc18 rtkit-0.11-3.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/rtkit-0.11-3.fc18,systemd-191-2.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-09-28 00:15:54 UTC
Package glibc-2.16-17.fc18, systemd-192-1.fc18, selinux-policy-3.11.1-23.fc18, rtkit-0.11-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.16-17.fc18 systemd-192-1.fc18 selinux-policy-3.11.1-23.fc18 rtkit-0.11-3.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/selinux-policy-3.11.1-23.fc18,rtkit-0.11-3.fc18,systemd-192-1.fc18,glibc-2.16-17.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2012-10-01 20:07:29 UTC
Package glibc-2.16-17.fc18, rtkit-0.11-3.fc18, systemd-193-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.16-17.fc18 rtkit-0.11-3.fc18 systemd-193-1.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/rtkit-0.11-3.fc18,systemd-193-1.fc18,glibc-2.16-17.fc18
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-10-12 16:46:59 UTC
systemd-44-20.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/systemd-44-20.fc17


Note You need to log in before you can comment on or make changes to this bug.