🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
2 messages
2 total messages Started by Marc Haber Mon, 23 Nov 2026 12:40
Bug#1154725: sudo segfault
#5737
Author: Marc Haber
Date: Mon, 23 Nov 2026 12:40
43 lines
4633 bytes
This is totally unreadable, please reformat for a human.

On Mon, Nov 23, 2026 at 01:33:22PM +0100, Michael Kriese wrote:
>Control: tags -1 - unreproducible Hi, this is reproducible in a stock 
>container, no custom sudoers needed: docker run --rm -it debian:trixie 
>bash apt-get update && apt-get install -y sudo # 1.9.16p2-3+deb13u5 
>env -i /usr/bin/sudo true # Segmentation fault, exit 139 - Crashes as 
>root and as an unprivileged user with an empty environment. - Works 
>with at least one variable set (e.g. env -i PATH=/usr/bin sudo true). 
>- Works with 1.9.16p2-3+deb13u2. Cause: 
>0013-Copy-envp-submit_envp-instead-of-replacing-the-envir.patch only 
>assigns submit_envp inside `if (envc != 0)`. With an empty environment 
>it stays NULL (static initializer) instead of pointing to an empty 
>array as before (submit_envp = envp), and the NULL envp is passed to 
>sudoers.so, which matches the "segfault at 0 ... in sudoers.so" in the 
>original report. Upstream main (src/sudo.c, os_init_common) has the 
>same code, so this is not specific to the backport. Fix proposed 
>upstream: https://github.com/sudo-project/sudo/pull/604 Verified: 
>rebuilt 1.9.16p2-3+deb13u5 with it in debian:trixie, env -i sudo
>true then exits 0 as root and as an unprivileged user. The same change 
>applies to the Debian patch: --- a/src/sudo.c +++ b/src/sudo.c @@ 
>os_init_common for (envc = 0; envp[envc] != NULL; envc++) continue; - 
>if (envc != 0) { - submit_envp = reallocarray(NULL, sizeof(char *), 
>envc + 1); - if (submit_envp == NULL || !gc_add(GC_PTR, submit_envp)) 
>{ - sudo_fatalx_nodebug(U_("%s: %s"), __func__, - U_("unable to 
>allocate memory")); - } - for (envc = 0; envp[envc] != NULL; envc++) - 
>submit_envp[envc] = envp[envc]; - submit_envp[envc] = NULL; - } + 
>submit_envp = reallocarray(NULL, sizeof(char *), envc + 1); + if 
>(submit_envp == NULL || !gc_add(GC_PTR, submit_envp)) { + 
>sudo_fatalx_nodebug(U_("%s: %s"), __func__, + U_("unable to allocate 
>memory")); + } + for (envc = 0; envp[envc] != NULL; envc++) + 
>submit_envp[envc] = envp[envc]; + submit_envp[envc] = NULL; Impact: 
>anything calling sudo with an empty environment breaks, e.g. the 
>Forgejo runner's LXC backend (CI of forgejo/end-to-end) and Allsky 
>(https://github.com/AllskyTeam/allsky/issues/5668). Regards, Michael 
>-- Drafted by Claude Code (Claude Opus 5.5, low effort) on behalf of 
>Michael Kriese.

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421
Bug#1154725: sudo segfault
#5741
Author: Marc Haber
Date: Mon, 23 Nov 2026 12:50
36 lines
3097 bytes
Control: found -1 1.9.17p2-11
Control: tags -1 confirmed upstream
Control: tags -1 - unreproducible
Control: forwarded -1 https://www.sudo.ws/pipermail/sudo-workers/2026-November/001434.html

[severity important is still appropriate, I think)

On Mon, Nov 23, 2026 at 01:37:09PM +0100, Marc Haber wrote:
>This is totally unreadable, please reformat for a human.

Never mind.

The gist from this wall of ai slop is that sudo - even the version we 
have in unstable - segfaults when called with an empty environment.

sudo: a password is required
| [4/5253]mh@swivel:~ $ sudo -V
| Sudo version 1.9.17p2
| Sudoers policy plugin version 1.9.17p2
| Sudoers file grammar version 50
| Sudoers I/O plugin version 1.9.17p2
| Sudoers audit plugin version 1.9.17p2
| [5/5254]mh@swivel:~ $ env -i sudo id
| Segmentation fault         env -i sudo id
| [6/5254]mh@swivel:~ $

THIS is what I can work with!

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads