Bug 15223 - samba-bgqd daemon unexpectedly terminates with SIGABRT
Summary: samba-bgqd daemon unexpectedly terminates with SIGABRT
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Printing (show other bugs)
Version: 4.15.10
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: printing-maintainers
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 13:40 UTC by David Mulder
Modified: 2022-11-02 15:26 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Mulder 2022-11-02 13:40:08 UTC
After installing the backported patch for Bug 15103 in 4.15, folks are encountering a SIGABRT in samba-bgqd. The gnutls version is 3.4.17.

[2022/10/21 15:55:13, 0] ../../lib/util/become_daemon.c:150(daemon_status)
daemon_status: daemon 'samba-bgqd' : Starting process ...
[2022/10/21 15:56:03, 0] ../../lib/util/fault.c:172(smb_panic_log)
===============================================================
[2022/10/21 15:56:03, 0] ../../lib/util/fault.c:176(smb_panic_log)
INTERNAL ERROR: ../../lib/util/genrand.c:53:generate_random_buffer: GnuTLS could not generate a random buffer: GNUTLS_E_RANDOM_DEVICE_ERROR [-342]
in pid 86143 (4.15.8-git.473.1a1018e0a0b3.71.2-SUSE-SLE_12-x86_64)
[2022/10/21 15:56:03, 0] ../../lib/util/fault.c:181(smb_panic_log)
If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug,
see https://wiki.samba.org/index.php/Bug_Reporting
[2022/10/21 15:56:03, 0] ../../lib/util/fault.c:182(smb_panic_log)
===============================================================
[2022/10/21 15:56:03, 0] ../../lib/util/fault.c:184(smb_panic_log)
PANIC (pid 86143): ../../lib/util/genrand.c:53:generate_random_buffer: GnuTLS could not generate a random buffer: GNUTLS_E_RANDOM_DEVICE_ERROR [-342]
in 4.15.8-git.473.1a1018e0a0b3.71.2-SUSE-SLE_12-x86_64
[2022/10/21 15:56:03, 0] ../../lib/util/fault.c:288(log_stack_trace)
BACKTRACE: 20 stack frames:
#0 /usr/lib64/samba/libgenrand-samba4.so(log_stack_trace+0x18) [0x7f4826fae708]
#1 /usr/lib64/samba/libgenrand-samba4.so(smb_panic+0x9) [0x7f4826fae919]
#2 /usr/lib64/samba/libgenrand-samba4.so(+0x12ea) [0x7f4826fae2ea]
#3 /usr/lib64/samba/libgenrand-samba4.so(+0x1412) [0x7f4826fae412]
#4 /usr/lib64/samba/libmessages-dgm-samba4.so(messaging_dgm_init+0x32a) [0x7f4823adac4a]
#5 /usr/lib64/samba/libmessages-dgm-samba4.so(messaging_dgm_ref+0x8a) [0x7f4823adc10a]
#6 /usr/lib64/libsmbconf.so.0(messaging_reinit+0xc0) [0x7f4828350120]
#7 /usr/lib64/libsmbconf.so.0(reinit_after_fork+0xb9) [0x7f48283616f9]
#8 /usr/lib64/samba/libsmbd-base-samba4.so(cups_cache_reload+0xcd) [0x7f482768b3fd]
#9 /usr/lib64/samba/libsmbd-base-samba4.so(pcap_cache_reload+0xf0) [0x7f48276885c0]
#10 /usr/lib64/samba/libsmbd-base-samba4.so(+0x84699) [0x7f482767b699]
#11 /usr/lib64/libsmbconf.so.0(+0x52ca8) [0x7f4828359ca8]
#12 /usr/lib64/samba/libtevent.so.0(tevent_common_invoke_timer_handler+0x120) [0x7f4828ddb1b0]
#13 /usr/lib64/samba/libtevent.so.0(tevent_common_loop_timer_delay+0x49) [0x7f4828ddb339]
#14 /usr/lib64/samba/libtevent.so.0(+0xd639) [0x7f4828ddc639]
#15 /usr/lib64/samba/libtevent.so.0(+0xb737) [0x7f4828dda737]
#16 /usr/lib64/samba/libtevent.so.0(_tevent_loop_once+0x9d) [0x7f4828dd56dd]
#17 /usr/lib64/samba/samba-bgqd(main+0x7d1) [0x5596a283b011]
#18 /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f48263cfad5]
#19 /usr/lib64/samba/samba-bgqd(_start+0x29) [0x5596a283b669]
[2022/10/21 15:56:03, 0] ../../source3/lib/dumpcore.c:318(dump_core)
coredump is handled by helper binary specified at /proc/sys/kernel/core_pattern
Comment 2 Stefan Metzmacher 2022-11-02 15:07:04 UTC
(In reply to David Mulder from comment #0)

The reason for GNUTLS_E_RANDOM_DEVICE_ERROR [-342]
is the closefrom() call in source3/printing/samba-bgqd.c of 4.15

It caused the fd opened from the gnutls library initializer
(_gnutls_urandom_fd) to be closed. And without this commit in gnutls:
https://gitlab.com/gnutls/gnutls/-/commit/b20bd42bc2f07b58f912c8899f7eb5bf2340fc4d
it will fail the read(_gnutls_urandom_fd) in _rnd_get_system_entropy_urandom
and return GNUTLS_E_RANDOM_DEVICE_ERROR.

So the patches in the merge request only fix the problem by accident!

The real fix would be backporting these:
https://gitlab.com/gnutls/gnutls/-/merge_requests/1396
and/or https://gitlab.com/samba-team/samba/-/commit/82a21581c63fc4e453fd4f5cd44e77a95c84f50c
Comment 3 David Mulder 2022-11-02 15:26:13 UTC
(In reply to Stefan Metzmacher from comment #2)

Yes I know. I've already had this discussion with Volker and Andrew. These patches are not by accident, it's working around the known issue.