Syzkaller ppdev syzlang

From XuShuwenn/RedAct · View interactive version

Syzkaller ppdev syzlang is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Write syzlang device descriptions for Linux parallel port driver (ppdev) including ioctl definitions and resource types.

How to use this skill

Skill file

Syzkaller PPDEV Syzlang Support

When to Use

Required Files

  1. /opt/syzkaller/sys/linux/dev_ppdev.txt - syzlang descriptions
  2. /opt/syzkaller/sys/linux/dev_ppdev.txt.const - constant values

Workflow

  1. Read the full authoritative headers before writing anything: inspect linux/ppdev.h and any needed related definitions from linux/parport.h.
  2. Make a checklist of every ppdev ioctl, its ioctl number macro, argument type, and direction (_IO, _IOR, _IOW, _IOWR).

2a. Read enough of linux/ppdev.h and linux/parport.h to cover the complete relevant definitions before encoding anything; if a tool output is truncated, paged, or clipped, continue reading the remainder instead of extrapolating from the opening lines.

2b. Mark which ioctls use size-sensitive argument types (especially any timeval-based commands), because their encoded constants may differ across amd64 and 386.

  1. Treat kernel headers as the source of truth for ioctl names, numbers, flags, and structs; do not guess, hand-invent, or add interfaces not verified in headers.
  2. Before creating either file, inspect a nearby syzkaller device description and its .const companion in /opt/syzkaller/sys/linux/ to copy repository-local formatting exactly.

4a. Reuse nearby sys/linux/dev_*.txt and matching .const files as syntax/schema references for resource names, syz_open_dev specialization style, ioctl declaration shape, pointer payload modeling, .const layout, and supported per-arch override syntax; keep ppdev-specific names, numbers, and argument meanings derived from the headers.

4b. While inspecting nearby files, also check whether common structs or helper types are already defined globally (for example in sys.txt) before declaring them locally; reuse shared definitions instead of duplicating standard types such as timeval.

4c. When a header-referenced value domain is not exposed as named userspace/UAPI constants, model it with the simplest validated numeric type or range instead of inventing unavailable symbolic flags or enums.

  1. Only then write dev_ppdev.txt and dev_ppdev.txt.const.
  2. Before writing, confirm the minimal modeled surface matches the headers: required includes, fd_ppdev, syz_open_dev$ppdev("/dev/parport#", 0, 0), each ioctl name/number family, and each argument direction.
  3. Prefer writing each target file in one shot (for example with a single-quoted heredoc or another atomic write method) instead of long chains of incremental appends.
  4. Prefer compiling a tiny C helper against the local headers to print ppdev/parport ioctl and flag values for .const; use that output to populate or cross-check constants instead of deriving encodings by hand.
  5. As soon as both files are written, run make descriptions first to catch syntax/schema issues before the slower full build.
  6. Immediately reopen both final files from /opt/syzkaller/sys/linux/ and inspect the saved contents before any full build step; treat the on-disk files as authoritative over the intended payload.
  7. If writing directly into /opt/syzkaller/sys/linux/ is awkward, stage the files in a writable location, verify them there, then copy them into the final paths and reread the final saved copies.
  8. If readback shows truncation, malformed syntax, shell-quoting damage, wrong formatting, or a partial rewrite, fix that first and reread the saved files before continuing.
  9. Keep a one-to-one mapping between the header-derived ppdev ioctl checklist and the syzlang ioctl declarations unless the task explicitly asks for extra variants; do not add alias/duplicate ioctl entries just to satisfy parser or unused-type complaints.
  10. Do not claim coverage counts such as "all 23 ioctls" until you have extracted the complete ioctl list from the full untruncated headers and checked each entry off explicitly.

dev_ppdev.txt Content

include <linux/ppdev.h>
include <linux/parport.h>
resource fd_ppdev[fd]
syz_open_dev/dev/parport# -> fd_ppdev
ioctl ppdev_ioc... (23 total)
ppdev_frob_struct { mask, val }
IEEE1284 mode flags + ppdev flags

dev_ppdev.txt.const

arches = amd64, 386
ioctl numbers and flag values

Verification Commands

cd /opt/syzkaller
make descriptions
make all TARGETOS=linux TARGETARCH=amd64

Run these only after reading back the generated files and confirming they are complete.

Do not stop at build success: semantic verification against the full headers is still required.

Tips

Final Audit Before Responding

  1. Re-open the saved dev_ppdev.txt and dev_ppdev.txt.const from disk.
  2. Reconcile the ioctl checklist against linux/ppdev.h: names, count, argument type, and direction for every requested ioctl.
  3. Confirm every constant referenced in dev_ppdev.txt is defined in .const for each listed arch, and that .const does not rely on unchecked arch assumptions.
  4. Confirm any claimed verification step has explicit observed success evidence; if not, rerun before answering.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.