syscalls/fork14: Fix Buffer overflow
PATCH 1/1 syscalls/fork14: Fix Buffer overflow
This change basically avoids the buffer overflow by keeping the check count to allocation limit
The problem occurs when there is no failure and i == EXTENT, so pointer_vec[EXTENT] goes beyond the allocated buffer.
Signed-off-by Vikas Kumar <[email protected]>
Reported-by Amit Kachhap <[email protected]>
--- testcases/kernel/syscalls/fork/fork14.c | 3 +++ 1 file changed, 3 insertions(+)
testcases/kernel/syscalls/fork/fork14.c +3 -0
@@ -132,6 +132,9 @@ static int fork_test(void) } } +if (i ==EXTENT ) + i--; + clear_memory_map:for (j =0 ; j <= i; j++) {if (pointer_vec[j])
Signature · 1 line
2.17.1
PATCH 1/1 syscalls/fork14: Fix Buffer overflow
----- Original Message -----
Quoted 4 lines
This change basically avoids the buffer overflow by keeping the check count to allocation limit
The problem occurs when there is no failure and i == EXTENT, so pointer_vec[EXTENT] goes beyond the allocated buffer.
I changed the patch to use a new variable, that reflects number of used fields, and pushed.
Thanks,
Jan