udf: fix uninit-value use in udf_get_fileshortad
PATCH 1/1 udf: fix uninit-value use in udf_get_fileshortad
Syzbot reported a udf uninit-value use in udf_get_fileshortad[1]. The uninit-value use occurs when udf_get_fileshortad is called with alen having a negative value and epos->offset being equal to epos->bh->b_size. This check was inserted to mitigate the uninit-value use. After applying the patch reproducer did not trigget any issue[2].
[1] https://syzkaller.appspot.com/bug?extid=8901c4560b7ab5c2f9df
[2] https://syzkaller.appspot.com/x/log.txt?x=133ab69f980000
Reported-by [email protected]
Tested-by [email protected]
Signed-off-by Gianfranco Trad <[email protected]>
--- fs/udf/inode.c | 2 ++ 1 file changed, 2 insertions(+)
fs/udf/inode.c +2 -0
@@ -2222,6 +2222,8 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,switch (iinfo->i_alloc_type) {case ICBTAG_FLAG_AD_SHORT : +if (unlikely (alen <0 && epos->offset == epos->bh->b_size)) +return -1 ; sad =udf_get_fileshortad (ptr, alen, &epos->offset, inc);if (!sad)return -1 ;
Signature · 1 line
2.43.0