Újabb csendben javított Linux kernel sebezhetőség...

...amelyre már kinn is van egy exploit attól, aki már 3 éve tudott róla.


hunger@hgc ~ $ uname -a
Linux hgc 3.2.43 #1 SMP Sat Apr 27 04:00:32 CEST 2013 x86_64 GNU/Linux
hunger@hgc ~ $ id
uid=1000(hunger) gid=1000(hunger) groups=1000(hunger)
hunger@hgc ~ $ ./a.out
2.6.37-3.x x86_64
2010
hgc ~ # id
uid=0(root) gid=0(root) groups=0(root),1000(hunger)
hgc ~ #

PaX UDEREF/KERNEXEC véd ellene.

https://news.ycombinator.com/item?id=5703758

Hozzászólások

Nofene.


wachag@dreadnought ~ $ uname -a
Linux dreadnought 3.2.0-4-amd64 #1 SMP Debian 3.2.32-1 x86_64 GNU/Linux
wachag@dreadnought ~ $ id
uid=1000(wachag) gid=1000(wachag) csoportok=1000(wachag),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),113(lpadmin),120(sambashare)
wachag@dreadnought ~ $ ./semtex 
2.6.37-3.x x86_64
sd@fucksheep.org 2010
semtex: semtex.c:81: main: Assertion `p = memmem(code, 1024, &needle, 8)' failed.
Félbeszakítva
wachag@dreadnought ~ $ id
uid=1000(wachag) gid=1000(wachag) csoportok=1000(wachag),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),113(lpadmin),120(sambashare)
wachag@dreadnought ~ $ 

Csakugyan. Úgy már igen, ez elkerülte a figyelmem.

Egy laikus kérdés, mivel egyáltalán nem securityvel foglalkozom, viszont felkeltette az érdeklődésemet: miért befolyásolja a gcc optimalizáció szintje az exploit működését? (Vagy: hol lehet ezeknek utánajárni?)

stock 32-bites 2.6.37.6 ill. 3.2.29 kernellel + gcc 4.7.1:

$ gcc -O2 -o semtex semtex.c
semtex.c: In function 'fuck':
semtex.c:30:36: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
semtex.c:30:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
semtex.c:31:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
semtex.c:37:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
semtex.c: In function 'main':
semtex.c:74:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
semtex.c:74:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

$ ./semtex
semtex: semtex.c:51: sheep: Assertion `!close(fd)' failed.
Aborted

Diktatorok kezikonyve

Namost, akkor ez mikor is lett javítva? Mert 3.2.44-en nem tudom reprodukálni, a fenti kollégának meg 3.2.43 van...

3.2.44-ben még nincs javítva, a 3.2.45-ben van, ami tegnap jelent meg.


hunger@hgc ~ $ uname -a
Linux hgc 3.2.44 #1 SMP Fri May 15 08:12:29 CEST 2013 x86_64 GNU/Linux
hunger@hgc ~ $ id
uid=1000(hunger) gid=1000(hunger) groups=1000(hunger)
hunger@hgc ~ $ ./semtex
2.6.37-3.x x86_64
sd@fucksheep.org 2010
hgc ~ # id
uid=0(root) gid=0(root) groups=0(root),1000(hunger)
hgc ~ #

...aki már 3 éve tudott róla.

Engem ez lepett meg, de nagyon.
Felmerül a kérdés: hány ilyen és hasonló lehet/van?

„Nowhere did it say it is a security fix. Fix available since April 13. s () kois not aware too. Awesome. Seriously, surely by now we should all know that silent fixes are not the wisest thing to do.” - Eugene Teo, Linux kernel security team

„An iceberg of evidence is clearly not enough to change this ship's course.” - Michael Gilbert, Debian developer

„I do not think anyone realized it was a "security" fix. It was never mentioned to the security()kernel.org alias, and I only picked it up for the stable releases because someone said, "hey, here's another trinity bugfix that userspace can trigger".” (ROTFL) - Greg Kroah-Hartman, Linux kernel stable maintainer