Bug 13665 - get_interfaces() return early causes segfault in winbind
Summary: get_interfaces() return early causes segfault in winbind
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.9.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Reported: 2018-10-25 18:53 UTC by David Mulder
Modified: 2018-11-06 08:15 UTC (History)
2 users (show)

See Also:

fix (1.08 KB, patch)
2018-10-25 18:53 UTC, David Mulder
no flags Details
git-am fix for 4.9.next. (1.56 KB, patch)
2018-10-31 20:06 UTC, Jeremy Allison
slow: review+

Note You need to log in before you can comment on or make changes to this bug.
Description David Mulder 2018-10-25 18:53:49 UTC
Created attachment 14543 [details]

This happens when winbind is started before an interface receives a dhcp address. getifaddrs() returns only 1 interface (lo), and get_interfaces() returns 1 total interface, but doesn't set pifaces to the found interface. This is a regression caused by da68a1b2f417ec82ea4ed3e7a4d867cef8ca8f93.

#0  0x00007f7a5909a08b in raise () from /lib64/libc.so.6
#1  0x00007f7a590834e9 in abort () from /lib64/libc.so.6
#2  0x00007f7a59b63bf3 in dump_core () from /usr/lib64/libsmbconf.so.0
#3  0x00007f7a59b54beb in smb_panic_s3 () from /usr/lib64/libsmbconf.so.0
#4  0x00007f7a5a86231f in smb_panic () from /usr/lib64/libsamba-util.so.0
#5  0x00007f7a5a862556 in ?? () from /usr/lib64/libsamba-util.so.0
#6  <signal handler called>
#7  0x00007f7a59105374 in __memmove_sse2_unaligned_erms () from /lib64/libc.so.6
#8  0x00007f7a5a860ed1 in smb_memdup () from /usr/lib64/libsamba-util.so.0
#9  0x00007f7a59b652f0 in load_interfaces () from /usr/lib64/libsmbconf.so.0
#10 0x00005634d7cc48f0 in reload_services_file (lfile=0x0) at ../source3/winbindd/winbindd.c:124
#11 0x00005634d7cc1221 in main (argc=<optimized out>, argv=<optimized out>) at ../source3/winbindd/winbindd.c:1752
Comment 1 Jeremy Allison 2018-10-31 20:06:13 UTC
Created attachment 14554 [details]
git-am fix for 4.9.next.

Cherry-picked from master.
Comment 2 Ralph Böhme 2018-10-31 20:10:47 UTC
Reassigning to Karolin for inclusion in 4.9.
Comment 3 Karolin Seeger 2018-11-01 13:00:45 UTC
(In reply to Ralph Böhme from comment #2)
Pushed to autobuild-v4-9-test.
Comment 4 Karolin Seeger 2018-11-06 08:15:09 UTC
(In reply to Karolin Seeger from comment #3)
Pushed to v4-9-test.
Closing out bug report.