diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-15 14:04:30 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-15 14:04:30 +0200 |
commit | 1335be82768204325323bc9b34601b79c7b47aaf (patch) | |
tree | 08c6fbf30c877e70c0881b6ba46141bd93c3ed66 /sys/src/9/port/fault.c | |
parent | 2f732e9a850f5549b391072cd6dd13ea4b0a8185 (diff) |
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.
Diffstat (limited to 'sys/src/9/port/fault.c')
0 files changed, 0 insertions, 0 deletions