Closed Kreyren closed 7 months ago
Thanks for the report!
I can reproduce this. The SysLogWriter
in src/log/syslog.rs
incorrectly handles large messages.
I will make a PR to fix this.
Seems like the write_str
assumed that self.cursor
is always 0 upon entry; probably introduced when this was function was moved into an impl Write
. Interesting bug. We should probably consider rewriting this code in a more Rust-style (something taking an iterator of Char
and turning that into Lines
iterator or something) in the future, but better to just patch it. Line 53 in syslog.rs
looks suspect to me (shouldn't that be let mut mid = LIMIT - self.cursor
?)
Note, in a non-memory safe language this would have been a nice buffer overflow, so I'm slapping the appropriate label on it :)
Fixed due to #825.
CC @nbraud (The sudo-rs package maintainer in NixOS) - Please backport to stable release, thanks!
Sorry @Kreyren, I wasn't around due to health issues, so I'm only catching up to things now. I agree this should still be fixed in NixOS 23.11 though, and initiated a backport PR
PS: Done :tada:
Sorry @Kreyren, I wasn't around due to health issues, so I'm only catching up to things now. I agree this should still be fixed in NixOS 23.11 though, and initiated a backport PR
np i ain't doing great myself rn either x.x Get well soon and thanks for working on this!
np i ain't doing great myself rn either x.x Get well soon and thanks for working on this!
Thanks, and hopefully things look up for you :purple_heart:
Describe the bug
sudor-rs panics in some situations when called from pmbootstrap:
https://github.com/memorysafety/sudo-rs/blob/main/src/log/syslog.rs#L36
To Reproduce
Hard to reproduce
Expected behavior
Do not complicate development
Done behavior
Switch back on
sudo
and report this issueEnvironment (please complete the following information)
sudo-rs
commit hash: https://github.com/NixOS/nixpkgs/blob/nixos-23.11/pkgs/tools/security/sudo-rs/default.nix#L20