systemd-journald crashing on arm/mips/ppc with glibc/trunk

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Jul 5 12:21:31 GMT 2021



On 02/07/2021 14:02, Khem Raj wrote:
> Hi Adhemerval and Carlos
> 
> I am observing a crash in systemd-journald with system running
> glibc/trunk in recvmsg and
> if I revert  [1] and [2] then SIGSEGV is gone ( this is happening with
> systemd-journald on ppc32/mips/arm )
> 
> The problem seems to be that code is not checking for case where msg
> can be NULL.
> 
> below test example also segfaults in libc.so
> 
> #include <sys/socket.h>
> #include <stddef.h>
> 
> int
> main(void)
> {
>     return recvmsg(-1, NULL, 0) != -1;
> }

I guess we would need to support it, since it seems that systemd is using
recvmsg (s, NULL, 0) to check if the socket is valid (I don't see any other
sane usage).

I would say recvmsg should follow other interfaces such as prlimit() which
expects a *valid* input, but the standard does define EBADF/ENOTSOCK as
potential error case.




More information about the Libc-alpha mailing list