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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090920180427.GA32176@lenovo>
Date:	Sun, 20 Sep 2009 22:04:27 +0400
From:	Cyrill Gorcunov <gorcunov@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Pekka J Enberg <penberg@...helsinki.fi>,
	Vegard Nossum <vegard.nossum@...il.com>,
	linux-kernel@...r.kernel.org, Eric Paris <eparis@...hat.com>,
	hugh.dickins@...cali.co.uk
Subject: Re: shmem_fill_super(): WARNING: kmemcheck: Caught 32-bit read
	from uninitialized memory

[Ingo Molnar - Sun, Sep 20, 2009 at 07:58:03PM +0200]
...
| 
| > [    0.408000] initcall init_mmap_min_addr+0x0/0x10 returned 0 after 0 usecs
| >
| > Reported-by: Ingo Molnar <mingo@...e.hu>
| > Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
| > ---
| >  mm/shmem.c |    5 +----
| >  1 files changed, 1 insertions(+), 4 deletions(-)
| >
| > diff --git a/mm/shmem.c b/mm/shmem.c
| > index d713239..a8f54f3 100644
| > --- a/mm/shmem.c
| > +++ b/mm/shmem.c
| > @@ -2307,17 +2307,14 @@ static int shmem_fill_super(struct super_block *sb,
| >  	int err = -ENOMEM;
| >
| >  	/* Round up to L1_CACHE_BYTES to resist false sharing */
| > -	sbinfo = kmalloc(max((int)sizeof(struct shmem_sb_info),
| > +	sbinfo = kzalloc(max((int)sizeof(struct shmem_sb_info),
| >  				L1_CACHE_BYTES), GFP_KERNEL);
| >  	if (!sbinfo)
| >  		return -ENOMEM;
| >
| > -	sbinfo->max_blocks = 0;
| > -	sbinfo->max_inodes = 0;
| >  	sbinfo->mode = S_IRWXUGO | S_ISVTX;
| >  	sbinfo->uid = current_fsuid();
| >  	sbinfo->gid = current_fsgid();
| > -	sbinfo->mpol = NULL;
| >  	sb->s_fs_info = sbinfo;
| 
| That looks like a step forward even without kmemcheck considered, right?
| 
| 	Ingo

Yeah, and we save a few cpu cycles as well :)

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