Re: [PATCH] Expose SHM_HUGETLB in shmctl(id, IPC_STAT, ...)

From: Andrew Morton
Date: Thu Nov 10 2005 - 15:00:02 EST


Arun Sharma <arun.sharma@xxxxxxxxxx> wrote:
>
> Andrew Morton wrote:
>
> >> + shp->shm_flags = (shmflg & (S_IRWXUGO | SHM_HUGETLB));
> > [...]
> > I dunno. The manpage says:
> >
> > The highlighted fields in the member shm_perm can be set:
> >
> > struct ipc_perm {
> > ...
> > ushort mode; /* lower 9 bits of access modes */
> > ...
> > };
> >
> > So if an application used to do:
> >
> > if (perm.mode == 0666)
> >
> > it will now break, because we've gone and set bit 9 on hugetlb segments.
>
> The man page on my system says:
>
> unsigned short mode; /* Permissions + SHM_DEST and
> SHM_LOCKED flags */
>
> I looked for a precendent before sending the patch and thought that
> SHM_LOCKED was a good one.
>

hm, OK. But an app could still do

if (mode == 0666|SHM_LOCKED)


How important is this feature?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/