본문으로 건너뛰기
cccskills
무료GitHub에 공개

syz-extract-constants

Defining and extracting kernel constants for syzkaller syzlang descriptions

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Defining Constants in Syzlang

Overview

Syzkaller needs to know the actual values of kernel constants (ioctl numbers, flags, etc.) to generate valid fuzzing programs. There are two ways to provide these values:

  1. Manual .const file - Define constants directly in a companion file
  2. syz-extract tool - Extract values from kernel source headers (requires kernel source)

Method 1: Manual Constants File (Recommended when no kernel source)

Create a .const file alongside your .txt file with the constant values:

File naming

  • Syzlang description: sys/linux/dev_ppdev.txt
  • Constants file: sys/linux/dev_ppdev.txt.const

Constants file format

# Constants for your syzlang descriptions
arches = 386, amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x
PPCLAIM = 28811
PPRELEASE = 28812
IEEE1284_MODE_NIBBLE = 0
IEEE1284_MODE_BYTE = 1

The arches line declares which architectures these constants are valid for. For architecture-independent constants (like ioctls), list all architectures.

Calculating ioctl values

Linux ioctl numbers are encoded as:

  • _IO(type, nr) = (type << 8) | nr
  • _IOR(type, nr, size) = (2 << 30) | (size << 16) | (type << 8) | nr
  • _IOW(type, nr, size) = (1 << 30) | (size << 16) | (type << 8) | nr
  • _IOWR(type, nr, size) = (3 << 30) | (size << 16) | (type << 8) | nr

For ppdev (type='p'=0x70):

  • PPCLAIM = _IO('p', 0x8b) = 0x708b = 28811

Method 2: Using syz-extract (Requires kernel source)

If kernel source is available:

cd /opt/syzkaller

# Extract constants for a specific file
make extract TARGETOS=linux SOURCEDIR=/path/to/linux FILES=sys/linux/dev_ppdev.txt

Note: This environment does not include kernel source. Use Method 1 (manual constants file) instead.

After Defining Constants

After creating the .const file, build syzkaller:

cd /opt/syzkaller
make descriptions  # Compiles descriptions + constants
make all           # Full build

Common Errors

"is defined for none of the arches"

This means the constant is used in the .txt file but not defined in the .const file.

  • Add the missing constant to your .const file
  • Ensure arches line lists the target architectures PPCLAIM is defined for none of the arches

Solution: Run `make extract` with the correct kernel source path and FILES parameter.

### Missing headers

cannot find include file: uapi/linux/ppdev.h


Solution: Check the kernel source path and ensure headers are properly configured.

### "unknown file"

unknown file: sys/linux/dev_ppdev.txt


Solution: Use `make extract FILES=...` instead of calling `bin/syz-extract` directly.

## Example Workflow

1. Write the syzlang description file (`sys/linux/dev_ppdev.txt`)
2. Run `make extract TARGETOS=linux SOURCEDIR=/opt/linux/source FILES=sys/linux/dev_ppdev.txt`
3. Run `make generate` to regenerate Go code
4. Run `make` to build syzkaller
5. Test with `make descriptions` to verify everything compiles

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching `acopf-math-model.md` and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Redact text from PDF documents for blind review anonymization

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Use when checking simplified ADA-derived plan-view bathroom accessibility constraints such as turning space, door clear width, toilet centerline, grab bars, and lavatory knee/toe clearance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Analyze failed GitHub Action jobs for a pull request.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Use when extracting plan-view architectural geometry from DXF files with semantic CAD layers, especially when outputs must normalize rooms, doors, fixtures, clearances, and grab bars into machine-checkable JSON.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

benchflow-ai의 스킬 모두 보기

이 스킬의 문제 신고