2009-12-20 18:53:24

by Andi Kleen

[permalink] [raw]
Subject: BKL use in ptrace


Hi,

ptrace has this comment/BKL use:

/*
* This lock_kernel fixes a subtle race with suid exec
*/
lock_kernel();

But unless I'm blind I don't see execve actually getting the BKL
anywhere. So is this comment outdated or misleading (is the race with exit?)
or is there a bug?

Thanks,
-Andi

--
[email protected] -- Speaking for myself only.


2009-12-21 16:09:06

by Oleg Nesterov

[permalink] [raw]
Subject: Re: BKL use in ptrace

(add Roland)

On 12/20, Andi Kleen wrote:
>
> ptrace has this comment/BKL use:
>
> /*
> * This lock_kernel fixes a subtle race with suid exec
> */
> lock_kernel();
>
> But unless I'm blind I don't see execve actually getting the BKL
> anywhere. So is this comment outdated or misleading (is the race with exit?)
> or is there a bug?

I never understood this lock_kernel().

In any case it looks outdated. We were going to kill it "soon",
along with other ptrace changes.

Oleg.

2009-12-22 01:13:47

by Roland McGrath

[permalink] [raw]
Subject: Re: BKL use in ptrace

> I never understood this lock_kernel().
>
> In any case it looks outdated. We were going to kill it "soon",
> along with other ptrace changes.

I never understood it either. It's very ancient and long predates many,
many ptrace cleanups. If the comment was ever accurate, then any issue
like that is now covered by cred_guard_mutex. I don't know of any reason
for (or really, effect of) using BKL in ptrace.


Thanks,
Roland