Bug 921 - *** Error in `sudoreplay': double free or corruption (!prev): 0x0000562f4f6fb270 ***
*** Error in `sudoreplay': double free or corruption (!prev): 0x0000562f4f6fb...
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudoreplay
1.8.16
PC Linux
: low high
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-08 16:11 MDT by Rocky
Modified: 2020-05-21 16:25 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rocky 2020-04-08 16:11:37 MDT
sudoreplay --version
sudoreplay version 1.8.16
 dpkg -l | egrep -i sudo
ii  sudo                             1.8.16-0ubuntu1.9                          
amd64        Provide limited super user privileges to specific users


When replaying certain sudo logs with sudo replay we can consistently cause a double free error.  They all seem to involve the output of a `salt-call state.highstate` utilizing saltstack.

Filing this as 'high' since usually those can lead to trouble, feel free to downgrade if needed.  Stack trace below

sudo sudoreplay -s3 -m1 00000G
.....
Redacted
....
.....Function: file.absent - R*** Error in `sudoreplay': double free or corruption (!prev): 0x0000562f4f6fb270 ***
                                                                                                                                                             ======= Backtrace: =========
                                                                                                                                                                                         /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fc7f7ed87e5]
                                                                                                                                                                                                                                                  /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fc7f7ee137a]
                                                                                                                                                                                                                                                                                                           /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fc7f7ee553c]
                                        sudoreplay(+0x3b6b)[0x562f4ed9eb6b]
                                                                           /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fc7f7e81830]
                                                                                                                                                  sudoreplay(+0x3fe9)[0x562f4ed9efe9]
                                                                                                                                                                                     ======= Memory map: ========
                                                                                                                                                                                                                 562f4ed9b000-562f4eda5000 r-xp 00000000 ca:01 8059                       /usr/bin/sudoreplay
                                                                                                                                                                                                                                                                                                             562f4efa4000-562f4efa6000 r--p 00009000 ca:01 8059                       /usr/bin/sudoreplay
                                                                           562f4efa6000-562f4efa7000 rw-p 0000b000 ca:01 8059                       /usr/bin/sudoreplay
                                                                                                                                                                       562f4f6f8000-562f4f719000 rw-p 00000000 00:00 0                          [heap]
                                                                                                                                                                                                                                                      7fc7f0000000-7fc7f0021000 rw-p 00000000 00:00 0
                                                                                                                                                                                                                                                                                                      7fc7f0021000-7fc7f4000000 ---p 00000000 00:00 0
                        7fc7f7a47000-7fc7f7a5d000 r-xp 00000000 ca:01 1963                       /lib/x86_64-linux-gnu/libgcc_s.so.1
                                                                                                                                    7fc7f7a5d000-7fc7f7c5c000 ---p 00016000 ca:01 1963                       /lib/x86_64-linux-gnu/libgcc_s.so.1
                                                                                                                                                                                                                                                7fc7f7c5c000-7fc7f7c5d000 rw-p 00015000 ca:01 1963                       /lib/x86_64-linux-gnu/libgcc_s.so.1
                              7fc7f7c5d000-7fc7f7c60000 r-xp 00000000 ca:01 29471                      /lib/x86_64-linux-gnu/libdl-2.23.so
                                                                                                                                          7fc7f7c60000-7fc7f7e5f000 ---p 00003000 ca:01 29471                      /lib/x86_64-linux-gnu/libdl-2.23.so
                                                                                                                                                                                                                                                      7fc7f7e5f000-7fc7f7e60000 r--p 00002000 ca:01 29471                      /lib/x86_64-linux-gnu/libdl-2.23.so
                                    7fc7f7e60000-7fc7f7e61000 rw-p 00003000 ca:01 29471                      /lib/x86_64-linux-gnu/libdl-2.23.so
                                                                                                                                                7fc7f7e61000-7fc7f8021000 r-xp 00000000 ca:01 29525                      /lib/x86_64-linux-gnu/libc-2.23.so
                                                                                                                                                                                                                                                           7fc7f8021000-7fc7f8221000 ---p 001c0000 ca:01 29525                      /lib/x86_64-linux-gnu/libc-2.23.so
                                        7fc7f8221000-7fc7f8225000 r--p 001c0000 ca:01 29525                      /lib/x86_64-linux-gnu/libc-2.23.so
                                                                                                                                                   7fc7f8225000-7fc7f8227000 rw-p 001c4000 ca:01 29525                      /lib/x86_64-linux-gnu/libc-2.23.so
                                                                                                                                                                                                                                                              7fc7f8227000-7fc7f822b000 rw-p 00000000 00:00 0
                                                                                                                                                                                                                                                                                                              7fc7f822b000-7fc7f823d000 r-xp 00000000 ca:01 7488                       /usr/lib/sudo/libsudo_util.so.0.0.0
                                                                                            7fc7f823d000-7fc7f843d000 ---p 00012000 ca:01 7488                       /usr/lib/sudo/libsudo_util.so.0.0.0
                                                                                                                                                                                                        7fc7f843d000-7fc7f843e000 r--p 00012000 ca:01 7488                       /usr/lib/sudo/libsudo_util.so.0.0.0
                                                                                                                                                                                                                                                                                                                    7fc7f843e000-7fc7f843f000 rw-p 00013000 ca:01 7488                       /usr/lib/sudo/libsudo_util.so.0.0.0
                                                                                                  7fc7f843f000-7fc7f8465000 r-xp 00000000 ca:01 29473                      /lib/x86_64-linux-gnu/ld-2.23.so
                                                                                                                                                                                                           7fc7f84c1000-7fc7f8659000 r--p 00000000 ca:01 6629                       /usr/lib/locale/locale-archive
                                                                                                                                                                                                                                                                                                                  7fc7f8659000-7fc7f865c000 rw-p 00000000 00:00 0
                                    7fc7f8662000-7fc7f8664000 rw-p 00000000 00:00 0
                                                                                    7fc7f8664000-7fc7f8665000 r--p 00025000 ca:01 29473                      /lib/x86_64-linux-gnu/ld-2.23.so
                                                                                                                                                                                             7fc7f8665000-7fc7f8666000 rw-p 00026000 ca:01 29473                      /lib/x86_64-linux-gnu/ld-2.23.so
                                                                                                                                                                                                                                                                                                      7fc7f8666000-7fc7f8667000 rw-p 00000000 00:00 0
                        7ffd24010000-7ffd24031000 rw-p 00000000 00:00 0                          [stack]
                                                                                                        7ffd2408d000-7ffd2408f000 r--p 00000000 00:00 0                          [vvar]
                                                                                                                                                                                       7ffd2408f000-7ffd24091000 r-xp 00000000 00:00 0                          [vdso]
                                                                                                                                                                                                                                                                      ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
                           Aborted (core dumped)
[1]    21722 abort (core dumped)  sudo sudoreplay -s3 -m1 00000G
Comment 1 Todd C. Miller 2020-04-08 16:48:54 MDT
That version of sudo is over four years ago but I'm fairly certain this was fixed by the following commit:

https://www.sudo.ws/repos/sudo/rev/5112f514af87
Comment 2 Rocky 2020-04-08 17:15:41 MDT
awseome, couldn't find it anywhere in the bug reports or the googling.

yeah, we are sadly on xenial for the next minute :(