lkml.org 
[lkml]   [2008]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/3] KEYS: Make the keyring quotas controllable through /proc/sys
Date
Andrew Morton <akpm@linux-foundation.org> wrote:

> > #define key_serial(key) ((key) ? (key)->serial : 0)
>
> err, why was that a macro? It could have been implemented as an inline.
> One which doesn't evaluate its argument twice (or once if it was -1).

Probably because the CONFIG_KEYS=n version of key_serial() has to be a macro
(so as to discard key without any attempt at evaluation).

However, that doesn't apply to the CONFIG_KEYS=y case, so I'll whip up a patch
to alter that for you.

> > +#ifdef CONFIG_SYSCTL
> > +extern ctl_table key_sysctls[];
> > +#endif
>
> I've been going around telling people to not bother with the ifdefs here.
> Upside: looks nicer. Downside: defers the build error from compile-time to
> link-time.

Downside #2: the #ifdef is documentation of a sort. Personally, I prefer the
extra #ifdef here as it makes it clearer to someone looking at the .h file why
their code doesn't compile/link rather than them having to know to go fishing
in Makefiles.

> open-coded knowledge of uid==0 might be problematic for containerisation.
> Maybe it's on the containers team's radar, maybe it's actually not a
> problem, don't know. (adds cc).

As I understand it, the same applies to any UID. UID 0/root is typically
special, but I don't know how this is normally handled in alternate containers
for other kernel objects. I can't just go and look at a capability on current
because the quota belongs to the user, not the process.

I have become aware in the last couple of days that the container people
missed or left out keys. Possibly key IDs as well as key quotas should be
separated.

David


\
 
 \ /
  Last update: 2008-03-14 03:47    [W:0.275 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site