Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765616AbXHOI4x (ORCPT ); Wed, 15 Aug 2007 04:56:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757487AbXHOI4m (ORCPT ); Wed, 15 Aug 2007 04:56:42 -0400 Received: from smtp.ustc.edu.cn ([202.38.64.16]:34310 "HELO ustc.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1756774AbXHOI4l (ORCPT ); Wed, 15 Aug 2007 04:56:41 -0400 Message-ID: <387168197.02674@ustc.edu.cn> X-EYOUMAIL-SMTPAUTH: wfg@mail.ustc.edu.cn Date: Wed, 15 Aug 2007 16:56:37 +0800 From: Fengguang Wu To: Andrew Morton Cc: linux-kernel , Al Viro Subject: [PATCH] seqfile: fix uninitialized memory allocation in mounts_open() Message-ID: <20070815085637.GA19293@mail.ustc.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG-Fingerprint: 53D2 DDCE AB5C 8DC6 188B 1CB1 F766 DA34 8D8B 1C6D User-Agent: Mutt/1.5.16 (2007-06-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 778 Lines: 23 proc_mounts.m.buf is not explicitly zeroed at allocation time, which may later confuse the seqfile code and triggle an kfree(m->buf). Signed-off-by: Fengguang Wu --- --- linux.orig/fs/proc/base.c +++ linux/fs/proc/base.c @@ -380,7 +380,7 @@ static int mounts_open(struct inode *ino if (ns) { ret = -ENOMEM; - p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL); + p = kzalloc(sizeof(struct proc_mounts), GFP_KERNEL); if (p) { file->private_data = &p->m; ret = seq_open(file, &mounts_op); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/