udf: Avoid infinite loop when processing indirect ICBs
commit0973cb310090b529264d92fd4f201de1e316c933
authorJan Kara <jack@suse.cz>
Tue, 23 Sep 2014 13:39:05 +0000 (23 14:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Dec 2014 14:16:15 +0000 (13 15:16 +0100)
treea49e40a24235dd738b97b330b66aa2d659f5aab3
parentb77b8578b6924ffbc77279b7856ee1a77232ef5a
udf: Avoid infinite loop when processing indirect ICBs

commit 541d302ee5c46336cbad333222bc278b76cc1c42 upstream

We did not implement any bound on number of indirect ICBs we follow when
loading inode. Thus corrupted medium could cause kernel to go into an
infinite loop, possibly causing a stack overflow.

Fix the possible stack overflow by removing recursion from
__udf_read_inode() and limit number of indirect ICBs we follow to avoid
infinite loops.

Signed-off-by: Jan Kara <jack@suse.cz>
(back ported from commit c03aa9f6e1f938618e6db2e23afef0574efeeb65)
[ luis: adjusted context and replaced udf_err() by printk() ]
CVE-2014-6410
BugLink: http://bugs.launchpad.net/bugs/1370042
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/udf/inode.c