Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jul 2014 14:08:01 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268766 - head/sys/fs/tmpfs
Message-ID:  <201407161408.s6GE81WR004569@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Jul 16 14:08:01 2014
New Revision: 268766
URL: http://svnweb.freebsd.org/changeset/base/268766

Log:
  Do not ignore error from tmpfs_alloc_vp().  It results in access to
  the random memory.
  
  Reported and tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c	Wed Jul 16 14:06:16 2014	(r268765)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c	Wed Jul 16 14:08:01 2014	(r268766)
@@ -185,7 +185,9 @@ tmpfs_lookup(struct vop_cachedlookup_arg
 				cnp->cn_flags |= SAVENAME;
 			} else {
 				error = tmpfs_alloc_vp(dvp->v_mount, tnode,
-						cnp->cn_lkflags, vpp);
+				    cnp->cn_lkflags, vpp);
+				if (error != 0)
+					goto out;
 			}
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407161408.s6GE81WR004569>