Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong old_mmap define #90

Closed
seth1002 opened this issue Jun 17, 2020 · 1 comment · Fixed by #91
Closed

wrong old_mmap define #90

seth1002 opened this issue Jun 17, 2020 · 1 comment · Fixed by #91
Labels
bug Something isn't working

Comments

@seth1002
Copy link

Describe the bug
params copy form user stack space, not via register.... can you please fix this bug?

zelos define

https://github.com/zeropointdynamics/zelos/blob/f670a6288788fe1a0de31725ea1ff58c5f9ea1d2/src/zelos/ext/platforms/linux/syscalls/syscalls.py
def sys_mmap(sm, p):
args = sm.get_args(
[
("void*", "addr"),
("size_t", "length"),
("int", "prot"),
("int", "flags"),
("int", "fd"),
("off_t", "offset"),
]
)
try:
return mmapx(sm, p, "mmap", args, args.offset)
except Exception as e:
sm.print("mmap exception: " + str(e))
return -1

old_mmap define

https://github.com/torvalds/linux/blob/a5ad5742f671de906adbf29fbedf0a04705cebad/arch/x86/kernel/sys_ia32.c
COMPAT_SYSCALL_DEFINE1(ia32_mmap, struct mmap_arg_struct32 __user *, arg)
{
struct mmap_arg_struct32 a;

if (copy_from_user(&a, arg, sizeof(a)))
	return -EFAULT;
@kzsnow kzsnow added the bug Something isn't working label Jun 17, 2020
@kvalakuzhyzp kvalakuzhyzp linked a pull request Jun 17, 2020 that will close this issue
@rcourt-zp
Copy link
Contributor

rcourt-zp commented Jun 17, 2020

Will be fixed in #91. Thanks for letting us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants