Unoffical patch for the 'ShareDream' - shared memory IPC vulnerability
17 Sep. 1999
Summary
In our previous article: Shared memory Denial of Service we discussed the existence of a vulnerability that allows local users to cause a Denial of Service attack against a UNIX machine by creating a large amount of shared memory which fills out the entire memory segment, this vulnerability can be patched for by applying the patch below. Note that this patch is not an official patch by the writers of the product.
Below is a trivial Linux-2.2.12 patch which adds a procfs entry for tuning the limit of shared memory allocable.
/proc/sys/kernel/shmmax Max number of shared memory pages
Below is also a small hack for freeing unreferenced shared memory pages and printing interesting details of available shared memory segments (such as who created the segment, and when).