From: Bobi Jam Date: Sun, 27 Apr 2014 17:07:11 +0000 (-0400) Subject: staging/lustre/llite: prevent buffer overflow in fiemap X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~36^2~1119 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebdc4fc54d5defaa20417eabeb7a8d7b400fd53c;p=pandora-kernel.git staging/lustre/llite: prevent buffer overflow in fiemap lov_fiemap() does not take consider its @vallen parameter, which is the max buffer size the caller can hold for the fiemap extents. This patch fixes this and limits the max mapped fiemap extent count to fit in the preallocted buffer. This patch also fixes a memory out of bound write issue when the fiemap call is only for detecting the number of existing extent. Signed-off-by: Bobi Jam Reviewed-on: http://review.whamcloud.com/9834 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4619 Reviewed-by: Fan Yong Reviewed-by: Patrick Farrell Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed