aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2023-11-10 00:09:44 -0800
committerAleksandr Nogikh <nogikh@google.com>2023-11-11 00:38:31 +0000
commit6d6dbf8ab21a52df701946afac2a86f93a88fdc8 (patch)
tree643b138145ab7cc713708a697f0a68ea056448cb /sys/linux
parent234708f18e325293e5e08af01c6afb9a42bf15ae (diff)
sys/linux: describe the PAGEMAP_SCAN ioctl
Signed-off-by: Andrei Vagin <avagin@google.com>
Diffstat (limited to 'sys/linux')
-rw-r--r--sys/linux/pagemap_ioctl.txt34
-rw-r--r--sys/linux/pagemap_ioctl.txt.const13
2 files changed, 47 insertions, 0 deletions
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 <uapi/linux/fs.h>
+
+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