plan9fox/sys
cinap_lenrek 1335be8276 swap: track swap pages with > 255 references, setswapchan() swapimage.c
swaped pages use a 8bit refcount where as the Page uses a 16bit one.
this might be exploited with having a process having a single page
swaped out and then forking 255 times to make the swap map refcount
overflow and panic the kernel.

this condition is probably very rare. so instead of doubling the
size of the swap map, we add a single 32bit refcount swapalloc.xref
which will keep the combined refcount of all swap map entries who
exceeded 255 references.

zero swapimage.c in setswapchan() after closing it as the stat() call
below might error leaving a dangeling pointer.
2012-10-15 14:04:30 +02:00
..
doc /sys/doc: remove autogenerated postscript files 2012-06-06 22:28:48 +02:00
games/lib fortunes 2012-10-08 22:14:19 +02:00
include Add alignment hints for e512 ATA drives. 2012-09-09 17:22:12 +12:00
lib /sys/lib/acid/kernel: fix imagecache() and procenv() 2012-10-09 03:52:18 +02:00
man update fshalt(8) manpage 2012-10-14 13:33:10 +02:00
src swap: track swap pages with > 255 references, setswapchan() swapimage.c 2012-10-15 14:04:30 +02:00