From 1d933a91a4169ab0417c39861fcdf7a4db7f7409 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 19 Nov 2026 15:48:00 +0000 Subject: [PATCH 1/4] workflows: Harden GitHub Actions Apply some standard GitHub Actions security measures: - Limit the GITHUB_TOKEN to read-only repository access with a top-level "permissions: contents: read", rather than relying on the repository default, which may grant write access. - Set "persist-credentials: false" on all checkouts so the token is not left in .git/config for later build steps to read. - Pin all actions to commit SHAs instead of mutable tags, guarding against a compromised tag being moved to malicious code. This is most important for the third-party webispy/checkpatch-action. At the same time, update actions/checkout to v7.0.1 and actions/upload-artifact to v7.0.2; neither has breaking changes relevant to these workflows. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Phil Elwell --- .github/workflows/checkpatch.yml | 8 ++++++-- .github/workflows/dtoverlaycheck.yml | 6 +++++- .github/workflows/kernel-build.yml | 8 ++++++-- .github/workflows/kunit.yml | 15 ++++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml index c214226654dc1b..8c162747eb8fe4 100644 --- a/.github/workflows/checkpatch.yml +++ b/.github/workflows/checkpatch.yml @@ -1,6 +1,9 @@ name: Advisory checkpatch review on: [pull_request] +permissions: + contents: read + jobs: review: name: checkpatch review @@ -8,11 +11,12 @@ jobs: steps: - name: 'Calculate PR commits + 1' run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + persist-credentials: false ref: ${{ github.event.pull_request.head.sha }} fetch-depth: ${{ env.PR_FETCH_DEPTH }} - name: Copy checkpatch.conf run: cp ${{github.workspace}}/.github/workflows/ci_checkpatch.conf ${{github.workspace}}/.checkpatch.conf - name: Run checkpatch review - uses: webispy/checkpatch-action@v9 + uses: webispy/checkpatch-action@58374fe5bb03358b23d3d6871e2ff290ce77fcd2 # v9 diff --git a/.github/workflows/dtoverlaycheck.yml b/.github/workflows/dtoverlaycheck.yml index 15e8818bb57c1c..e0711e1b1d075a 100644 --- a/.github/workflows/dtoverlaycheck.yml +++ b/.github/workflows/dtoverlaycheck.yml @@ -11,6 +11,9 @@ on: branches: [ "rpi-*" ] workflow_dispatch: +permissions: + contents: read + env: UTILS_DIR: "${{github.workspace}}/utils" @@ -25,8 +28,9 @@ jobs: sudo apt-get install gcc-arm-linux-gnueabihf libfdt-dev device-tree-compiler gnutls-dev timeout-minutes: 15 - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + persist-credentials: false fetch-depth: 1 clean: true diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index cb6a8e5667c168..97c0ec7d871ae1 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -11,6 +11,9 @@ on: branches: [ "rpi-*" ] workflow_dispatch: +permissions: + contents: read + env: NUM_JOBS: 6 @@ -72,8 +75,9 @@ jobs: sudo apt-get install -y gcc-arm-linux-gnueabihf timeout-minutes: 15 - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + persist-credentials: false fetch-depth: 1 clean: true @@ -103,7 +107,7 @@ jobs: run: tar -cvf ${{matrix.name}}_build.tar -C ${{github.workspace}}/install . - name: Upload results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: ${{matrix.name}}_build path: ${{matrix.name}}_build.tar diff --git a/.github/workflows/kunit.yml b/.github/workflows/kunit.yml index 1244d728974069..2ffa34f306d5c0 100644 --- a/.github/workflows/kunit.yml +++ b/.github/workflows/kunit.yml @@ -7,13 +7,18 @@ on: push: branches: [ "rpi-*"] +permissions: + contents: read + jobs: core: name: Generic DRM/KMS Unit Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Run Generic DRM Tests run: | @@ -25,7 +30,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install Dependencies run: | @@ -43,7 +50,9 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install Dependencies run: | From 6770f92ac8ad9389c3cfa601219d6c867e41ce73 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 19 Nov 2026 16:05:09 +0000 Subject: [PATCH 2/4] workflows: Use the tree's checkpatch.pl for PR reviews webispy/checkpatch-action runs checkpatch.pl from its webispy/checkpatch Docker image, which was last built in February 2023. That copy is missing years of upstream changes, and still applies the networking block comment rule dropped in commit 82b8000c28b5 ("net: drop special comment style"), so it reports warnings that local runs don't. Point the action's CHECKPATCH_COMMAND at the PR's own scripts/checkpatch.pl so each branch is checked against its own rules. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Phil Elwell --- .github/workflows/checkpatch.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml index 8c162747eb8fe4..f5717ae624172e 100644 --- a/.github/workflows/checkpatch.yml +++ b/.github/workflows/checkpatch.yml @@ -19,4 +19,7 @@ jobs: - name: Copy checkpatch.conf run: cp ${{github.workspace}}/.github/workflows/ci_checkpatch.conf ${{github.workspace}}/.checkpatch.conf - name: Run checkpatch review + env: + # Use the tree's checkpatch.pl, not the action image's stale copy + CHECKPATCH_COMMAND: perl scripts/checkpatch.pl uses: webispy/checkpatch-action@58374fe5bb03358b23d3d6871e2ff290ce77fcd2 # v9 From 75453d3a091a4d65e0fb291ba29abb7fff3062f0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 19 Nov 2026 13:10:20 +0000 Subject: [PATCH 3/4] wifi: brcmfmac: Don't take the radio down when stopping a secondary AP brcmf_cfg80211_start_ap only takes the device down (BRCMF_C_DOWN) when the AP is on the primary interface or the firmware can't run multiple channels/bands, but brcmf_cfg80211_stop_ap always does a full DOWN/SET_AP 0/UP reset for the first AP interface. When the AP is a virtual interface alongside an associated STA (e.g. a NetworkManager "shared" hotspot on an __ap vif), stopping or restarting the AP therefore disconnects the upstream STA. Factor the start_ap condition out into brcmf_ap_owns_radio() and, when the AP doesn't own the radio, just disable its BSS with the "bss" iovar, as is already done for P2P GO interfaces. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Phil Elwell --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 92 ++++++++++++------- 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index d6b62d7c076dea..2f559731b3137b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5177,6 +5177,34 @@ brcmf_parse_configure_security(struct brcmf_if *ifp, return err; } +/* + * An AP on the primary interface, or on firmware that can't run several + * interfaces at once, has the radio to itself. Starting and stopping it + * takes the whole device down and up, which would break any other + * interface (e.g. an upstream STA connection). + */ +static bool brcmf_ap_owns_radio(struct brcmf_if *ifp) +{ + return ifp->ifidx == 0 || + (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB) && + !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)); +} + +static s32 brcmf_bss_disable(struct brcmf_if *ifp) +{ + struct brcmf_fil_bss_enable_le bss_enable; + s32 err; + + bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx); + bss_enable.enable = cpu_to_le32(0); + err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, + sizeof(bss_enable)); + if (err < 0) + bphy_err(ifp->drvr, "bss_enable config failed %d\n", err); + + return err; +} + static s32 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_ap_settings *settings) @@ -5275,10 +5303,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, } } - if ((dev_role == NL80211_IFTYPE_AP) && - ((ifp->ifidx == 0) || - (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB) && - !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)))) { + if (dev_role == NL80211_IFTYPE_AP && brcmf_ap_owns_radio(ifp)) { err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); if (err < 0) { bphy_err(drvr, "BRCMF_C_DOWN error %d\n", @@ -5434,7 +5459,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev, struct brcmf_pub *drvr = cfg->pub; struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; s32 err; - struct brcmf_fil_bss_enable_le bss_enable; struct brcmf_join_params join_params; brcmf_dbg(TRACE, "Enter\n"); @@ -5459,38 +5483,40 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev, return err; } - /* First BSS doesn't get a full reset */ - if (ifp->bsscfgidx == 0) - brcmf_fil_iovar_int_set(ifp, "closednet", 0); + if (brcmf_ap_owns_radio(ifp)) { + /* First BSS doesn't get a full reset */ + if (ifp->bsscfgidx == 0) + brcmf_fil_iovar_int_set(ifp, "closednet", 0); - memset(&join_params, 0, sizeof(join_params)); - err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, - &join_params, sizeof(join_params)); - if (err < 0) - bphy_err(drvr, "SET SSID error (%d)\n", err); - err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); - if (err < 0) - bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err); - err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); - if (err < 0) - bphy_err(drvr, "setting AP mode failed %d\n", err); - if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) - brcmf_fil_iovar_int_set(ifp, "mbss", 0); - brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, - ifp->vif->is_11d); - /* Bring device back up so it can be used again */ - err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); - if (err < 0) - bphy_err(drvr, "BRCMF_C_UP error %d\n", err); + memset(&join_params, 0, sizeof(join_params)); + err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, + &join_params, + sizeof(join_params)); + if (err < 0) + bphy_err(drvr, "SET SSID error (%d)\n", err); + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); + if (err < 0) + bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err); + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); + if (err < 0) + bphy_err(drvr, "setting AP mode failed %d\n", + err); + if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) + brcmf_fil_iovar_int_set(ifp, "mbss", 0); + brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, + ifp->vif->is_11d); + /* Bring device back up so it can be used again */ + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); + if (err < 0) + bphy_err(drvr, "BRCMF_C_UP error %d\n", err); + } else { + /* Leave the radio, and other interfaces, running */ + err = brcmf_bss_disable(ifp); + } brcmf_vif_clear_mgmt_ies(ifp->vif); } else { - bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx); - bss_enable.enable = cpu_to_le32(0); - err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, - sizeof(bss_enable)); - if (err < 0) - bphy_err(drvr, "bss_enable config failed %d\n", err); + err = brcmf_bss_disable(ifp); } brcmf_set_mpc(ifp, 1); clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); From dc93483b7ed2484e7593e5ed886fc29ed0b789cc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 19 Nov 2026 13:25:35 +0000 Subject: [PATCH 4/4] wifi: brcmfmac: Keep a secondary AP on the STA's channel When a soft AP runs on a virtual interface alongside an associated STA, firmware with multi-channel support will run the two on different channels, time-sharing the radio. On the SYN43436P this almost completely breaks traffic forwarded between the interfaces (e.g. a NetworkManager "shared" hotspot), because frames queued for whichever interface is off-channel are dropped. While such an AP is running, set the "mchan_stago_disab" iovar, which disables multi-channel operation for STA + GO/AP concurrency. The firmware then keeps the AP on the STA's channel: it starts there regardless of the channel requested, and follows the STA when it roams. Clear it again when the AP stops (or fails to start) so that other concurrency is unaffected. Firmware without the iovar just ignores the request. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Phil Elwell --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 2f559731b3137b..91082030cb5be0 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5205,6 +5205,21 @@ static s32 brcmf_bss_disable(struct brcmf_if *ifp) return err; } +/* + * Stop the firmware from time-sharing the radio between an AP and another + * interface on different channels, so that the AP follows the channel of an + * associated STA. Not all firmware supports this, hence the lack of fuss. + */ +static void brcmf_set_mchan_stago_disab(struct brcmf_if *ifp, bool disab) +{ + s32 err; + + err = brcmf_fil_iovar_int_set(ifp, "mchan_stago_disab", disab); + if (err) + brcmf_dbg(INFO, "mchan_stago_disab %d failed: %d\n", disab, + err); +} + static s32 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_ap_settings *settings) @@ -5329,6 +5344,9 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, if ((brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) && (!mbss)) brcmf_fil_iovar_int_set(ifp, "mbss", 1); + if (!brcmf_ap_owns_radio(ifp)) + brcmf_set_mchan_stago_disab(ifp, true); + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1); if (err < 0) { bphy_err(drvr, "setting AP mode failed %d\n", @@ -5448,6 +5466,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, brcmf_set_mpc(ifp, 1); brcmf_configure_arp_nd_offload(ifp, true); } + if (err && dev_role == NL80211_IFTYPE_AP && !brcmf_ap_owns_radio(ifp)) + brcmf_set_mchan_stago_disab(ifp, false); return err; } @@ -5512,6 +5532,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev, } else { /* Leave the radio, and other interfaces, running */ err = brcmf_bss_disable(ifp); + brcmf_set_mchan_stago_disab(ifp, false); } brcmf_vif_clear_mgmt_ies(ifp->vif);