Wind River Support Network

HomeDefectsLIN1021-5779
Fixed

LIN1021-5779 : systemd: build error with PACKAGECONFIG_append = " coredump"

Created: May 11, 2023    Updated: Jun 27, 2023
Resolved Date: Jun 8, 2023
Found In Version: 10.21.20.18
Fix Version: 10.21.20.18
Severity: Critical
Applicable for: Wind River Linux LTS 21
Component/s: Userspace

Description

ncountered below error when trying to build LTS21 by including this variable into local.conf "PACKAGECONFIG_append = " coredump"": 
|ninja: build stopped: subcommand failed.|
|WARNING: exit code 1 from a shell command.|

Summary: 1 task failed:
  /LTS21/layers/oe-core/meta/recipes-core/systemd/systemd_247.6.bb:do_compile
Summary: There were 132 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

The problem is from this patch systemd/systemd/CVE-2022-4415-0002.patch. This patch breaks the build, as errno_util.h does not include the required macros introduced in systemd version 252.

A workaround in to add the following lines, taken from systemd version 253, to /src/basic/errno-util.h, and systemd builds fine.

/* strerror(3) says that glibc uses a maximum length of 1024 bytes. */
#define ERRNO_BUF_LEN 1024

/* Note: the lifetime of the compound literal is the immediately surrounding block,
 * see C11 §6.5.2.5, and
 * [https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks]
*
 * Note that we use the GNU variant of strerror_r() here. */
#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)

/* A helper to print an error message or message for functions that return 0 on EOF.
 * Note that we can't use (\{ … }) to define a temporary variable, so errnum is
 * evaluated twice. */
#define STRERROR_OR_EOF(errnum) ((errnum) != 0 ? STRERROR(errnum) : "Unexpected EOF")
Live chat
Online