Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/23194 )
Change subject: arch,sim: Replace setuidFunc with ignoreFunc.
......................................................................
arch,sim: Replace setuidFunc with ignoreFunc.
The setuidFunc just ignores the call and warns about it, and that's
what ignoreFunc already does.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187
Change-Id: I7655863ed6fe200ff3ac087be3218d49c3c43061
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23194
Reviewed-by: Gabe Black <gabebl...@google.com>
Maintainer: Gabe Black <gabebl...@google.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/alpha/linux/process.cc
M src/arch/arm/linux/process.cc
M src/arch/mips/linux/process.cc
M src/arch/power/linux/process.cc
M src/arch/riscv/linux/process.cc
M src/arch/sparc/linux/syscalls.cc
M src/arch/sparc/solaris/process.cc
M src/sim/syscall_emul.cc
M src/sim/syscall_emul.hh
9 files changed, 9 insertions(+), 21 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/arch/alpha/linux/process.cc
b/src/arch/alpha/linux/process.cc
index 91decc7..2cd9102 100644
--- a/src/arch/alpha/linux/process.cc
+++ b/src/arch/alpha/linux/process.cc
@@ -179,7 +179,7 @@
/* 20 */ { "getxpid", getpidPseudoFunc },
/* 21 */ { "osf_mount" },
/* 22 */ { "umount" },
- /* 23 */ { "setuid", setuidFunc },
+ /* 23 */ { "setuid", ignoreFunc },
/* 24 */ { "getxuid", getuidPseudoFunc },
/* 25 */ { "exec_with_loader" },
/* 26 */ { "osf_ptrace" },
diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc
index 0391487..4b54a54 100644
--- a/src/arch/arm/linux/process.cc
+++ b/src/arch/arm/linux/process.cc
@@ -188,7 +188,7 @@
/* 20 */ { "getpid", getpidFunc },
/* 21 */ { "mount" },
/* 22 */ { "umount" },
- /* 23 */ { "setuid", setuidFunc },
+ /* 23 */ { "setuid", ignoreFunc },
/* 24 */ { "getuid", getuidFunc },
/* 25 */ { "stime" },
/* 26 */ { "ptrace" },
diff --git a/src/arch/mips/linux/process.cc b/src/arch/mips/linux/process.cc
index 0b03c99..31bf990 100644
--- a/src/arch/mips/linux/process.cc
+++ b/src/arch/mips/linux/process.cc
@@ -192,7 +192,7 @@
/* 20 */ { "getpid", getpidFunc },
/* 21 */ { "mount" },
/* 22 */ { "umount" },
- /* 23 */ { "setuid", setuidFunc },
+ /* 23 */ { "setuid", ignoreFunc },
/* 24 */ { "getuid", getuidFunc },
/* 25 */ { "stime" },
/* 26 */ { "ptrace" },
diff --git a/src/arch/power/linux/process.cc
b/src/arch/power/linux/process.cc
index 217f0bd..7c55a57 100644
--- a/src/arch/power/linux/process.cc
+++ b/src/arch/power/linux/process.cc
@@ -120,7 +120,7 @@
/* 20 */ { "getpid", getpidFunc },
/* 21 */ { "mount" },
/* 22 */ { "umount" },
- /* 23 */ { "setuid", setuidFunc },
+ /* 23 */ { "setuid", ignoreFunc },
/* 24 */ { "getuid", getuidFunc },
/* 25 */ { "stime" },
/* 26 */ { "ptrace" },
diff --git a/src/arch/riscv/linux/process.cc
b/src/arch/riscv/linux/process.cc
index b20d09d..6f3f037 100644
--- a/src/arch/riscv/linux/process.cc
+++ b/src/arch/riscv/linux/process.cc
@@ -269,7 +269,7 @@
{143, { "setregid" }},
{144, { "setgid" }},
{145, { "setreuid" }},
- {146, { "setuid", setuidFunc }},
+ {146, { "setuid", ignoreFunc }},
{147, { "setresuid" }},
{148, { "getresuid" }},
{149, { "getresgid" }},
@@ -601,7 +601,7 @@
{143, { "setregid" }},
{144, { "setgid" }},
{145, { "setreuid" }},
- {146, { "setuid", setuidFunc }},
+ {146, { "setuid", ignoreFunc }},
{147, { "setresuid" }},
{148, { "getresuid" }},
{149, { "getresgid" }},
diff --git a/src/arch/sparc/linux/syscalls.cc
b/src/arch/sparc/linux/syscalls.cc
index a166a51..65ad298 100644
--- a/src/arch/sparc/linux/syscalls.cc
+++ b/src/arch/sparc/linux/syscalls.cc
@@ -112,7 +112,7 @@
/* 20 */ { "getpid", getpidFunc },
/* 21 */ { "capget" },
/* 22 */ { "capset" },
- /* 23 */ { "setuid", setuidFunc }, // 32 bit
+ /* 23 */ { "setuid", ignoreFunc }, // 32 bit
/* 24 */ { "getuid", getuidFunc }, // 32 bit
/* 25 */ { "time" },
/* 26 */ { "ptrace" },
@@ -418,7 +418,7 @@
/* 20 */ { "getpid", getpidFunc },
/* 21 */ { "capget" },
/* 22 */ { "capset" },
- /* 23 */ { "setuid", setuidFunc },
+ /* 23 */ { "setuid", ignoreFunc },
/* 24 */ { "getuid", getuidFunc },
/* 25 */ { "time" },
/* 26 */ { "ptrace" },
diff --git a/src/arch/sparc/solaris/process.cc
b/src/arch/sparc/solaris/process.cc
index 4c22f1e..e95f2d7 100644
--- a/src/arch/sparc/solaris/process.cc
+++ b/src/arch/sparc/solaris/process.cc
@@ -114,7 +114,7 @@
/* 20 */ { "getpid", getpidFunc },
/* 21 */ { "mount" },
/* 22 */ { "umount" },
- /* 23 */ { "setuid", setuidFunc },
+ /* 23 */ { "setuid", ignoreFunc },
/* 24 */ { "getuid", getuidFunc },
/* 25 */ { "stime" },
/* 26 */ { "pcsample" },
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index e7efbaa..585465d 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -1014,14 +1014,6 @@
SyscallReturn
-setuidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, int uid)
-{
- // can't fathom why a benchmark would call this.
- warn("Ignoring call to setuid(%d)\n", uid);
- return 0;
-}
-
-SyscallReturn
getpidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
auto process = tc->getProcessPtr();
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 69a583f..3e727e8 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -275,10 +275,6 @@
/// Target fcntl64() handler.
SyscallReturn fcntl64Func(SyscallDesc *desc, int num, ThreadContext *tc);
-/// Target setuid() handler.
-SyscallReturn setuidFunc(SyscallDesc *desc, int num, ThreadContext *tc,
- int uid);
-
/// Target pipe() handler.
SyscallReturn pipeFunc(SyscallDesc *desc, int num, ThreadContext *tc);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23194
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I7655863ed6fe200ff3ac087be3218d49c3c43061
Gerrit-Change-Number: 23194
Gerrit-PatchSet: 14
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Brandon Potter <brandon.pot...@amd.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev