Re: shm in 2.1.125

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sat, 10 Oct 1998 21:02:17 +0100 (BST)


> since shm_npages in shmid_ds is unsigned short we can at most allocate
> 65535 pages. This is not noted by shmget which happily gives you a
> segment for e.g. 256M = 65536 pages. But the following shmat will see
> 0 pages for the segment and the application will get nothing (but a
> seg-fault ;-). Worse: on deletion the total count for shm pages will
> be decreased by also 0. So following allocations fail after a while.
>
> Since shmid_ds is shared with user space we cannot change it easily.

I don't see a big problem actually. The field in question is private to
the kernel and thus not exported. So the kernel version can change if a bit of
care is taken about structures

I think take the private stuff out of shmid_ds and create

struct kern_shmid_ds
{
struct shmid_ds d;
[private fields]
}

Does the trick ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/