Re: [PATCH v2] vfs: Tighten up linkat(..., AT_EMPTY_PATH)

From: Linus Torvalds
Date: Thu Aug 22 2013 - 16:54:20 EST


On Thu, Aug 22, 2013 at 1:48 PM, Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
>
> Sure. But aren't they always last?

What do you mean? I'd say that the /proc lookup is always *innermost*.
Which means that it certainly cannot bail out, since there are many
levels of nesting outside of it.

> With the current code structure, trying to enforce some kind of
> security restriction in the middle of lookup seems really unpleasant.

If it's conditional (ie "linkat behaves differently from openat"), it
certainly means that we'd have to pass in that info in annoying ways.

But having unconditional rules like "you can only follow the proc link
if you have CAP_SEARCH _or_ you match the file->f_cred" doesn't sound
too painful.

Linus
--
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/