Re: [PATCH] Bluetooth: L2CAP: rate-limit ECHO_RSP per signaling PDU

From: Michael Bommarito

Date: Sun May 17 2026 - 21:04:06 EST


On Sun, May 17, 2026 at 9:00 PM Muhammad Bilal <meatuni001@xxxxxxxxx> wrote:
> A response counter covering all outbound responses generated per PDU
> would close both paths. Something like:
>
> int resp_count = 0;
>
> /* in the error path: */
> if (err) {
> if (++resp_count <= L2CAP_SIG_ECHO_BURST) {
> BT_ERR("Wrong link type (%d)", err);
> l2cap_sig_send_rej(conn, cmd->ident);
> }
> continue;
> }
>
> /* existing echo path: */
> if (cmd->code == L2CAP_ECHO_REQ &&
> ++resp_count > L2CAP_SIG_ECHO_BURST) {
> skb_pull(skb, len);
> continue;
> }
>
> Using pr_warn_ratelimited() instead of BT_ERR() in the loop would
> also reduce log amplification independent of the skb path.

Thanks, good catch on both! Luiz reminded me about
pr_warn_ratelimited before and I missed that again.

I'll give others an opportunity to weigh in and then send an updated v2.

Thanks,
Mike