lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080310091321.GA9452@elte.hu>
Date:	Mon, 10 Mar 2008 10:13:21 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	WANG Cong <xiyou.wangcong@...il.com>
Cc:	linux-kernel@...r.kernel.org, gvaughan@....nasa.gov, akpm@...l.org,
	jeremy@...p.org
Subject: Re: [PATCH] Fix check after use in kernel/exit.c


* WANG Cong <xiyou.wangcong@...il.com> wrote:

> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -583,8 +583,6 @@ static void exit_mm(struct task_struct * tsk)
>  	struct mm_struct *mm = tsk->mm;
>  
>  	mm_release(tsk, mm);
> -	if (!mm)
> -		return;

> @@ -464,6 +464,8 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
>  {
>  	struct completion *vfork_done = tsk->vfork_done;
>  
> +	if (!mm)
> +		return;
>  	/* Get rid of any cached register state */
>  	deactivate_mm(tsk, mm);

no, this is buggy in the same way - we wont do a deactivate_mm() for 
kernel threads. The check should be left alone in exit_mm(), we should 
at most add a check for NULL mm to this place:

        if (tsk->clear_child_tid
            && !(tsk->flags & PF_SIGNALED)
            && atomic_read(&mm->mm_users) > 1) {

but ... can mm in fact ever be NULL if tsk->clear_child_tid is set?

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ