Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2b18ce7
First pass at fuzzing
Eeems Apr 1, 2026
24e4e72
Get fuzzer working
Eeems Apr 1, 2026
2aa829b
Fix linting
Eeems Apr 1, 2026
dfe86d4
Add fuzzing to workflow
Eeems Apr 1, 2026
fd7f269
Fix fuzz
Eeems Apr 1, 2026
14d970f
Only fuzz on linux
Eeems Apr 1, 2026
112dd8f
Fixup makefile
Eeems Apr 1, 2026
1352748
Ignore certain checks for the fuzzing
Eeems Apr 1, 2026
d80d462
Add htree and ignore data where Volume.root is not a directory
Eeems Apr 1, 2026
255450e
Better fuzz root handling
Eeems Apr 1, 2026
d30b131
fix lint
Eeems Apr 1, 2026
eea4111
Stop fuzzing on 3.10
Eeems Apr 1, 2026
85ff106
Lint all versions
Eeems Apr 1, 2026
f0e6632
Fix lint
Eeems Apr 1, 2026
9d4c553
Review fixes
Eeems Apr 1, 2026
e4a260f
Filter more unusable data
Eeems Apr 2, 2026
d961631
Disable warnings in fuzzer, ignore short reads
Eeems Apr 2, 2026
c6fc3fd
Better handle OSError
Eeems Apr 2, 2026
471deb3
Move to determensitic fs generation instead
Eeems Apr 2, 2026
9ff590a
Don't error when trying to get an unknown inode type, return UnknownI…
Eeems Apr 2, 2026
f7f96a8
Ensure special inodes exist
Eeems Apr 2, 2026
62c246a
Mutate data to always be needed size
Eeems Apr 2, 2026
60b20ae
Make lint happy
Eeems Apr 2, 2026
1a3f80d
Undo API change
Eeems Apr 2, 2026
a06309c
Unify file type checking
Eeems Apr 2, 2026
4d2ef78
Omit -O if features is empty
Eeems Apr 2, 2026
f8fd3cf
Lint fix
Eeems Apr 2, 2026
134e63f
Fix type checking
Eeems Apr 2, 2026
d016ef3
Fix fuzzer infinite loop
Eeems Apr 2, 2026
06730f5
Add more fuzz coverage
Eeems Apr 2, 2026
fc81551
Fix lint
Eeems Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- name: Checkout the Git repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.14
python-version: ${{ matrix.python }}
cache: "pip"
- name: Lint code
shell: bash
Expand Down Expand Up @@ -82,6 +91,30 @@ jobs:
- name: Run test
shell: bash
run: make test
fuzz:
name: Fuzz
runs-on: ubuntu-latest
needs: [test-image]
strategy:
fail-fast: false
matrix:
python:
#- "3.10" # atheris appears to break
- "3.11"
- "3.12"
- "3.13"
#- "3.14" # not supported by atheris yet
steps:
- name: Checkout the Git repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: "pip"
- name: Run test
shell: bash
run: make fuzz
build:
name: Build pip package
runs-on: ubuntu-latest
Expand All @@ -106,7 +139,7 @@ jobs:
publish:
name: Publish to PyPi
if: github.repository == 'Eeems/python-ext4' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs: [build]
needs: [build, fuzz]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -128,7 +161,7 @@ jobs:
release:
name: Add pip to release
if: github.repository == 'Eeems/python-ext4' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs: [build]
needs: [build, fuzz]
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,6 @@ cython_debug/

*.ext4
*.ext4.tmp
crash-*
timeout-*
corpus/seed/
100 changes: 65 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ VERSION := $(shell grep -m 1 version pyproject.toml | tr -s ' ' | tr -d "'\":" |
PACKAGE := $(shell grep -m 1 name pyproject.toml | tr -s ' ' | tr -d "'\":" | cut -d' ' -f3)

OBJ := $(wildcard ${PACKAGE}/**)
OBJ += requirements.txt
OBJ += pyproject.toml
OBJ += README.md
OBJ += LICENSE
Expand All @@ -19,75 +18,106 @@ else
endif
endif

ifeq ($(PYTHON),)
PYTHON := python
ifeq ($(FUZZ_TIMEOUT),)
FUZZ_TIMEOUT := 60
endif

.PHONY: clean
clean:
git clean --force -dX

.PHONY: build
build: wheel

.PHONY: release
release: wheel sdist

.PHONY: sdist
sdist: dist/${PACKAGE}-${VERSION}.tar.gz

.PHONY: wheel
wheel: dist/${PACKAGE}-${VERSION}-py3-none-any.whl

dist:
mkdir -p dist

dist/${PACKAGE}-${VERSION}.tar.gz: ${VENV_BIN_ACTIVATE} dist $(OBJ)
. ${VENV_BIN_ACTIVATE}; \
$(PYTHON) -m build --sdist
python -m build --sdist

dist/${PACKAGE}-${VERSION}-py3-none-any.whl: ${VENV_BIN_ACTIVATE} dist $(OBJ)
. ${VENV_BIN_ACTIVATE}; \
$(PYTHON) -m build --wheel
python -m build --wheel

${VENV_BIN_ACTIVATE}: requirements.txt
${VENV_BIN_ACTIVATE}: pyproject.toml
@echo "Setting up development virtual env in .venv"
$(PYTHON) -m venv .venv
python -m venv .venv
. ${VENV_BIN_ACTIVATE}; \
$(PYTHON) -m pip install \
wheel \
build \
ruff \
basedpyright; \
$(PYTHON) -m pip install \
-r requirements.txt
python -m pip install \
--require-virtualenv \
--editable \
.[dev];

.PHONY: test
test: ${VENV_BIN_ACTIVATE}
@. ${VENV_BIN_ACTIVATE}; \
python -m pip install \
--require-virtualenv \
--editable \
.[test];
$(SHELL) test.sh

.PHONY: fuzz
fuzz: ${VENV_BIN_ACTIVATE}
@. ${VENV_BIN_ACTIVATE}; \
python -m pip install \
--require-virtualenv \
--editable \
.[fuzz]
. ${VENV_BIN_ACTIVATE};\
python fuzz.py \
-rss_limit_mb=2048 \
-max_total_time=$(FUZZ_TIMEOUT)

.PHONY: all
all: release

lint: $(VENV_BIN_ACTIVATE)
.PHONY: lint
lint: $(VENV_BIN_ACTIVATE);
@. ${VENV_BIN_ACTIVATE}; \
python -m pip install \
--require-virtualenv \
--editable \
.[test]; \
python -m pip install \
--require-virtualenv \
--editable \
.[fuzz]
. $(VENV_BIN_ACTIVATE); \
$(PYTHON) -m ruff check; \
$(PYTHON) -m basedpyright

lint-fix: $(VENV_BIN_ACTIVATE)
python -m ruff check; \
python -m basedpyright

.PHONY: lint-fix
lint-fix: $(VENV_BIN_ACTIVATE); \
@. ${VENV_BIN_ACTIVATE}; \
python -m pip install \
--require-virtualenv \
--editable \
.[test]; \
python -m pip install \
--require-virtualenv \
--editable \
.[fuzz]
. $(VENV_BIN_ACTIVATE); \
$(PYTHON) -m ruff check --fix; \
$(PYTHON) -m basedpyright
python -m ruff check --fix; \
python -m basedpyright

.PHONY: format
format: $(VENV_BIN_ACTIVATE)
. $(VENV_BIN_ACTIVATE); \
$(PYTHON) -m ruff format --diff
python -m ruff format --diff

.PHONY: format-fix
format-fix: $(VENV_BIN_ACTIVATE)
. $(VENV_BIN_ACTIVATE); \
$(PYTHON) -m ruff format

.PHONY: \
all \
build \
clean \
sdist \
wheel \
test \
lint \
lint-fix \
format \
format-fix
python -m ruff format
Binary file added corpus/1aecead5d62816aad8f6b936e3c3364e0155fcd3
Binary file not shown.
Binary file added corpus/efb6064ecb642140b2a63c1fa90f5a32591e3857
Binary file not shown.
Loading
Loading