Re: [GIT PULL] Please pull exec fix for v5.7

From: Linus Torvalds
Date: Tue May 26 2020 - 17:32:32 EST


On Tue, May 26, 2020 at 1:36 PM Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
>
> I don't see us touching cap_ambient anywhere except the line that does:
>
> /* File caps or setid cancels ambient. */
> if (has_fcap || is_setid)
> cap_clear(new->cap_ambient);

That's the one I was thinking of.

I think it would have made more sense to simply initialize it there
and have all accesses to cap_ambient in one place.

The (even better?) alternative would have been to simply just always
re-initialize it in the caller.

If this is about interpreter vs scripts, I really find it confusing
how we make these kinds of re-initializations at the security layer
that doesn't know about one vs the other.. Yes, in your cleanup
branch, the "primary" thing becomes more clear, but it very much is
_not_ clear within the context of this patch.

Hmm?

Linus