Implement stack overflow protection with canary checks #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| board: [discoveryf4, discoveryf429, netduinoplus2] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install ARM toolchain | |
| uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
| with: | |
| release: '15.2.Rel1' | |
| - name: Configure for ${{ matrix.board }} | |
| run: make ${{ matrix.board }}_defconfig | |
| - name: Build kernel | |
| run: make | |
| - name: Show binary size | |
| run: arm-none-eabi-size build/${{ matrix.board }}/f9.elf | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: f9-${{ matrix.board }} | |
| path: | | |
| build/${{ matrix.board }}/f9.elf | |
| build/${{ matrix.board }}/f9.bin | |
| - name: Install QEMU | |
| if: matrix.board == 'netduinoplus2' | |
| run: sudo apt-get update && sudo apt-get install -y qemu-system-arm | |
| - name: QEMU boot test | |
| if: matrix.board == 'netduinoplus2' | |
| run: | | |
| timeout 15s qemu-system-arm \ | |
| -M netduinoplus2 \ | |
| -nographic \ | |
| -serial mon:stdio \ | |
| -kernel build/netduinoplus2/f9.elf 2>&1 | tee qemu.log || true | |
| echo "=== QEMU Output ===" | |
| cat qemu.log | |
| echo "===================" | |
| # Check for crashes first (highest priority failure) | |
| if grep -qE "MEMFAULT|HardFault|panic|PANIC" qemu.log; then | |
| echo "✗ Kernel crash detected" | |
| exit 1 | |
| fi | |
| # Check for test failures | |
| if grep -q "FAILED" qemu.log; then | |
| echo "✗ Test failure detected:" | |
| grep -B1 "FAILED" qemu.log | |
| exit 1 | |
| fi | |
| # Check for successful boot | |
| if grep -q "Press '?' to print KDB menu" qemu.log; then | |
| echo "✓ KDB shell ready" | |
| elif grep -q "KDB" qemu.log; then | |
| echo "✓ KDB initialized" | |
| elif grep -q "f9\|F9" qemu.log; then | |
| echo "✓ Kernel boot detected" | |
| else | |
| echo "✗ No boot message detected (timeout or minimal output)" | |
| exit 1 | |
| fi | |
| # Check for test results if tests ran | |
| if grep -q "test suite complete" qemu.log; then | |
| ok_count=$(grep -c "OK" qemu.log || echo 0) | |
| echo "✓ Test suite complete: $ok_count tests passed" | |
| exit 0 | |
| fi | |
| # Fallback: tests started but didn't complete | |
| if grep -q "test suite starts" qemu.log; then | |
| echo "✗ Test suite started but did not complete (timeout)" | |
| exit 1 | |
| fi | |
| exit 0 |