+ statistics-infrastructure-fix-buffer-overflow-in-histogram-with-linear.patch added to -mm tree

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

 



The patch titled

     statistics: fix buffer overflow in histogram with linear scale

has been added to the -mm tree.  Its filename is

     statistics-infrastructure-fix-buffer-overflow-in-histogram-with-linear.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: statistics: fix buffer overflow in histogram with linear scale
From: Martin Peschke <mp3@xxxxxxxxxx>

Values outside the range covered by a histogram with linear scale resulted
in invalid indices pointing to non-existing 'buckets'.  Index is adjusted
to array boundaries, if required.

Signed-off-by: Martin Peschke <mp3@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 lib/statistic.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -puN lib/statistic.c~statistics-infrastructure-fix-buffer-overflow-in-histogram-with-linear lib/statistic.c
--- a/lib/statistic.c~statistics-infrastructure-fix-buffer-overflow-in-histogram-with-linear
+++ a/lib/statistic.c
@@ -1028,9 +1028,12 @@ static s64 statistic_histogram_calc_valu
 
 static int statistic_histogram_calc_index_lin(struct statistic *stat, s64 value)
 {
-	unsigned long long i = value - stat->u.histogram.range_min;
+	unsigned long long i;
+	if (value <= stat->u.histogram.range_min)
+		return 0;
+	i = value - stat->u.histogram.range_min;
 	do_div(i, stat->u.histogram.base_interval);
-	return i;
+	return min(i, (unsigned long long)(stat->u.histogram.last_index));
 }
 
 static int statistic_histogram_calc_index_log2(struct statistic *stat,
_

Patches currently in -mm which might be from mp3@xxxxxxxxxx are

tty-switch-to-ktermios-sclp-fix.patch
tty-switch-to-ktermios-3270-fix.patch
statistics-infrastructure-prerequisite-list.patch
statistics-infrastructure-prerequisite-parser.patch
statistics-infrastructure-prerequisite-timestamp.patch
statistics-infrastructure-make-printk_clock-a-generic-kernel-wide-nsec-resolution.patch
statistics-infrastructure-documentation.patch
statistics-infrastructure.patch
statistics-infrastructure-fix-buffer-overflow-in-histogram-with-linear.patch
statistics-use-the-enhanced-percpu-interface.patch
statistics-replace-inode-ugeneric_ip-with-i_private.patch
statistics-infrastructure-exploitation-zfcp.patch
zfcp-gather-hba-specific-latencies-in-statistics.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux