1416 Commits
Author SHA1 Message Date
Felix Fietkau 871d2f0d7c ubus: update to Git HEAD (2026-11-23)
f5ccb296df8d libubus: drop an object removed on a lost connection
536c6031bd8f tests: cover the removal of an object on a lost connection
db43fc7f813c tests: check the type id after a remove on a live connection
a86a0996ca05 ubusd: refuse an object add with a type id it does not know
3257dd6618e4 libubus: register the type again when ubusd does not know its id
3e3adf15c06c tests: cover a retry of an object add that ubusd also refuses
a34231ee1152 ubusd: refuse an object add whose signature it cannot register
6858c5b4cc72 libubus: keep an object under removal out of a reconnect
233d8872d13d tests: cover a reconnect and a nested remove during an object remove
739448432090 libubus: put a refused object back before queued messages run
7456f0b04b4b libubus: hold queued handlers until a reconnect adds every object
2345a02a84d7 libubus: register event patterns again after a reconnect
faa929a7e720 libubus: remove the handler object of a refused event register

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-12-03 20:23:12 +01:00
Christian Marangi 139ef4ec98 apk: use wget as url backend for host tool
It seems there is a problem with using the integrated libfetch for host
tool. Lets revert to wget for host tool to workaround this problem.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-11-29 16:46:40 +01:00
Daniel Golle e9e50121a5 fstools: update to git HEAD of 2026-11-28
b5f65a4 block: skip probing UBI-backed NAND

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-11-28 18:41:03 +00:00
Christian Marangi c38dbc941b apk: add pending patch for libuclient support
Add pending patch for libuclient support for io_url helper. This permits to
drop wget dependency in favor of using uclient based on libubox. Also it
should provide a much more robust implementation by using library API than
making APK call external wget command with some args.

libfetch is used for Host compilation as it's just used for local .apk
install and we don't care about using the extra space for host tools.

Link: https://github.com/openwrt/openwrt/pull/26041
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-11-27 12:54:27 +01:00
Tianling Shen c4acd16e4c procd: add workdir support to shell helpers
Support for per-instance working directories has been merged into upstream
commit 2e013572e8b3 ("service: add workdir support for daemon instances").

Accept workdir as a string parameter in procd_set_param() and document
it among the available parameter types, allowing init scripts to select
a working directory for service instances.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/26612
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-16 20:54:20 +01:00
Robert Marko 7424e2ca30 ubox: update to Git HEAD (2026-11-15)
46f702b7f8af logd: don't hand out stale entries after the ring wraps
79f0910ec1f8 logd: don't walk past the end marker when the ring wraps
eb2eb2fe6036 logd: don't overflow a ring buffer smaller than a message
7ab668af44c2 logd: don't read before a message of only whitespace
8609c32b4f0f logd: don't hand out an entry from an empty buffer
1767e1d19f0a logd: keep "logread -l" working after 2^31 messages
9555709f00d5 logd: align the entries in the buffer for their header
b0635f4227bd logread: don't crash on a time with a five-digit year

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-15 18:35:05 +01:00
Andy Chiang 36fbdeb2d6 fstools: update to git HEAD of 2026-11-07
5e371ec block: don't log an error when fstab is missing

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/26559
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-13 11:52:17 +01:00
Daniel Golle a530a202ce procd: find uvol volumes in the mount helpers
procd_get_mountpoints matches paths against the mount targets in
/etc/config/fstab. Since packages commit cb60600ae ("uvol: bump version
to 1.1") uvol registers its volumes with blockd over ubus and writes no
fstab entries, so a service whose data lives on a uvol volume gets no
mount trigger and starts before the volume is there.

procd_get_mountpoints also returns /tmp/run/uvol/<name> for a path below
it, where blockd places every uvol volume, the convention uxc relies on
too, and follows a path that is a symbolic link, with a relative target
taken from the link's directory. procd_mountpoints_ready tells whether
the mountpoints of the given paths are usable: an fstab target mounted,
a uvol volume registered while blockd is ready. A path below an fstab
mount that is disabled is never ready, so a service keeps off the root
overlay its data was not meant for. blockd sends mount.add for the
registration, so the existing mount triggers start a service that found
its volume missing.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-11-06 19:01:26 +00:00
Daniel Golle c9ce96fffe video-support: put the DMA-BUF heaps in the video group
procd creates /dev/dma_heap/* owned by root with mode 0600, as no rule
matches the dma_heap subsystem. A media player allocates its frame
buffers from the system heap when decoding in software for a KMS plane,
and as an unprivileged user it cannot open the heap: Kodi then finds no
buffer object able to allocate by size and drops every VP9 frame.

Create the heap nodes in video, like the DRM card nodes.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-11-05 22:59:22 +00:00
Daniel Golle b1e9474fad procd: update to git HEAD of 2026-11-03
See https://git.openwrt.org/project/procd/log/ for the
detailed history since commit 0d3c5dc1bb.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-11-03 11:57:36 +00:00
Daniel Golle 456ef6d54b procd: update to git HEAD of 2026-11-01
See https://git.openwrt.org/project/procd/log/ for the
detailed history since commit 5aef7c33b0.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-11-01 20:14:51 +00:00
Robert Marko f79894ab57 ubus: update to Git HEAD (2026-10-28)
db20eff5535f libubus: add a pre-invoke callback for resolved object methods

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-28 14:03:26 +01:00
Robert Marko 8ac5e0118c rpcd: update to Git HEAD (2026-10-28)
469d7852316e session: enforce session ACLs for non-root ubus callers

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-28 14:03:26 +01:00
Hauke Mehrtens 63f702f1c0 ca-certificates: blacklist "emSign ECC Root CA - G3"
This blacklists the "emSign ECC Root CA - G3" CA certificate which
issued some intermediate CA certificates for eMudhra with 8 bit private
keys between 0 and 255.

"Comodo AAA Services root" is also blacklisted by Debian, but already
removed in update 20260223.

Link: https://github.com/openwrt/openwrt/pull/26066
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-10-21 01:42:36 +02:00
Daniel Golle 2aaf209780 fstools: update to git HEAD of 2026-10-18
907cf44 block: take down a share that left the configuration
 c681289 block: report a helper failure without a synthetic errno
 b46809f blockd: log an automount request at info level
 8740de0 block: mount network filesystems from fstab
 d82a150 blockd: take a deregistered mount down without probing /dev
 627d0eb block: allow an explicit filesystem type in fstab
 519681d block: use the umount helper when one exists
 86ad409 blockd: expire autofs mounts asynchronously
 6f8e823 blockd: answer autofs misses asynchronously
 ee8de6e blockd: report a failed fork to the caller of block()
 039d712 block: call the mount helper on any mount(2) failure
 9f85f3c block: reject an unusable filesystem type
 6e717b1 block: report the mount helper exit status
 c1e1260 block: exit the mount helper child properly
 ccf7160 block: fix mount option string overflow
 207d8fe mount_root: honor fstools_overlay_name in done

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-10-20 10:28:12 +01:00
Daniel Golle 5b8554a95e procd: update to git HEAD of 2026-10-18
A large number of generic procd, ujail and container related fixes and
improvements. See https://git.openwrt.org/project/procd/log/ for the
detailed history since commit 6a22d39648.

uxc keeps the per-run files of a container, the last exit record, the
generated environment file and the resources override, in
/tmp/run/uxc/<name>/. The pre-remove hook only stops a package
container and deletes it from procd, so that directory stays behind
until the next reboot. Remove it in the post-remove hook together with
the state and settings of the container.

When a container package is upgraded to a new image, the pre-install
hook only signals the old container and leaves its instance in procd.
The bring-up after the install then adds the container with once, which
procd refuses for a container it already has, so the new image starts
only after the next reboot.

Delete the old container in the pre-install hook, as the pre-remove hook
does. uxc kill without a signal returns once the container has stopped,
procd forgets a deleted container, and the bring-up starts the new
image.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-10-19 09:55:56 +01:00
Gary Dotzler 17a3a87f6e procd: assign conventional /dev/net/tun permissions
Set /dev/net/tun to mode 0666, matching the TUN/TAP permissions
documented by docs.kernel.org[1] and the default udev policy used by
other Linux systems[2].

This avoids forcing otherwise unprivileged processes to retain elevated
privileges solely to open the device node.

Interface creation and attachment remain subject to the kernel's usual
capability and ownership checks.

[1] https://docs.kernel.org/networking/tuntap.html#configuration
[2] https://github.com/systemd/systemd/blob/be1e78ec49f8c84c634d9e58dae834b27ea28436/rules.d/50-udev-default.rules.in#L111

Signed-off-by: Gary Dotzler <geldot@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/25464
Signed-off-by: Nick Hainke <vincent@systemli.org>
2026-10-11 09:57:57 +02:00
Nick Hainke b6a081337b procd: update to Git HEAD (2026-10-07)
457721d7544d jail: drop the deferred path's own mount-propagation remount
66a33c82f755 jail: keep locked flags on phase-2 read-only remounts
0925850d765b jail: keep locked flags when remounting a noafile mask
ac855770e3b2 jail: apply root_map_uid to a joined user namespace
7f1b26ce3759 jail: join an external userns after build_jail_fs()
88fe395b2cd5 jail: fail on an unresolvable -j specification
638c2ecfaf8a jail: let a joined namespace replace the created one
56e1a2032e0d jail: factor out the MS_* to MOUNT_ATTR_* translation
8c9df2b8ae32 jail: mount sysfs in the parent when the jail lacks a netns
4021843627a4 jail: log a failing mask mount
fa1f24c84ce7 jail: drop all capabilities for a bundle that names none
5670ff93498d uxc: report every failure with one exit status
6a22d3964822 service: add per-instance 'vrf' option

Allow to set the new 'vrf' instance option with procd_set_param. It
binds all sockets of a service to a VRF device, like 'ip vrf exec':

  procd_set_param vrf <dev>

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-fable-5-1
Link: https://github.com/openwrt/openwrt/pull/25568
Signed-off-by: Nick Hainke <vincent@systemli.org>
2026-10-08 09:19:35 +02:00
Daniel Golle 62ac036be1 video-support: put the V4L2 nodes in the video group
The rule placed every video4linux and media node in video-capture, but
most are not capture devices: on an rk3588 board five of the six V4L2
nodes are the RGA blitter and the Hantro and rkvdec stateless codecs,
and only the HDMI receiver captures anything. A media player then had to
join video-capture to reach a decoder, which also granted it every
camera on the box.

Put the DRM and media nodes in video, and add v4l-id, which runs
VIDIOC_QUERYCAP and prefers device_caps over capabilities so that what
it describes is the node. Given a device alone it prints one boolean per
V4L2_CAP_ flag as JSON. Given a rule string as well, a list of
CAP[,CAP...]:GROUP separated by semicolons in which * matches any node,
it puts the node into the group of the first rule which matches it.

The rule string is parsed in full before the device is opened, so a
capability name the kernel does not define is reported whichever rule it
appears in, and no node is touched. A V4L2 node is created with no group
and v4l-id assigns one, since exec is queued by procd and may not run at
all; holding the node at root until the driver answers keeps a camera
out of video.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-10-05 20:09:55 +01:00
Hauke Mehrtens 09538fccfc rpcd: update to Git HEAD (2026-10-04)
d99f703e4035 session: stop naming runtime files after the session id

Link: https://github.com/openwrt/openwrt/pull/25587
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-10-04 17:05:52 +02:00
Felix Fietkau a1a104a8d8 ubus: update to Git HEAD (2026-09-25)
cd51fc0031ff libubus: refuse to send a message the peer must reject
9ba1ab795b2f libubus: drop the connection when a message cannot be read
ce54d7a956a5 ubusd_main: free partially received message on client disconnect
6b5c6f166db4 ubusd_main: free queued lookup commands on client disconnect
b012bc067515 ubusd_acl: use SO_PEERGROUPS instead of parsing /proc for peer gids
955ff3f7030c ubusd: fix use-after-free when resuming a queued object lookup
fb1dd8e0d7c8 ubusd: document the bound on the pending-message body read
3a39a800f162 libubus-req: fix double close of the fd in ubus_complete_deferred_request
4d60031579d2 libubus: fix msgbuf leak on ubus_channel_connect error path
91b0dadfd1ed libubus-req: fix error check on the __ubus_notify_async result
82416940eae8 libubus-io: do not resend the fd on partial writes in writev_retry
618f3cf75ae3 libubus-obj: fix fd leaks on object message error paths
2f52ae367c93 ubusd_main: flush the tx queue after freeing the client's objects
cdb648c3283a ubusd_obj: propagate subscription allocation failure to the client
7c5c06825daf ubusd_proto: fix double close of forwarded invoke fd
d8fec00656a6 ubusd: keep the fd alive while a message waits in the tx queue
bde609c2400e ubusd_acl: copy the filename used as the ACL file vlist key
008655958eb4 ubusd_acl: do not treat unresolvable ACL user/group names as id 0
5331c00f37f7 ubusd_event: document reserved event namespace forgery check
ef37ed207183 ubusd_event: use an unsigned type for the event dedup sequence
e12ad4bd667f ubusd: flag event messages as not expecting a reply
9d709c536cd6 ubusd_event: report allocation failure as out of memory
5170a5818b54 ubusd: use canonical SCM_RIGHTS extraction on the receive path
8dfee69c250c ubusd_main: do not abort startup when the default socket dir fails
17f78610d771 ubusd: disconnect the client when a partially sent message is dropped
f5e5836704c8 cli: parse monitored payloads with the untrusted blob parser
11e411e36f08 libubus: close the passed fd when the request exceeds the size limit
cbc27b66d813 ubusd: stop writing to a client already flagged for disconnect
2ec13d49ba37 libubus: do not restart the ACL query while one is in flight
297baef62eee libubus: free queued pending messages on shutdown
17525550a36b ubus/lua: fix Lua stack imbalance on policy allocation failure
fdd9ff1fe0fc ubus/lua: copy the Lua strings stored in registered objects
eb5a8284d176 ubusd: close the forwarded fd when the invoke reply cannot be built
3930745d8593 tests/fuzz: fix out-of-bounds read in header validation harness
b27014cf7978 tests/fuzz: use size of blob_attr, not of a pointer, in length guard
414c60a2e29e ubus/lua: store event handler ref without polluting the callback table

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-09-29 17:29:25 +02:00
Felix Fietkau 34aa4c81ec rpcd: update to Git HEAD (2026-09-25)
4062f666ecd1 file: reply with empty data instead of error for empty files
a6c6b63b47bd ucode: add compatibility to newer ucode version

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-09-29 17:29:25 +02:00
Daniel Golle 9815885220 hidraw-support: add a package for raw HID device handling
A HID device a driver hands to userspace whole, a UPS, a relay board or
a programmable keypad, appears as a hidraw node and is opened directly
by the program driving it. Everything of that kind runs as root today,
because the generic rule leaves the node 0600 root:root and there is no
group for it.

Allocate the hidraw group and install the rule which puts the hidraw
nodes into it. This is a separate class from the evdev nodes that
input-support covers: hidapi and the packages using it open hidraw, and
a keyboard or a mouse is read through evdev.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle d414369527 scanner-support: add a package for the scanner group
Scanner access is granted per device: a USB scanner is matched by vendor
and product id against a database of supported devices, which only the
driver package has. There is no device class to write a generic hotplug
rule against, and putting every USB device node into a group would grant
far more than scanner access.

Allocate the scanner group and nothing else, so the id is the same on
every image, one package owns it, and scanner userspace has something to
depend on. The rule granting access to a particular device stays with
the driver package.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle 1ccaee3465 printer-support: add a package for printer device handling
The USB and parallel port printer nodes come out 0600 root:root, so a
print spooler runs as root. The lp group is already allocated by p910nd
in the packages feed with gid 7, without anything creating it.

Add a printer-support package which allocates that group and puts the
usblp, lp and ppdev nodes into it, and make kmod-usb-printer and kmod-lp
depend on it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle 801c947113 kvm-support: add a package for KVM device handling
/dev/kvm comes out 0600 root:root, so a hypervisor runs as root.

Add a kvm-support package which allocates the kvm group and puts the node
into it. KVM is built into the kernel where it exists, so no module
carries a dependency on the package; userspace depends on it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle 94b949df48 dvb-support: add a package for DVB device handling
The DVB adapter nodes under /dev/dvb come out 0600 root:root, so a
tuner daemon runs as root.

Add a dvb-support package which allocates the dvb group and puts those
nodes into it, and make kmod-dvb-core depend on it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle a7c50f7d73 input-support: add a package for input device handling
The evdev character devices come out 0600 root:root, so a display server
or any other process reading keyboards and pointers runs as root.

Add an input-support package which allocates the input group and puts the
input nodes into it, and make the evdev and joydev modules depend on it.
The one device profile that ships evdev lists the package directly.
kmod-input-core stays ungated: it carries no device node of its own, and
most drivers built on it deliver their events to in-kernel consumers such
as the keyboard and button handlers.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle a6524274c1 accel-support: add a package for render device handling
The DRM render and compute nodes, /dev/dri/renderD*, /dev/accel/accel*
and /dev/kfd, come out 0600 root:root, so anything using a GPU for
compute or for accelerated rendering runs as root. They also share the
video group with the modesetting nodes wherever a distribution grants it,
which hands scanout control to every process allowed to compute.

Add an accel-support package which allocates the render group and puts
those nodes into it. No kernel module carries a dependency on it: whether
a device offers a render node is a property of the driver, not of the
module, so userspace that wants the group depends on the package.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle e829091f34 video-support: add a package for display device handling
The display target feature gates every DRM module, but it says nothing
useful: it is set on ten targets, so a mediatek/mt7623 board can have a
display while a filogic board with a MIPI DBI panel cannot, and rockchip
claims it for a NanoPi R2S as much as for a Rock 5B. Whether a board
drives a panel is a per-device choice, not a property of the SoC family.
The DRM and V4L2 nodes also end up 0600 root:root, so a display server
runs as root or not at all.

Add a video-support package which allocates the video and video-capture
groups and installs the hotplug rules for the DRM and V4L2 nodes, and
make the modules depend on it. The dependency is a plain one, not a
select, so the modules are offered once the feature is chosen. Targets
whose display drivers are built into the kernel carry the package in
DEFAULT_PACKAGES, since no module pulls it in for them, and the one
device profile that ships a DRM module on another target lists it
directly. DISPLAY_SUPPORT stays for now, so this changes no existing
selection.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle e06e3a621b audio-support: move audio device handling out of procd
The audio group and the rule that puts the ALSA character devices in it
are part of procd and base-files, so every image carries them whether or
not it has a sound card, and a package wanting the group has nothing to
depend on. Playback, capture and MIDI all land in one group as well, so a
process allowed to play is also allowed to record.

Move the lot into a new audio-support package with three groups, audio,
audio-capture and midi, and a hotplug fragment that sorts the sound nodes
between them. kmod-sound-core depends on the package, and so do the image
profiles that ship a sound driver. The dependency is a plain one, not a
select, so sound support is offered once the feature is chosen; userspace
that needs one of the groups depends on the same package. Images without
it fall back to the generic rule and get /dev/snd/* as 0600 root:root.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Daniel Golle ffbd82ed6c procd: include hotplug rule fragments from drop-in dirs
The hotplug rules live in a single /etc/hotplug.json, so a package
that needs a device node named, owned or grouped its own way has no
way to contribute one; the alternatives are patching the shared file
or falling back to a shell script under /etc/hotplug.d.

Load /etc/hotplug.json.d/*.json from inside the device node branch,
ahead of the built-in name rules, and /etc/hotplug-preinit.json.d/*
at the end of the preinit script. Fragments are run in sorted order.
A fragment that creates a node keeps it: the generic rule below still
runs, but its mknod() fails with EEXIST and leaves the node alone.

This is done in preparation for deprecating some of the subtarget-wide
FEATURES flags, instead introducing feature-umbrella packages such as
`video-support` and `audio-support` shipping the hotplug rule snippets
and having all providers (ie. kmods) and users depend on them.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-29 15:29:43 +01:00
Hauke Mehrtens e056c32ed0 mtd: validate trx->len in trx_fixup()
trx_fixup() computed the CRC32 range from the on-flash TRX header
without validating it:

    scan = ptr + offsetof(struct trx_header, flag_version);
    trx->crc32 = crc32buf(scan, trx->len - (scan - ptr));

trx->len is read from the mmap()ed partition and is only sanity checked
in trx_check(), which is a separate entry point. A trx->len larger than
the partition therefore makes crc32buf() walk that many bytes past the
end of the mapping and crash mtd with SIGSEGV.

The mirror case of a trx->len below the 12 byte offset does not overread
in practice: crc32buf() takes a size_t but passes it to crc32(), which
takes an int len and loops on "while (--len >= 0)". The wrapped value
truncates to a negative int, so the loop body never runs and a zero
length CRC32 is written instead. Values at or above 0x8000000c truncate
the same way. Only the range from sizeof(struct trx_header) to roughly
0x8000000b stays positive through the truncation and reads out of
bounds, which is exactly the range a plausible bad length falls into.

Bound trx->len on both sides before computing the range, using the same
lower limit trx_check() already applies. Both comparisons are unsigned,
so the wrapping cases are rejected as well.

trx_fixup() runs as root on the contents of the flash, so this is a
robustness fix rather than a privilege boundary: it is reachable through
"mtd jffs2write" and the jffs2_replaced path of "mtd write", not through
"mtd fixtrx", which uses mtd_fixtrx() and derives its length from
erasesize instead. The practical benefit is not crashing on a truncated
or corrupted header during sysupgrade.

Link: https://github.com/openwrt/openwrt/security/advisories/GHSA-wch3-f5gc-mw2h
Reported-by: @tonoyx91
Reported-by: @0xROI
Fixes: bbd9eb4669 ("clean up mtd, fix up trx header when integrating jffs2 data on broadcom devices")
Assisted-by: Claude:claude-opus-5
Link: https://github.com/openwrt/openwrt/pull/25284
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-09-26 21:26:29 +02:00
Hauke Mehrtens 83c18c360e mtd: fix fd and mapping leak in trx_fixup() error path
When the TRX magic check fails, trx_fixup() jumps straight to the err
label, which only returns -1. At that point the mtd device has already
been opened and the whole partition has been mmap()ed, so both the file
descriptor and the mapping are leaked.

Add an err2 label that unwinds the mapping before falling through to the
existing close(bfd), so the error path unwinds in reverse order of
acquisition like the success path does.

Fixes: bbd9eb4669 ("clean up mtd, fix up trx header when integrating jffs2 data on broadcom devices")
Assisted-by: Claude:claude-opus-5
Link: https://github.com/openwrt/openwrt/pull/25284
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-09-26 21:26:08 +02:00
Daniel Golle 3ab520425b procd: jail/seccomp: complete the pre-main syscall allowlists
Add missing syscall names needed on 32-bit platforms to the pre-main
pre-main syscall allowlists.

Fixes: #25392
Fixes: ee526dbf01 ("procd: update to git HEAD of 2026-09-13")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-26 00:53:12 +01:00
Daniel Golle 56d9cd66a8 procd: update to git HEAD of 2026-09-22
Various bug fixes and container runtime improvements.

Fixes: #25277 (at least)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-22 19:01:07 +01:00
John Crispin e923974fc1 apk: use deterministic ECDSA signatures
The host apk signs with LibreSSL, which uses a random ECDSA nonce. A
package that is signed again has different bytes and often a different
size, even if its content did not change. The rootfs records the
package size in /lib/apk/db/installed, so a rebuild of one package
changes all images.

Add a patch that derives the nonce as specified in RFC 6979. Signed
packages and images are now identical after a rebuild.

Signed-off-by: John Crispin <john@phrozen.org>
2026-09-22 18:46:30 +02:00
Daniel Golle 95f9a0f3aa procd: fix procd-ujail build on ARMv4
The new seccomp rework broke builds on ARMv4 which doesn't have Thumb
support. Fix it.

 c230ad87 jail: skip Thumb injection on cores without Thumb state

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-19 09:42:56 +01:00
Dharmik Parmar 4b3e132fb0 procd: make ujail package nonshared
procd-ujail is not selected on targets without the required kernel
namespace support, but its shared architecture package can still be
installed there.

When the package is carried across an upgrade or installed later, jailed
services fail to start because clone() returns EINVAL.

Keep procd-ujail in target-specific package repositories so it is not
offered on incompatible targets.

Fixes: #22428
Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
2026-09-18 16:08:57 +01:00
Daniel Golle ee526dbf01 procd: update to git HEAD of 2026-09-13
Various fixes and improvements in procd/ujail/uxc to better support
the use of ujail and uxc as container runtime environments, now
compliant with the OCI run-time spec version 1.3.0.

Also brings basic udebug tracing support and replaces the seccomp
preload libraries with a ucode implementation: procd-seccomp ships
trace2seccomp plus its utrace and seccomp-trace aliases and needs only
ucode and its fs module, while the OCI seccomp code now links into
ujail. uxc installs the new uxc-net and uxc-stack helpers and depends
on the ucode modules they use, and on odhcpd, which serves RA, DHCPv6
and DHCPv4 on container networks.

Adjacent changes in firewall4, netifd and odhcpd still have to find
their way into the tree for dynamically addressed native uxc
containers to be fully functional.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-09-18 16:03:13 +01:00
Fengyu Wu 7484295381 ca-certificates: update to 20260816
changelog: https://salsa.debian.org/debian/ca-certificates/-/blob/master/debian/changelog

  * Update Mozilla certificate authority bundle to version 2.90
    The following certificate authorities were added (+):
    + "SECOM TLS ECC Root CA 2024"
    + "SECOM TLS RSA Root CA 2024"
    + "Telia EC TLS Root CA v3"
    + "Telia RSA TLS Root CA v3"
    The following certificate authorities were removed (-):
    - "Atos TrustedRoot 2011"
    - "Entrust Root Certification Authority"
    - "SecureSign Root CA12"
    - "ePKI Root Certification Authority"

Signed-off-by: Fengyu Wu <saldry@proton.me>
Link: https://github.com/openwrt/openwrt/pull/24839
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-23 11:34:58 +02:00
Daniel Golle 9b11fa4088 fstools: update to git HEAD of 2026-07-25
2aa1640 block: preen a registered volume before mount on request
 d43ffba block: use preen mode for the f2fs filesystem check
 a71e97d blockd: do not let a slow startup helper hold back readiness
 1c17d24 blockd: expose storage readiness via a queryable status method
 f60b3a3 blockd: pass registrant mount options down to block on autofs mount
 998f6ab blockd: notify when an idle autofs mount is unmounted
 0008996 block: mount ubus-registered devices without an fstab entry
 4fd1502 blockd: coldplug block devices
 89a6f52 blockd: retry interrupted waitpid() in synchronous block() helper
 37cf94d blockd: fix bounds of the ubus event name buffer

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-07-25 17:30:51 +01:00
Hauke Mehrtens b5191da03c rpcd: update to Git HEAD (2026-07-19)
e37ed9d81469 file: re-authorize ACL against resolved path to close symlink bypass

Link: https://github.com/openwrt/openwrt/pull/24329
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-07-21 22:59:58 +02:00
Anna Kiri dd62e3af15 mtd: fis: fix buffer overflow from negative memset size
In fis_remap(), when desc < last, the memset size is computed as
'tmp - end'. Since tmp is calculated as 'end - positive_value', tmp is
always less than end, making 'tmp - end' negative. When cast to size_t,
this wraps to a very large value, causing a massive buffer overflow.

Fix by swapping the operands to 'end - tmp' which correctly computes the
number of bytes to clear.

Signed-off-by: Anna Kiri <bredcorn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23550
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-17 10:02:59 +02:00
Hauke Mehrtens 3c26b9fd64 ubus: update to Git HEAD (2026-06-28)
24864e7840b3 ubusd_id: use GRND_INSECURE to avoid blocking boot on getrandom()

Fixes: https://github.com/openwrt/ubus/issues/21
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-06-28 16:48:20 +02:00
Felix Fietkau 2010cfde39 procd: update to Git HEAD (2026-06-17)
9ff6e43bb75f service: notify instance exit details via ubus
4f42296dc4f0 jail: mount rootfs overlay with userxattr in user namespace
60fdbf00e924 jail: chown rootfs overlay dir to mapped root in user namespace

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-06-24 11:21:28 +02:00
Paul Spooren 45b8cb0ce4 mtd: bump package release
This commit fixes "a5107ad58c6 mtd: fix buffer leak and fd leak in mtd_dump()"
which changed the code but did not increase the release. This causes two
packages with the same version to have different content and thereby hashes.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Link: https://github.com/openwrt/openwrt/pull/23827
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-06-16 11:32:52 +02:00
Paul Spooren 353e23dfbc package: make APK embedded help gzip reproducible
APK compresses it's helptext using LUA and require `zlib`, which isn't
available on the Buildbots. It thens falls back to `gzip`, which embeds the
MTIME, making the binary itself unreproducible.

This commits adds a downstream patch to run `gzip` with `-n`, setting the time
to 0.

Link: https://github.com/openwrt/openwrt/pull/23736
Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-10 20:15:15 +02:00
Anna Kiri a5107ad58c mtd: fix buffer leak and fd leak in mtd_dump()
Two leaks in mtd_dump():

- The buffer allocated with malloc(erasesize) is never freed before
  returning, leaking erasesize bytes on every call.
- The pre-existing malloc-NULL early return path also leaked the just-
  opened fd by returning directly instead of going through cleanup.

Initialize buf to NULL, route the malloc-NULL case through the
existing 'out:' label, and add free(buf) on the cleanup path so both
fd and buf are released consistently on every exit.

Signed-off-by: Anna Kiri <bredcorn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23706
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-08 16:18:23 +02:00
Anna Kiri 2818ac5ccd mtd: check malloc() return value in mtd_check()
After malloc(erasesize) in mtd_check(), the result was never checked
for NULL. On allocation failure, the buf pointer remained NULL and
would later be used in image_check() via read(imagefd, buf + buflen,
...), causing a NULL pointer dereference.

Add a NULL check after the allocation and return early. The early
return path also closes the just-opened fd and frees the strdup'd
colon-separated device-list copy to avoid leaks.

Signed-off-by: Anna Kiri <bredcorn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23705
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-08 16:17:42 +02:00