Re: Linux 2.2.19pre10

From: Richard A Nelson (
Date: Mon Feb 12 2001 - 13:00:24 EST

On Mon, 12 Feb 2001, Alan Cox wrote:

> 2.2.19pre10
> o Revert shm change - its unsafe (Richard Nelson)
> [...]
> 2.2.19pre3
> o Fix IPC_RMID behaviour (Christoph Rohland)


First, I'm glad I wasn't hallucinating, and that the mail did indeed get
seen by someone.

Second, instead of reverting, can't we simply move those two lines up a
        case IPC_RMID:
                if (current->euid == shp->u.shm_perm.uid ||
                    current->euid == shp->u.shm_perm.cuid ||
                    capable(CAP_SYS_ADMIN)) {
                        shp->u.shm_perm.mode |= SHM_DEST;
+ /* Do not find it any more */
+ shp->shm_perm.key = IPC_PRIVATE;
                        if (shp->u.shm_nattch <= 0)
                                killseg (id);

This way, we're not violating specs, programs work, *and* we're not
touching freshly kfree()d storage?

Rick Nelson
DOS: n., A small annoying boot virus that causes random spontaneous system
     crashes, usually just before saving a massive project.  Easily cured by
     UNIX.  See also MS-DOS, IBM-DOS, DR-DOS.
(from David Vicker's .plan)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Feb 15 2001 - 21:00:19 EST