[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120314003642.GH19584@count0.beaverton.ibm.com>
Date: Tue, 13 Mar 2012 17:36:42 -0700
From: Matt Helsley <matthltc@...ibm.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Cyrill Gorcunov <gorcunov@...nvz.org>,
Matt Helsley <matthltc@...ibm.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Pavel Emelyanov <xemul@...allels.com>,
Kees Cook <keescook@...omium.org>, Tejun Heo <tj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] c/r: prctl: Add ability to set new mm_struct::exe_file v3
On Tue, Mar 13, 2012 at 04:43:37PM +0100, Oleg Nesterov wrote:
>
> Matt, is it really possible to hit mm->exe_file = NULL in
> removed_exe_file_vma ? Unless I missed something, this check just
> hides the potentional problem, no?
>
> IOW, shouldn't it do
>
> void removed_exe_file_vma(struct mm_struct *mm)
> {
> WARN_ON(!mm->exe_file);
> WARN_ON(mm->num_exe_file_vmas <= 0);
>
> if (!--mm->num_exe_file_vmas) {
> fput(mm->exe_file);
> mm->exe_file = NULL;
> }
> }
>
> ?
I think you're spot-on about hiding the problem. I'm not sure the
WARN_ON() would be welcome in the mm's VMA paths though.
Also, it's a nit but I'd keep the decrement out of the condition like in
the original.
Cheers,
-Matt
--
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