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

Better support for non-4K pages #4876

Open
ramosian-glider opened this issue Jun 5, 2024 · 2 comments
Open

Better support for non-4K pages #4876

ramosian-glider opened this issue Jun 5, 2024 · 2 comments

Comments

@ramosian-glider
Copy link
Member

Marc Zyngier notices that syzkaller reproducers always seem to be generated with an implicit requirement that PAGE_SIZE is 4kB. However, arm64 supports 4, 16 and 64kB as the base page size (and e.g. Android is steadily moving towards 16kB).
It means that these reproducers simply don't work (mmap() fails, for example).

Marc asks if it's possible to make the memory-map constants parameterized on PAGE_SIZE.

A somewhat related request is to switch some of the syzkaller instances to non-4K pages.

@ramosian-glider
Copy link
Member Author

For the mappings created by MakePosixMmap() the easiest solution might be to make target.PageSize=64<<10, so that the memory allocations done by the program are always aligned on 64K, even for machines with 4K pages.

But we don't want all programs to unconditionally create 64K-sized mappings for every mmap() call, as this can mask actual bugs on platforms that have PAGE_SIZE=4K.

@ramosian-glider
Copy link
Member Author

There is also a number of descriptions that implicitly assume 4K pages, e.g.:

sys/linux/dev_snd_pcm.txt:mmap$snddsp(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_snd_dsp, offset intptr[0:0x10000, 0x1000])
sys/linux/dev_snd_pcm.txt:mmap$snddsp_status(addr vma, len const[0x1000], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_snd_dsp, offset const[SNDRV_PCM_MMAP_OFFSET_STATUS])
sys/linux/dev_snd_pcm.txt:mmap$snddsp_control(addr vma, len const[0x1000], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_snd_dsp, offset const[SNDRV_PCM_MMAP_OFFSET_CONTROL])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant