From 6d6dbf8ab21a52df701946afac2a86f93a88fdc8 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 10 Nov 2023 00:09:44 -0800 Subject: sys/linux: describe the PAGEMAP_SCAN ioctl Signed-off-by: Andrei Vagin --- sys/linux/pagemap_ioctl.txt | 34 ++++++++++++++++++++++++++++++++++ sys/linux/pagemap_ioctl.txt.const | 13 +++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 sys/linux/pagemap_ioctl.txt create mode 100644 sys/linux/pagemap_ioctl.txt.const (limited to 'sys') diff --git a/sys/linux/pagemap_ioctl.txt b/sys/linux/pagemap_ioctl.txt new file mode 100644 index 000000000..519257ee7 --- /dev/null +++ b/sys/linux/pagemap_ioctl.txt @@ -0,0 +1,34 @@ +# Copyright 2023 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include + +resource fd_pagemap[fd] + +syz_open_procfs$pagemap(pid pid, file ptr[in, string["pagemap"]]) fd_pagemap + +ioctl$PAGEMAP_SCAN(fd fd_pagemap, cmd const[PAGEMAP_SCAN], arg ptr[inout, pagemap_arg]) + +page_region { + start int64 + end int64 + categories int64 +} + +pagemap_arg { + size bytesize[pagemap_arg, int64] + flags flags[pm_flags, int64] + start vma64 + end vma64 + walk_end int64 + vec ptr64[in, array[page_region]] + vec_len len[vec, int64] + max_pages int64 + category_inverted flags[categories, int64] + category_mask flags[categories, int64] + category_anyof_mask flags[categories, int64] + return_mask flags[categories, int64] +} + +pm_flags = PM_SCAN_WP_MATCHING, PM_SCAN_CHECK_WPASYNC +categories = PAGE_IS_WPALLOWED, PAGE_IS_WRITTEN, PAGE_IS_FILE, PAGE_IS_PRESENT, PAGE_IS_SWAPPED, PAGE_IS_PFNZERO, PAGE_IS_HUGE diff --git a/sys/linux/pagemap_ioctl.txt.const b/sys/linux/pagemap_ioctl.txt.const new file mode 100644 index 000000000..0f9eb2524 --- /dev/null +++ b/sys/linux/pagemap_ioctl.txt.const @@ -0,0 +1,13 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = 386, amd64, arm, arm64, ppc64le, riscv64, s390x +PAGEMAP_SCAN = 3227543056 +PAGE_IS_FILE = 4 +PAGE_IS_HUGE = 64 +PAGE_IS_PFNZERO = 32 +PAGE_IS_PRESENT = 8 +PAGE_IS_SWAPPED = 16 +PAGE_IS_WPALLOWED = 1 +PAGE_IS_WRITTEN = 2 +PM_SCAN_CHECK_WPASYNC = 2 +PM_SCAN_WP_MATCHING = 1 +__NR_ioctl = 54, amd64:16, arm64:riscv64:29 -- cgit mrf-deployment