summary refs log tree commit diff
path: root/ripple
diff options
context:
space:
mode:
authoredef <edef@unfathomable.blue>2022-07-29 21:11:57 +0000
committeredef <edef@unfathomable.blue>2022-07-29 21:11:57 +0000
commita11f67c619d80d51db486e3863bd374b1377a6e7 (patch)
treea7abf1883c07426e6499347ea94bd21e6b314693 /ripple
parentb9227791ce67f4f032b735bbcfb2e8df6f34bb70 (diff)
downloadunf-legacy-a11f67c619d80d51db486e3863bd374b1377a6e7.tar.zst
ripple/minitrace: verify rt_sigaction signal strictly
Change-Id: I9237b8740fea2b84174b77487fc42e9464a0b2fc
Diffstat (limited to 'ripple')
-rw-r--r--ripple/minitrace/src/main.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs
index e7da54e..01f7d18 100644
--- a/ripple/minitrace/src/main.rs
+++ b/ripple/minitrace/src/main.rs
@@ -10,7 +10,7 @@ use {
 		sys::{
 			personality::{self, Persona},
 			ptrace,
-			signal::Signal,
+			signal::Signal as HostSignal,
 			wait::{waitpid, WaitPidFlag, WaitStatus},
 		},
 		unistd::Pid,
@@ -75,7 +75,7 @@ impl Process {
 		let tgid = Tgid(child.id() as _);
 
 		match waitpid(tgid.as_pid(), None).context("Couldn't waitpid on fresh child")? {
-			WaitStatus::Stopped(_, Signal::SIGTRAP) => {}
+			WaitStatus::Stopped(_, HostSignal::SIGTRAP) => {}
 			status => bail!("unexpected child state: {status:?}"),
 		}
 
@@ -345,7 +345,7 @@ define_syscalls! {
 		fn mmap(addr: u64, len: u64, prot: ProtFlags, flags: MapFlags, fd: FileDesc, off: u64) -> i64 = 9;
 		fn mprotect(addr: u64, len: usize, prot: ProtFlags) -> i64 = 10;
 		fn brk(brk: u64) -> i64 = 12;
-		fn rt_sigaction(sig: i32, act: *const SigAction, oact: *mut SigAction, sigsetsize: usize) -> i64 = 13;
+		fn rt_sigaction(sig: Signal, act: *const SigAction, oact: *mut SigAction, sigsetsize: usize) -> i64 = 13;
 		fn ioctl(fd: FileDesc, cmd: Ioctl, arg: u64) -> i64 = 16;
 		fn pread64(fd: FileDesc, buf: *mut u8, count: usize, pos: u64) -> i64 = 17;
 		fn access(filename: CString, mode: AccessMode) -> i64 = 21;
@@ -607,4 +607,12 @@ syscall_enums! {
 		TCGETS     = 0x5401 => TCGETS,
 		TIOCGWINSZ = 0x5413 => TIOCGWINSZ,
 	}
+
+	enum Signal: i32 {
+		ILL  =  4 => SIGILL,
+		ABRT =  6 => SIGABRT,
+		BUS  =  7 => SIGBUS,
+		FPE  =  8 => SIGFPE,
+		SEGV = 11 => SIGSEGV,
+	}
 }