Re: [PATCH 1/2] CRED: Rename cred_exec_mutex to reflect that it'sa guard against ptrace

From: Oleg Nesterov
Date: Sat May 09 2009 - 15:05:36 EST


Sorry for delay,

On 05/08, David Howells wrote:
>
> @@ -185,10 +185,11 @@ int ptrace_attach(struct task_struct *task)
> if (same_thread_group(task, current))
> goto out;
>
> - /* Protect exec's credential calculations against our interference;
> - * SUID, SGID and LSM creds get determined differently under ptrace.
> + /* Protect the target's credential calculations against our
> + * interference; SUID, SGID and LSM creds get determined differently
> + * under ptrace.
> */
> - retval = mutex_lock_interruptible(&task->cred_exec_mutex);
> + retval = mutex_lock_interruptible(&task->cred_guard_mutex);
> if (retval < 0)
> goto out;
>
> @@ -232,7 +233,7 @@ repeat:
> bad:
> write_unlock_irqrestore(&tasklist_lock, flags);
> task_unlock(task);
> - mutex_unlock(&task->cred_exec_mutex);
> + mutex_unlock(&task->cred_guard_mutex);

This rename is obviously fine, but conflicts with
ptrace-do-not-use-task_lock-for-attach.patch in -mm tree:

-bad:
- write_unlock_irqrestore(&tasklist_lock, flags);
- task_unlock(task);
+unlock_tasklist:
+ write_unlock_irq(&tasklist_lock);
+unlock_creds:
mutex_unlock(&task->cred_exec_mutex);
out:
return retval;


Hmm. Ingo's "rename ptrace_may_access => ptrace_access_check" conflicts
with my patch too.


Andrew, Roland, I guess I should re-send

ptrace-ptrace_attach-check-pf_kthread-exit_state-instead-of-mm.patch
ptrace-cleanup-check-set-of-pt_ptraced-during-attach.patch
ptrace-do-not-use-task_lock-for-attach.patch

patches?

Oleg.

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