1. 39
    1. 17

      For folks looking for the full advisory, it’s at https://www.qualys.com/2024/01/30/cve-2023-6246/syslog.txt

      1. 9

        Time to rewrite glibc in Rust ???

          1. 6

            that would be relibc

            1. 4

              That would certainly be interesting, and expose a C API that programs can link to. Hell, it would be amazing.

              Nobody actually likes writing C, they cope or write macros instead.

            2. 17

              I’m really tired of these constant flag days where we rediscover that components of everything that are written in C are vulnerable to easily triggerable subtle bugs.

              “No way to prevent this” says users of only programming language where this regularly happens

              When will enough be enough and we start implementing libc in a sane language?

              1. 3

                We can do that, however I’ll claim that not just the implementation but also the interface of libc in general and glibc in parti ular is busted.

                Glibc is a random grab-bag of stuff that was added over the decades, including but not limited to

                • The C standard library (as defined by the C standard)
                • Most (but not all, see -lpthreads) of the POSIX library APIs
                • Linux-specific syscall wrappers
                • Process startup/teardown
                • Dynamic linker support
                • Math

                Do most programs need POSIX collation? Termios? monetary.h??? Why am I pulling in all that crap just to get a fast memset?

                1. 8

                  Suid binaries are evil.

                  They can be run in very different initial conditions, and thus make paths in code that are not designed for this available for execution.

                  Instead of such binaries, one should make services that can be run from root, under well-known initial conditions.

                  In https://stal-ix.github.io / we don’t have any suid binaries in system, even sudo works as ssh client + local ssh daemon.

                  1. 6

                    Or make the suid binary not runnable AT ALL by non wheel group members. There is a NixOS option that does this, which makes sudo exit with an error, handled by the kernel. This solves all suid related vulnerabilities.

                    I’m not sure how it is done on other distros, but it’s security.sudo.execWheelOnly on NixOS: https://github.com/RGBCube/NixOSConfiguration/blob/master/modules%2Fsudo.nix#L17

                    Suid binaries are definitely not evil.

                    1. 3

                      This sounds like it just sets the permissions to rwsr-xr--.

                      1. 4

                        The implementation of execWheelOnly:

                            security.wrappers = let
                              owner = "root";
                              group = if cfg.execWheelOnly then "wheel" else "root";
                              setuid = true;
                              permissions = if cfg.execWheelOnly then "u+rx,g+x" else "u+rx,g+x,o+x";
                            in {
                        

                        So, you seem to be correct.

                    2. 2

                      Is a suid binary a requisite for this flaw to be exploited?

                      1. 11

                        It would be quite unusual for a daemon to be started with an overflowing argv0 by other means.

                        1. 3

                          Not that weird though. For example some services will create per-slice/task/customer processes that change the argv0 to include the identifier.

                          1. 2

                            Thanks for expanding! I found the linked article about light on these details.

                      2. 1

                        Ah, so that would explain why I just saw a glibc update for my Fedora 39 install today.

                        I had wondered what prompted that.