Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5846c2b
portablectl: fix swapped arguments for setns()
mrc0mmand Apr 9, 2026
bb99bb1
udev: fix bounds check in dev_if_packed_info()
mil1200 Apr 9, 2026
2020013
sd-varlink: fix a potential connection count leak
mrc0mmand Apr 9, 2026
ca10b4e
resolved: skip cache flush on server switch/re-probe when StaleRetent…
Mar 3, 2026
aebf1b8
resolved: replace assert() with error return in DNSSEC verify functions
mil1200 Apr 9, 2026
aacb346
sd-bus: don't overallocate the message buffer
mrc0mmand Apr 10, 2026
7089440
meson: Check if files returned by git ls-files actually exist
daandemeyer Apr 10, 2026
308a8f1
sd-json: limit the stack depth during parsing as well
mrc0mmand Apr 10, 2026
c99ceca
core: fix EBUSY on restart and clean of delegated services
naraghavan2186 Mar 24, 2026
6f0c9b7
importctl: fix -N to actually clear keep-download flag
keszybz Apr 10, 2026
c96d5d2
sd-event: replace dead code path with an assert
keszybz Apr 11, 2026
379994d
po: Translated using Weblate (Arabic)
Apr 11, 2026
764ec4c
sd-varlink: scale down the limit of connections per UID to 128
mrc0mmand Apr 10, 2026
e4be906
uid-range: add assert to prevent underflow in coalesce loop
bluca Apr 11, 2026
9bc20be
debug-generator: assert breakpoint type is valid before bit shift
bluca Apr 11, 2026
4e950cd
journal: move the {DATA,ENTRY}_SIZE constants to sd-journal
mrc0mmand Apr 12, 2026
79f42ff
compress: limit the output to dst_max bytes with LZ4 if set
mrc0mmand Apr 12, 2026
e043d16
journal: limit decompress_blob() output to DATA_SIZE_MAX
mrc0mmand Apr 12, 2026
50099a9
nss-systemd: fix off-by-one in nss_pack_group_record_shadow()
mil1200 Apr 11, 2026
9526346
udev/scsi-id: check for invalid chars in various fields received from…
bluca Apr 10, 2026
104c780
udev/scsi-id: check for invalid header from kernel buffer
bluca Apr 10, 2026
841fd49
udev/scsi-id: various typing refactorings
bluca Apr 10, 2026
403120b
time-util: encode our assumption that clock_gettime() never can retur…
poettering Apr 12, 2026
dbac5bc
docs: beef up SECURITY.md rules for reporting
bluca Apr 10, 2026
6dc9188
nss-myhostname: add more INC_SAFE for buffer index accumulation
bluca Apr 11, 2026
ac6c771
test-json: add iszero_safe guards for float division at index 0 and 1
bluca Apr 11, 2026
b47ba19
fundamental: add ABS_DIFF macro
keszybz Apr 11, 2026
074f90b
homed: drop unnecessary cast to double
keszybz Apr 11, 2026
44ed48d
core: use JSON_BUILD_CONST_STRING() where appropriate
poettering Apr 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ Subscription to the Security Advisories and/or systemd-security mailing list is
Those conditions should be backed by publicly accessible information (ideally, a track of posts and commits from the mail address in question).
If you fall into one of those categories and wish to be subscribed,
contact the maintainers or submit a **[subscription request](https://www.redhat.com/mailman/listinfo/systemd-security)**.

# Requirements for a Valid Report

- Please ensure the issue is reproducible on main.
- Please ensure a fully working, end-to-end reproducer is provided.
- Please ensure the reproducer is real-world and not simulated or abstracted.
- Please ensure the reproducer demonstrably violates a security boundary.
- Please understand that most of our maintainers are volunteers and already have a heavy review burden. While we will try to triage and fix issues in a timely manner, we cannot guarantee any fixed timeline for issue resolution.
- While modern industry practices around coordinated disclosures encourage public disclosure to avoid vendors stonewalling researchers, we are an open source project that would gain little from needlessly stonewalling researchers. We thus kindly request that reporters do not publicly disclose issues they have reported to us before an agreed-to disclosure date.
8 changes: 7 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,13 @@ if git.found()
'ls-files', ':/*.[ch]', ':/*.cc',
check : false)
if all_files.returncode() == 0
all_files = files(all_files.stdout().split())
existing_files = []
foreach f : all_files.stdout().split()
if fs.exists(f)
existing_files += f
endif
endforeach
all_files = files(existing_files)

custom_target(
output : 'tags',
Expand Down
8 changes: 3 additions & 5 deletions po/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: systemd\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-06 03:46+0900\n"
"PO-Revision-Date: 2026-02-26 13:58+0000\n"
"PO-Revision-Date: 2026-04-11 19:58+0000\n"
"Last-Translator: joo es <jonnyse@users.noreply.translate.fedoraproject.org>\n"
"Language-Team: Arabic <https://translate.fedoraproject.org/projects/systemd/"
"main/ar/>\n"
Expand All @@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"X-Generator: Weblate 5.16.1\n"
"X-Generator: Weblate 5.16.2\n"

#: src/core/org.freedesktop.systemd1.policy.in:22
msgid "Send passphrase back to system"
Expand Down Expand Up @@ -938,12 +938,10 @@ msgid "DHCP server sends force renew message"
msgstr "خادم DHCP يرسل رسالة تجديد إجبارية"

#: src/network/org.freedesktop.network1.policy:144
#, fuzzy
#| msgid "Authentication is required to send force renew message."
msgid ""
"Authentication is required to send a force renew message from the DHCP "
"server."
msgstr "الاستيثاق مطلوب للإرسال رسالة تجديد إجبارية."
msgstr "الاستيثاق مطلوب للإرسال رسالة تجديد إجبارية من خادم DHCP."

#: src/network/org.freedesktop.network1.policy:154
msgid "Renew dynamic addresses"
Expand Down
2 changes: 2 additions & 0 deletions src/basic/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ int decompress_blob_lz4(
size = unaligned_read_le64(src);
if (size < 0 || (unsigned) size != unaligned_read_le64(src))
return -EFBIG;
if (dst_max > 0 && (size_t) size > dst_max)
return -ENOBUFS;
out = greedy_realloc(dst, size, 1);
if (!out)
return -ENOMEM;
Expand Down
17 changes: 15 additions & 2 deletions src/basic/time-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,28 @@ usec_t now(clockid_t clock_id) {

assert_se(clock_gettime(map_clock_id(clock_id), &ts) == 0);

return timespec_load(&ts);
usec_t n = timespec_load(&ts);

/* We use both 0 and USEC_INFINITY as niche values. If the current time collides with either, things are
* really weird and really broken. Let's not allow this to go through, it would break too many of our
* assumptions in code. */
assert(n > 0);
assert(n < USEC_INFINITY);

return n;
}

nsec_t now_nsec(clockid_t clock_id) {
struct timespec ts;

assert_se(clock_gettime(map_clock_id(clock_id), &ts) == 0);

return timespec_load_nsec(&ts);
nsec_t n = timespec_load_nsec(&ts);

assert(n > 0);
assert(n < NSEC_INFINITY);

return n;
}

dual_timestamp* dual_timestamp_now(dual_timestamp *ts) {
Expand Down
2 changes: 2 additions & 0 deletions src/basic/uid-range.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ static void uid_range_coalesce(UIDRange *range) {
if (range->n_entries > j + 1)
memmove(y, y + 1, sizeof(UIDRangeEntry) * (range->n_entries - j - 1));

/* Silence static analyzers, n_entries > 0 since j < n_entries holds in the loop condition */
assert(range->n_entries > 0);
range->n_entries--;
j--;
}
Expand Down
23 changes: 23 additions & 0 deletions src/core/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -3982,6 +3982,29 @@ bool unit_cgroup_delegate(Unit *u) {
return c->delegate;
}

void unit_cgroup_disable_all_controllers(Unit *u) {
int r;

assert(u);

CGroupRuntime *crt = unit_get_cgroup_runtime(u);
if (!crt || !crt->cgroup_path)
return;

if (!unit_cgroup_delegate(u))
return;

/* For delegated units, the previous payload may have enabled controllers (e.g. "pids") in
* cgroup.subtree_control. These persist after the service stops and turn the cgroup into an
* "internal node", causing clone3(CLONE_INTO_CGROUP) to fail with EBUSY. Clear them now, right
* before the new start, so that resource control is preserved for lingering processes as long as
* possible. Ignore errors — if sub-cgroups still have live processes the write will fail, but so
* will the upcoming spawn. */
r = cg_enable(u->manager->cgroup_supported, /* mask= */ 0, crt->cgroup_path, &crt->cgroup_enabled_mask);
if (r < 0)
log_unit_debug_errno(u, r, "Failed to disable controllers on cgroup %s, ignoring: %m", empty_to_root(crt->cgroup_path));
}

void manager_invalidate_startup_units(Manager *m) {
Unit *u;

Expand Down
2 changes: 2 additions & 0 deletions src/core/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ void unit_cgroup_catchup(Unit *u);

bool unit_cgroup_delegate(Unit *u);

void unit_cgroup_disable_all_controllers(Unit *u);

int unit_get_cpuset(Unit *u, CPUSet *cpus, const char *name);

int unit_cgroup_freezer_action(Unit *u, FreezerAction action);
Expand Down
6 changes: 5 additions & 1 deletion src/core/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-util.h"
#include "cgroup.h"
#include "chase.h"
#include "dbus-service.h"
#include "dbus-unit.h"
Expand Down Expand Up @@ -3165,8 +3166,10 @@ static int service_start(Unit *u) {
exec_status_reset(&s->main_exec_status);

CGroupRuntime *crt = unit_get_cgroup_runtime(u);
if (crt)
if (crt) {
unit_cgroup_disable_all_controllers(u);
crt->reset_accounting = true;
}

service_enter_condition(s);
return 1;
Expand Down Expand Up @@ -5629,6 +5632,7 @@ static int service_clean(Unit *u, ExecCleanMask mask) {
goto fail;
}

unit_cgroup_disable_all_controllers(u);
r = unit_fork_and_watch_rm_rf(u, l, &s->control_pid);
if (r < 0) {
log_unit_warning_errno(u, r, "Failed to spawn cleaning task: %m");
Expand Down
2 changes: 1 addition & 1 deletion src/core/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "install.h"
#include "iterator.h"
#include "job.h"
#include "journal-importer.h"
#include "journal-def.h"
#include "list.h"
#include "log.h"
#include "log-context.h"
Expand Down
2 changes: 1 addition & 1 deletion src/core/varlink-unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int can_clean_build_json(sd_json_variant **ret, const char *name, void *u
}

if (FLAGS_SET(mask, EXEC_CLEAN_FDSTORE)) {
r = sd_json_variant_append_arrayb(&v, SD_JSON_BUILD_STRING("fdstore"));
r = sd_json_variant_append_arrayb(&v, JSON_BUILD_CONST_STRING("fdstore"));
if (r < 0)
return r;
}
Expand Down
2 changes: 1 addition & 1 deletion src/coredump/coredump-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "conf-parser.h"
#include "coredump-config.h"
#include "format-util.h"
#include "journal-importer.h"
#include "journal-def.h"
#include "log.h"
#include "string-table.h"
#include "string-util.h"
Expand Down
3 changes: 2 additions & 1 deletion src/debug-generator/debug-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ static int parse_breakpoint_from_string(const char *s, uint32_t *ret_breakpoints

FOREACH_ELEMENT(i, breakpoint_info_table)
if (FLAGS_SET(i->validity, BREAKPOINT_DEFAULT) && breakpoint_applies(i, INT_MAX)) {
breakpoints |= 1 << i->type;
assert(i->type >= 0 && i->type < _BREAKPOINT_TYPE_MAX); /* silence coverity */
breakpoints |= UINT32_C(1) << i->type;
found_default = true;
break;
}
Expand Down
20 changes: 14 additions & 6 deletions src/fundamental/macro-fundamental.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
#define U64_GB (UINT64_C(1024) * U64_MB)

#undef MAX
#define MAX(a, b) __MAX(UNIQ, (a), UNIQ, (b))
#define MAX(a, b) __MAX(UNIQ, a, UNIQ, b)
#define __MAX(aq, a, bq, b) \
({ \
const typeof(a) UNIQ_T(A, aq) = (a); \
Expand Down Expand Up @@ -217,14 +217,22 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
})

#undef MIN
#define MIN(a, b) __MIN(UNIQ, (a), UNIQ, (b))
#define MIN(a, b) __MIN(UNIQ, a, UNIQ, b)
#define __MIN(aq, a, bq, b) \
({ \
const typeof(a) UNIQ_T(A, aq) = (a); \
const typeof(b) UNIQ_T(B, bq) = (b); \
UNIQ_T(A, aq) < UNIQ_T(B, bq) ? UNIQ_T(A, aq) : UNIQ_T(B, bq); \
})

#define ABS_DIFF(a, b) __ABS_DIFF(UNIQ, a, UNIQ, b)
#define __ABS_DIFF(aq, a, bq, b) \
({ \
const typeof(a) UNIQ_T(A, aq) = (a); \
const typeof(b) UNIQ_T(B, bq) = (b); \
UNIQ_T(A, aq) < UNIQ_T(B, bq) ? UNIQ_T(B, bq) - UNIQ_T(A, aq) : UNIQ_T(A, aq) - UNIQ_T(B, bq); \
})

/* evaluates to (void) if _A or _B are not constant or of different types */
#define CONST_MIN(_A, _B) \
(__builtin_choose_expr( \
Expand Down Expand Up @@ -295,7 +303,7 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
})

#undef CLAMP
#define CLAMP(x, low, high) __CLAMP(UNIQ, (x), UNIQ, (low), UNIQ, (high))
#define CLAMP(x, low, high) __CLAMP(UNIQ, x, UNIQ, low, UNIQ, high)
#define __CLAMP(xq, x, lowq, low, highq, high) \
({ \
const typeof(x) UNIQ_T(X, xq) = (x); \
Expand All @@ -312,7 +320,7 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
* computation should be possible in the given type. Therefore, we use
* [x / y + !!(x % y)]. Note that on "Real CPUs" a division returns both the
* quotient and the remainder, so both should be equally fast. */
#define DIV_ROUND_UP(x, y) __DIV_ROUND_UP(UNIQ, (x), UNIQ, (y))
#define DIV_ROUND_UP(x, y) __DIV_ROUND_UP(UNIQ, x, UNIQ, y)
#define __DIV_ROUND_UP(xq, x, yq, y) \
({ \
const typeof(x) UNIQ_T(X, xq) = (x); \
Expand All @@ -324,11 +332,11 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
#define __ROUND_UP(q, x, y) \
({ \
const typeof(y) UNIQ_T(A, q) = (y); \
const typeof(x) UNIQ_T(B, q) = DIV_ROUND_UP((x), UNIQ_T(A, q)); \
const typeof(x) UNIQ_T(B, q) = DIV_ROUND_UP(x, UNIQ_T(A, q)); \
typeof(x) UNIQ_T(C, q); \
MUL_SAFE(&UNIQ_T(C, q), UNIQ_T(B, q), UNIQ_T(A, q)) ? UNIQ_T(C, q) : (typeof(x)) -1; \
})
#define ROUND_UP(x, y) __ROUND_UP(UNIQ, (x), (y))
#define ROUND_UP(x, y) __ROUND_UP(UNIQ, x, y)

#define CASE_F_1(X) case X:
#define CASE_F_2(X, ...) case X: CASE_F_1( __VA_ARGS__)
Expand Down
6 changes: 3 additions & 3 deletions src/home/homed-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1889,10 +1889,10 @@ static int manager_rebalance_calculate(Manager *m) {
assert(h->rebalance_usage <= usage_sum);
assert(h->rebalance_weight <= weight_sum);

d = ((double) (free_sum / 4096.0) * (double) h->rebalance_weight) / (double) weight_sum; /* Calculate new space for this home in units of 4K */
d = free_sum / 4096.0 * h->rebalance_weight / weight_sum; /* Calculate new space for this home in units of 4K */

/* Convert from units of 4K back to bytes */
if (d >= (double) (UINT64_MAX/4096))
if (d >= UINT64_MAX / 4096)
new_free = UINT64_MAX;
else
new_free = (uint64_t) d * 4096;
Expand Down Expand Up @@ -1928,7 +1928,7 @@ static int manager_rebalance_calculate(Manager *m) {
h->rebalance_pending = true;
}

if ((fabs((double) h->rebalance_size - (double) h->rebalance_goal) * 100 / (double) h->rebalance_size) >= 5.0)
if (ABS_DIFF(h->rebalance_size, h->rebalance_goal) * 100.0 / h->rebalance_size >= 5.0)
relevant = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/import/importctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ static int parse_argv(int argc, char *argv[]) {
break;

case 'N':
arg_import_flags_mask &= ~IMPORT_PULL_KEEP_DOWNLOAD;
arg_import_flags &= ~IMPORT_PULL_KEEP_DOWNLOAD;
arg_import_flags_mask |= IMPORT_PULL_KEEP_DOWNLOAD;
break;

Expand Down
2 changes: 1 addition & 1 deletion src/journal-remote/journal-remote-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int process_http_upload(
_cleanup_free_ char *buf = NULL;
size_t buf_size;

r = decompress_blob(source->compression, upload_data, *upload_data_size, (void **) &buf, &buf_size, 0);
r = decompress_blob(source->compression, upload_data, *upload_data_size, (void **) &buf, &buf_size, DATA_SIZE_MAX);
if (r < 0)
return mhd_respondf(connection, r, MHD_HTTP_BAD_REQUEST, "Decompression of received blob failed.");

Expand Down
1 change: 0 additions & 1 deletion src/journal/journald-native.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "fd-util.h"
#include "format-util.h"
#include "iovec-util.h"
#include "journal-importer.h"
#include "journal-internal.h"
#include "journald-client.h"
#include "journald-console.h"
Expand Down
6 changes: 2 additions & 4 deletions src/libsystemd/sd-bus/bus-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,6 @@ int bus_socket_take_fd(sd_bus *b) {
int bus_socket_write_message(sd_bus *bus, sd_bus_message *m, size_t *idx) {
struct iovec *iov;
ssize_t k;
size_t n;
unsigned j;
int r;

Expand All @@ -1251,9 +1250,8 @@ int bus_socket_write_message(sd_bus *bus, sd_bus_message *m, size_t *idx) {
if (r < 0)
return r;

n = m->n_iovec * sizeof(struct iovec);
iov = newa(struct iovec, n);
memcpy_safe(iov, m->iovec, n);
iov = newa(struct iovec, m->n_iovec);
memcpy_safe(iov, m->iovec, sizeof(struct iovec) * m->n_iovec);

j = 0;
iovec_advance(iov, &j, *idx);
Expand Down
12 changes: 7 additions & 5 deletions src/libsystemd/sd-event/sd-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -2025,11 +2025,13 @@ _public_ int sd_event_add_memory_pressure(
if (errno != ENOENT)
return -errno;

/* We got ENOENT. Three options now: try the fallback if we have one, or return the error as
* is (if based on user/env config), or return -EOPNOTSUPP (because we picked the path, and
* the PSI service apparently is not supported) */
if (!watch_fallback)
return locked ? -ENOENT : -EOPNOTSUPP;
/* We got ENOENT. Two options now: try the fallback if we have one, or return the error as is
* (when based on user/env config). */

if (!watch_fallback) {
assert(locked);
return -ENOENT;
}

path_fd = open(watch_fallback, O_PATH|O_CLOEXEC);
if (path_fd < 0) {
Expand Down
15 changes: 15 additions & 0 deletions src/libsystemd/sd-journal/journal-def.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
#include "sd-forward.h"
#include "sparse-endian.h"

/* Make sure not to make this smaller than the maximum coredump size.
* See JOURNAL_SIZE_MAX in coredump-config.h */
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
#define ENTRY_SIZE_MAX (1024*1024*770u)
#define ENTRY_SIZE_UNPRIV_MAX (1024*1024*32u)
#define DATA_SIZE_MAX (1024*1024*768u)
#else
#define ENTRY_SIZE_MAX (1024*1024*13u)
#define ENTRY_SIZE_UNPRIV_MAX (1024*1024*8u)
#define DATA_SIZE_MAX (1024*1024*11u)
#endif

/* The maximum number of fields in an entry */
#define ENTRY_FIELD_COUNT_MAX 1024u

/*
* If you change this file you probably should also change its documentation:
*
Expand Down
2 changes: 1 addition & 1 deletion src/libsystemd/sd-journal/journal-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ static int maybe_decompress_payload(
}
}

r = decompress_blob(compression, payload, size, &f->compress_buffer, &rsize, 0);
r = decompress_blob(compression, payload, size, &f->compress_buffer, &rsize, DATA_SIZE_MAX);
if (r < 0)
return r;

Expand Down
Loading
Loading