changeset 59d2bcf37782 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=59d2bcf37782
description:
Syscalls: warn when the length argument to mmap is excessive.
If the length argument to mmap is larger than the arbitrary but
reasonable
limit of 4GB, there's a good chance that the value is nonsense and not
intentional. Rather than attempting to satisfy the mmap anyway, this
change
makes gem5 warn to make it more apparent what's going wrong.
diffstat:
src/sim/syscall_emul.hh | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diffs (13 lines):
diff -r 7100059f7bfd -r 59d2bcf37782 src/sim/syscall_emul.hh
--- a/src/sim/syscall_emul.hh Mon May 14 20:31:33 2012 -0500
+++ b/src/sim/syscall_emul.hh Sat May 19 04:13:47 2012 -0700
@@ -1004,6 +1004,9 @@
int tgt_fd = p->getSyscallArg(tc, index);
// int offset = p->getSyscallArg(tc, index);
+ if (length > 0x100000000ULL)
+ warn("mmap length argument %#x is unreasonably large.\n", length);
+
if (!(flags & OS::TGT_MAP_ANONYMOUS)) {
Process::FdMap *fd_map = p->sim_fd_obj(tgt_fd);
if (!fd_map || fd_map->fd < 0) {
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev