]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.8.4/ext3-fix-format-string-issues.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.8.4 / ext3-fix-format-string-issues.patch
1 From 8d0c2d10dd72c5292eda7a06231056a4c972e4cc Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Sat, 9 Mar 2013 15:28:44 +0100
4 Subject: ext3: Fix format string issues
5
6 From: Lars-Peter Clausen <lars@metafoo.de>
7
8 commit 8d0c2d10dd72c5292eda7a06231056a4c972e4cc upstream.
9
10 ext3_msg() takes the printk prefix as the second parameter and the
11 format string as the third parameter. Two callers of ext3_msg omit the
12 prefix and pass the format string as the second parameter and the first
13 parameter to the format string as the third parameter. In both cases
14 this string comes from an arbitrary source. Which means the string may
15 contain format string characters, which will
16 lead to undefined and potentially harmful behavior.
17
18 The issue was introduced in commit 4cf46b67eb("ext3: Unify log messages
19 in ext3") and is fixed by this patch.
20
21 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
22 Signed-off-by: Jan Kara <jack@suse.cz>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 fs/ext3/super.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29 --- a/fs/ext3/super.c
30 +++ b/fs/ext3/super.c
31 @@ -353,7 +353,7 @@ static struct block_device *ext3_blkdev_
32 return bdev;
33
34 fail:
35 - ext3_msg(sb, "error: failed to open journal device %s: %ld",
36 + ext3_msg(sb, KERN_ERR, "error: failed to open journal device %s: %ld",
37 __bdevname(dev, b), PTR_ERR(bdev));
38
39 return NULL;
40 @@ -887,7 +887,7 @@ static ext3_fsblk_t get_sb_block(void **
41 /*todo: use simple_strtoll with >32bit ext3 */
42 sb_block = simple_strtoul(options, &options, 0);
43 if (*options && *options != ',') {
44 - ext3_msg(sb, "error: invalid sb specification: %s",
45 + ext3_msg(sb, KERN_ERR, "error: invalid sb specification: %s",
46 (char *) *data);
47 return 1;
48 }