Date: Sat, 31 Oct 2020 17:26:57 +0000 (UTC) From: Michal Meloun <mmel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367227 - stable/12/sys/arm/arm Message-ID: <202010311726.09VHQvNx074525@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmel Date: Sat Oct 31 17:26:56 2020 New Revision: 367227 URL: https://svnweb.freebsd.org/changeset/base/367227 Log: MFC r366197: Don't send a signal with uninitialized 'sig' and 'code' fields. We have a few shortcuts in the arm trap code to speed up obvious "must fail" cases. In these situations, make sure that we fill in the "sig" and "code" fields of the generated signal. Modified: stable/12/sys/arm/arm/trap-v6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/trap-v6.c ============================================================================== --- stable/12/sys/arm/arm/trap-v6.c Sat Oct 31 17:18:18 2020 (r367226) +++ stable/12/sys/arm/arm/trap-v6.c Sat Oct 31 17:26:56 2020 (r367227) @@ -462,8 +462,11 @@ abort_handler(struct trapframe *tf, int prefetch) /* * Don't allow user-mode faults in kernel address space. */ - if (usermode) + if (usermode) { + ksig.sig = SIGSEGV; + ksig.code = SEGV_ACCERR; goto nogo; + } map = kernel_map; } else { @@ -472,8 +475,11 @@ abort_handler(struct trapframe *tf, int prefetch) * is NULL or curproc->p_vmspace is NULL the fault is fatal. */ vm = (p != NULL) ? p->p_vmspace : NULL; - if (vm == NULL) + if (vm == NULL) { + ksig.sig = SIGSEGV; + ksig.code = 0; goto nogo; + } map = &vm->vm_map; if (!usermode && (td->td_intr_nesting_level != 0 ||
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010311726.09VHQvNx074525>