Skip to content
This repository has been archived by the owner. It is now read-only.

systemd-sysusers segmentation fault #1394

Closed
crawford opened this issue Jun 8, 2016 · 4 comments
Closed

systemd-sysusers segmentation fault #1394

crawford opened this issue Jun 8, 2016 · 4 comments

Comments

@crawford
Copy link
Member

@crawford crawford commented Jun 8, 2016

Issue Report

Bug

As reported by scole-scea on IRC, systemd-sysusers crashes, preventing the creation of the fleet user and group.

CoreOS Version

1010.5.0

Expected Behavior

systemd-sysusers runs and creates the fleet user and group.

Actual Behavior

systemd-sysusers segfaults, yielding a core dump

@mhenniges
Copy link

@mhenniges mhenniges commented Jun 10, 2016

Let me know if you need help repro-ing this issue, I have several machines available were this segfault happens every time systemd-sysusers is run.

@mhenniges
Copy link

@mhenniges mhenniges commented Jun 13, 2016

I've spent a little time trying to isolate this, and it seems the segfault (at least it my case) is caused by long entries in /etc/gshadow.

With this example entry in gshadow, systemd-sysusers does not segfault. Add 1 more character to it and it segfaults every time.

sudo:*::somebody.a1,somebody.a2,somebody.a3,somebody.a4,somebody.a5,somebody.a6,somebody.a7,somebody.a8,somebody.a9,somebody.a10,somebody.a11,somebody.a12,somebody.a13,somebody.a14,somebody.a15,somebody.a16,somebody.a17,somebody.a18,somebody.a19,somebody.a20,somebody.a21,somebody.a22,somebody.a23,somebody.a24,somebody.a25,somebody.a26,somebody.a27,somebody.a28,somebody.a29,somebody.a30,somebody.a31,somebody.a32,somebody.a33,somebody.a34,somebody.a35,somebody.a36,somebody.a37,somebody.a38,somebody.a39,somebody.a40,somebody.a41,somebody.a42,somebody.a43,somebody.a44,somebody.a45,somebody.a46,somebody.a47,a123

Long entries in /etc/group do not seem to have the same effects.

@dylancarlson
Copy link

@dylancarlson dylancarlson commented Jun 15, 2016

@mhenniges Working on it, thanks for reporting. We've repro'd the issue easily. 615+ chars triggers it. We'll update when we have more.

#0 0x00007f62c4549266 in _IO_vfprintf_internal (s=, format=, ap=ap@entry=0x7fffd60f58f8) at vfprintf.c:1642
#1 0x00007f62c4550460 in __fprintf (stream=stream@entry=0x560a21994ff0, format=format@entry=0x7f62c4677b1c "%s%s") at fprintf.c:32
#2 0x00007f62c45f972e in putsgent (g=, stream=0x560a21994ff0) at putsgent.c:57
#3 0x0000560a1fc035dc in putsgent_with_members (sg=0x7f62c48aaac0 , gshadow=0x560a21994ff0)
at ../systemd-229/src/sysusers/sysusers.c:338
#4 0x0000560a1fc06103 in write_files () at ../systemd-229/src/sysusers/sysusers.c:490
#5 0x0000560a1fc024eb in main (argc=, argv=) at ../systemd-229/src/sysusers/sysusers.c:1891

https://github.com/systemd/systemd/blob/v229/src/sysusers/sysusers.c

@crawford crawford modified the milestone: CoreOS 1096.0.0 Jun 20, 2016
@dm0- dm0- self-assigned this Jun 22, 2016
crawford added a commit to crawford/coreos-overlay that referenced this issue Jun 28, 2016
dm0- added a commit to coreos/coreos-overlay that referenced this issue Jun 29, 2016
dm0- added a commit to coreos/mantle that referenced this issue Jul 5, 2016
Add a test for coreos/bugs#1394.
crawford added a commit to crawford/coreos-overlay that referenced this issue Jul 11, 2016
mischief added a commit to mischief/coreos-overlay that referenced this issue Jul 13, 2016
@scole-scea
Copy link

@scole-scea scole-scea commented Jul 13, 2016

Hey, wow, I didn't even realize this bug had been created based on my report. Thanks for speeding this into the stable build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants