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]
Date:	Mon, 21 Jun 2010 20:45:47 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	kosaki.motohiro@...fujitsu.com,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-mm <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mempolicy: reduce stack size of migrate_pages()

> >  	const struct cred *cred = current_cred(), *tcred;
> > -	struct mm_struct *mm;
> > +	struct mm_struct *mm = NULL;
> >  	struct task_struct *task;
> > -	nodemask_t old;
> > -	nodemask_t new;
> >  	nodemask_t task_nodes;
> >  	int err;
> > +	NODEMASK_SCRATCH(scratch);
> > +	nodemask_t *old = &scratch->mask1;
> > +	nodemask_t *new = &scratch->mask2;
> >
> > +	if (!scratch)
> > +		return -ENOMEM;
> 
> It doesn't matter in practice, but it makes me all queazy to see code
> which plays with pointers which might be NULL.

I see. thanks.
Do we need to send you updated patch?


> 
> --- a/mm/mempolicy.c~mempolicy-reduce-stack-size-of-migrate_pages-fix
> +++ a/mm/mempolicy.c
> @@ -1279,13 +1279,16 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pi
>  	struct task_struct *task;
>  	nodemask_t task_nodes;
>  	int err;
> +	nodemask_t *old;
> +	nodemask_t *new;
>  	NODEMASK_SCRATCH(scratch);
> -	nodemask_t *old = &scratch->mask1;
> -	nodemask_t *new = &scratch->mask2;
>  
>  	if (!scratch)
>  		return -ENOMEM;
>  
> +	old = &scratch->mask1;
> +	new = &scratch->mask2;
> +
>  	err = get_nodes(old, old_nodes, maxnode);
>  	if (err)
>  		goto out;
> _
> 
> --
> 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/



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