From: Greg Kroah-Hartman Date: Sun, 11 Nov 2018 18:14:23 +0000 (-0800) Subject: 3.18-stable patches X-Git-Tag: v4.19.2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=628a1c94cd6f0b080212d1104ed486bf6f69cdeb;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: cramfs-fix-abad-comparison-when-wrap-arounds-occur.patch --- diff --git a/queue-3.18/cramfs-fix-abad-comparison-when-wrap-arounds-occur.patch b/queue-3.18/cramfs-fix-abad-comparison-when-wrap-arounds-occur.patch new file mode 100644 index 00000000000..6640fe43a26 --- /dev/null +++ b/queue-3.18/cramfs-fix-abad-comparison-when-wrap-arounds-occur.patch @@ -0,0 +1,34 @@ +From 672ca9dd13f1aca0c17516f76fc5b0e8344b3e46 Mon Sep 17 00:00:00 2001 +From: Nicolas Pitre +Date: Tue, 30 Oct 2018 13:26:15 -0400 +Subject: Cramfs: fix abad comparison when wrap-arounds occur + +From: Nicolas Pitre + +commit 672ca9dd13f1aca0c17516f76fc5b0e8344b3e46 upstream. + +It is possible for corrupted filesystem images to produce very large +block offsets that may wrap when a length is added, and wrongly pass +the buffer size test. + +Reported-by: Anatoly Trosinenko +Signed-off-by: Nicolas Pitre +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cramfs/inode.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/cramfs/inode.c ++++ b/fs/cramfs/inode.c +@@ -185,7 +185,8 @@ static void *cramfs_read(struct super_bl + continue; + blk_offset = (blocknr - buffer_blocknr[i]) << PAGE_CACHE_SHIFT; + blk_offset += offset; +- if (blk_offset + len > BUFFER_SIZE) ++ if (blk_offset > BUFFER_SIZE || ++ blk_offset + len > BUFFER_SIZE) + continue; + return read_buffers[i] + blk_offset; + } diff --git a/queue-3.18/series b/queue-3.18/series index 2e13fa805af..0e01a12b3d3 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -52,3 +52,4 @@ kgdboc-passing-ekgdboc-to-command-line-causes-panic.patch media-em28xx-use-a-default-format-if-try_fmt-fails.patch media-em28xx-fix-input-name-for-terratec-av-350.patch media-em28xx-make-v4l2-compliance-happier-by-starting-sequence-on-zero.patch +cramfs-fix-abad-comparison-when-wrap-arounds-occur.patch