CVE-2014-0196: Linux kernel <= v3.15-rc4: raw mode PTY local echo race condition

Címkék

$ gcc cve-2014-0196-md.c -lutil -lpthread
$ ./a.out
[+] Resolving symbols
[+] Resolved commit_creds: 0xffffffff81056694
[+] Resolved prepare_kernel_cred: 0xffffffff810568a7
[+] Doing once-off allocations
[+] Attempting to overflow into a tty_struct...............
[+] Got it :)
# id
uid=0(root) gid=0(root) groups=0(root)

PoC a CVE-2014-0196-hoz itt.

Úgy tűnik, hogy a Ksplice május 7-én letöltötte a megfelelő patchet és menet közben javította a kernelt a támogatott rendszereken:


2014-05-07 16:05:21,586 DEBUG    Downloading [3c3as1pu] CVE-2014-0196: Pseudo TTY device write 
buffer handling race.
2014-05-07 16:05:23,100 DEBUG    Unpacking [3c3as1pu] CVE-2014-0196: Pseudo TTY device write buffer 
handling race.
2014-05-07 16:07:25,896 DEBUG    Already downloaded [3c3as1pu] CVE-2014-0196: Pseudo TTY device write buffer
handling race., skipping
2014-05-07 16:07:27,952 INFO     Install [3c3as1pu] CVE-2014-0196: Pseudo TTY device write buffer
handling race.
2014-05-07 16:07:28,466 INFO     Installing [3c3as1pu] CVE-2014-0196: Pseudo TTY device write buffer
handling race.
2014-05-07 16:07:28,466 DEBUG    dbus: Working on update: INSTALL 2 3 3c3as1pu CVE-2014-0196: Pseudo TTY
device write buffer handling race.
2014-05-07 16:07:28,763 DEBUG    Install [3c3as1pu] CVE-2014-0196: Pseudo TTY device write buffer 
handling race.

Ksplice a CVE-2014-0196 ellen

Hozzászólások

a forráskódban azt írja, hogy "For kernels >= v3.14-rc1"

Jó, tehát akkor jól értem, hogy csak a 3.14-rc1 és 3.15-rc4 közötti kernelek érintettek?

Hogyaszondja:


 * Caveat: The vulnerability should be exploitable all the way from
 * v2.6.31-rc3, however relevant changes to the TTY subsystem were made in
 * commit acc0f67f307f52f7aec1cffdc40a786c15dd21d9 ("tty: Halve flip buffer
 * GFP_ATOMIC memory consumption") that make exploitation simpler, which this
 * exploit relies on.

de azt nem irja hogy ez a commit mikori... ezt mondjuk nem lenne rossz tudni.

Grsecurityvel patchelt kernelek (3.2.x) eseten: no crash, no root access.

Trey, azt aruld mar el, hogy ez milyen disztribucion, milyen kernellel futott le neked. Koszi.

Szerintem nem fér hozzá a kernel szimbólumokhoz, azért esik hasra:
[+] Resolving symbols
[+] Resolved commit_creds: (nil)
[+] Resolved prepare_kernel_cred: (nil)

grep commit_creds /proc/kallsyms
00000000 t __commit_creds
00000000 T commit_creds

grep prepare_kernel_cred /proc/kallsyms
00000000 T prepare_kernel_cred

hardened-sources-3.11.7-r1

Ha valakinek nem fordul le, gondolom az ra tud keresni binarisra a googlen :)

Régen nem arról volt szó, hogy a Linux kernel számozása a Pi-hez fog konvergálni? Akkor mi ez a 3.15? ;)