syscalls/chdir/chdir04.c: fix out-of-bounds write
PATCH 1/1 syscalls/chdir/chdir04.c: fix out-of-bounds write
When UCLINUX is defined, line 156 will write to the TC[2].dname:
#ifdef UCLINUX
[...]
TC[2].dname = bad_addr;
#endifHowever, TC[2] won't exist as it's only initialized when UCLINUX is not defined and length of TC is implicit. Remove "#ifndef UCLINUX" around initializer for TC[2].
Signed-off-by Tobias Jordan <[email protected]>
---
original posted as github PR:
https://github.com/linux-test-project/ltp/pull/543
testcases/kernel/syscalls/chdir/chdir04.c | 2 -- 1 file changed, 2 deletions(-)
testcases/kernel/syscalls/chdir/chdir04.c +0 -2
@@ -83,14 +83,12 @@ struct test_case_t {*/ { noexist_dir, ENOENT}, -#ifndef UCLINUX /* * to test whether chdir() is setting EFAULT if the * directory is an invalid address. */ { (void *)-1, EFAULT} -#endif };int TST_TOTAL =ARRAY_SIZE (TC );
Signature · 1 line
2.11.0
PATCH 1/1 syscalls/chdir/chdir04.c: fix out-of-bounds write
Hi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]