[PATCH 38/36] xfs_io: don't read garbage stack contents if INUMBERS goes nuts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

In theory INUMBERS will never return an ocount of zero, but on the off
chance it ever does we'll negative index the igroup array and return
stack contents for an inode number.  Don't do that.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 io/open.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/io/open.c b/io/open.c
index f5fbd2c4..a406ea54 100644
--- a/io/open.c
+++ b/io/open.c
@@ -698,6 +698,9 @@ get_last_inode(void)
 		lastgrp = ocount;
 	}
 
+	if (lastgrp == 0)
+		return 0;
+
 	lastgrp--;
 
 	/* The last inode number in use */



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux