HFI1: Range-check proc->fd_priv_table[]

sockioctl01.c in LTP calls ioctl(1025, ...) and causes kernel page-fault without
the range-check.

Change-Id: I4117783e20107f274c0857b09745f12a5cc5ce2f
This commit is contained in:
Masamichi Takagi
2018-06-11 14:20:25 +09:00
committed by Balazs Gerofi
parent ca9894108b
commit 6c0bb9e576
3 changed files with 10 additions and 6 deletions

View File

@@ -140,7 +140,7 @@ init_process(struct process *proc, struct process *parent)
#endif /* POSTK_DEBUG_ARCH_DEP_63 */
// Double check the inheritance from parent
memset(proc->fd_priv_table, 0, 256 * sizeof(void *));
memset(proc->fd_priv_table, 0, MAX_FD_PRIV * sizeof(void *));
INIT_LIST_HEAD(&proc->threads_list);
INIT_LIST_HEAD(&proc->children_list);