ARC: mm: fix uninitialised signal code in do_page_fault
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Wed, 7 Nov 2018 12:12:49 +0000 (15:12 +0300)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 12 Nov 2018 18:38:27 +0000 (10:38 -0800)
Commit 15773ae938d8 ("signal/arc: Use force_sig_fault where
appropriate") introduced undefined behaviour by leaving si_code
unitiailized and leaking random kernel values to user space.

Fixes: 15773ae938d8 ("signal/arc: Use force_sig_fault where appropriate")
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/mm/fault.c

index c9da6102eb4fba4eb7f79224f826517d8f20e5c1..e2d9fc3fea01e7a93b4e7bb0b16c7b0874d33e5f 100644 (file)
@@ -66,7 +66,7 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
        struct vm_area_struct *vma = NULL;
        struct task_struct *tsk = current;
        struct mm_struct *mm = tsk->mm;
-       int si_code;
+       int si_code = 0;
        int ret;
        vm_fault_t fault;
        int write = regs->ecr_cause & ECR_C_PROTV_STORE;  /* ST/EX */