Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66e0f263 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

signal/arm64: Better isolate the COMPAT_TASK portion of ptrace_hbptriggered



Instead of jumpping while !is_compat_task placee all of the code
inside of an if (is_compat_task) block.  This allows the int i
variable to be properly limited to the compat block no matter how the
rest of ptrace_hbptriggered changes.

In a following change a non-variable declaration will preceed
was made independent to ensure the code is easy to review.

Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 0752d7bf
Loading
Loading
Loading
Loading
+12 −15
Original line number Diff line number Diff line
@@ -188,11 +188,9 @@ static void ptrace_hbptriggered(struct perf_event *bp,
	};

#ifdef CONFIG_COMPAT
	if (is_compat_task()) {
		int i;

	if (!is_compat_task())
		goto send_sig;

		for (i = 0; i < ARM_MAX_BRP; ++i) {
			if (current->thread.debug.hbp_break[i] == bp) {
				info.si_errno = (i << 1) + 1;
@@ -206,8 +204,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
				break;
			}
		}

send_sig:
	}
#endif
	force_sig_info(SIGTRAP, &info, current);
}