From 61db176b9a2b4e08d50d859f8243af96504f4b1c Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Mon, 14 Oct 2024 20:38:07 +0900 Subject: [PATCH 1/2] Re-enable CodeQL for TTY Resizer --- .github/workflows/codeql-analysis.yml | 65 +++++++++++++-------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d8408b8..4fd94f4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -61,38 +61,37 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 -# + # analyze-tty-resizer should be activated when Linux GH runner has v6.0 kernel or later. # https://github.com/torvalds/linux/commit/fcb14cb1bdacec5b4374fe161e83fb8208164a85 -# -# analyze-tty-resizer: -# runs-on: ubuntu-latest -# permissions: -# actions: read -# contents: read -# security-events: write -# -# strategy: -# fail-fast: false -# -# steps: -# - name: Setup -# run: | -# sudo apt-get update -# sudo apt-get install -y libbpf-dev linux-tools-common -# -# - name: Checkout repository -# uses: actions/checkout@v4.1.1 -# -# # Initializes the CodeQL tools for scanning. -# - name: Initialize CodeQL -# uses: github/codeql-action/init@v3 -# with: -# languages: cpp -# queries: security-extended,security-and-quality -# -# - name: Build TTY Resizer -# run: make -C tty-resizer -# -# - name: Perform CodeQL Analysis -# uses: github/codeql-action/analyze@v3 + analyze-tty-resizer: + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + + steps: + - name: Setup + run: | + sudo apt-get update + sudo apt-get install -y libbpf-dev linux-tools-common + + - name: Checkout repository + uses: actions/checkout@v4.1.1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: cpp + queries: security-extended,security-and-quality + + - name: Build TTY Resizer + run: make -C tty-resizer + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 From f7a37fdf132548b411a88c9ba1bae4237cb4af56 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Mon, 14 Oct 2024 20:51:16 +0900 Subject: [PATCH 2/2] Generate vmlinux.h before building TTY Resizer --- .github/workflows/codeql-analysis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4fd94f4..c576132 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -91,7 +91,10 @@ jobs: queries: security-extended,security-and-quality - name: Build TTY Resizer - run: make -C tty-resizer + working-directory: tty-resizer + run: | + bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h + make - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3