[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87614tr2jd.fsf@x220.int.ebiederm.org>
Date: Wed, 05 Aug 2015 13:52:22 -0500
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@...hat.com>
Cc: "Kirill A. Shutemov" <kirill@...temov.name>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
David Howells <dhowells@...hat.com>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Rik van Riel <riel@...hat.com>,
Vladimir Davydov <vdavydov@...allels.com>,
Ricky Zhou <rickyz@...omium.org>,
Julien Tinnes <jln@...gle.com>
Subject: Re: [PATCH] user_ns: use correct check for single-threadedness
Hmm.
On closer inspection this patch touches on a greater inconsistency then
the test to see if the task is the only task using the mm_struct.
We currently allow tasks created with clone to have a different user
namespace and to share a mm_struct, and I don't think that is wrong.
What we actually care about are the uid and gid values that show up in
signals that are reported to a process, and for that what we care about
is the question do the tasks share signal handling state, which is
controlled by the flags CLONE_SIGHAND and CLONE_THREAD.
As such current_is_single_threaded() is wrong because it tests to see if
there is someone else sharing an mm_struct.
So I have to ask. Is it possible to rework these checks such that we
look at the sighand struct and signal sharing handling sharing instead
of the count on the mm_struct?
I suspect we could do that more cheaply, as well as making the code more
correct.
Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists