Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
u-boot-melea1000.12341
0012-CVE-2019-13106-ext4-fix-out-of-boun.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0012-CVE-2019-13106-ext4-fix-out-of-boun.patch of Package u-boot-melea1000.12341
From 9a5a955a29e011e1392340bdf149e08a1c0f9f69 Mon Sep 17 00:00:00 2001 From: Paul Emge <paulemge@forallsecure.com> Date: Mon, 8 Jul 2019 16:37:07 -0700 Subject: [PATCH] CVE-2019-13106: ext4: fix out-of-bounds memset In ext4fs_read_file in ext4fs.c, a memset can overwrite the bounds of the destination memory region. This patch adds a check to disallow this. This fixes bsc#1144656. Signed-off-by: Paul Emge <paulemge@forallsecure.com> (cherry picked from commit e205896c5383c938274262524adceb2775fb03ba) Signed-off-by: Matthias Brugger <mbrugger@suse.com> --- fs/ext4/ext4fs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c index 9ee2caf2fa..18c7b434a9 100644 --- a/fs/ext4/ext4fs.c +++ b/fs/ext4/ext4fs.c @@ -62,6 +62,7 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos, lbaint_t delayed_skipfirst = 0; lbaint_t delayed_next = 0; char *delayed_buf = NULL; + char *start_buf = buf; short status; if (blocksize <= 0) @@ -131,6 +132,7 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos, } } else { int n; + int n_left; if (previous_block_number != -1) { /* spill */ status = ext4fs_devread(delayed_start, @@ -143,8 +145,9 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos, } /* Zero no more than `len' bytes. */ n = blocksize - skipfirst; - if (n > len) - n = len; + n_left = len - ( buf - start_buf ); + if (n > n_left) + n = n_left; memset(buf, 0, n); } buf += blocksize - skipfirst;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor