Re: [PATCH net v3] bridge: cfm: reject invalid CCM interval at configuration time
From: Xiang Mei <hidden>
Date: 2026-06-09 07:22:50
Also in:
bridge
On Tue, Jun 9, 2026 at 12:19 AM Nikolay Aleksandrov [off-list ref] wrote:
On 09/06/2026 09:51, Xiang Mei wrote:quoted
Thanks for your review and the tip. V4 was sent. XiangPlease don't top post on netdev@.
Thanks for the tip! Xiang
Cheers, Nikquoted
On Mon, Jun 8, 2026 at 11:46 PM Ido Schimmel [off-list ref] wrote:quoted
On Sat, Jun 06, 2026 at 02:58:48PM -0700, Xiang Mei wrote:quoted
ccm_tx_work_expired() re-arms itself via queue_delayed_work() using the configured exp_interval converted by interval_to_us(). When exp_interval is BR_CFM_CCM_INTERVAL_NONE or out of range, interval_to_us() returns 0, causing the worker to fire immediately in a tight loop that allocates skbs until OOM. Fix this by validating exp_interval at configuration time: - Constrain IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL to the valid range [BR_CFM_CCM_INTERVAL_3_3_MS, BR_CFM_CCM_INTERVAL_10_MIN] in the netlink policy so userspace cannot set an invalid value. - Reject starting CCM TX in br_cfm_cc_ccm_tx() when exp_interval has not yet been configured (defaults to 0 from kzalloc). Fixes: 2be665c3940d ("bridge: cfm: Netlink SET configuration Interface.") Reported-by: Weiming Shi <redacted> Suggested-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Xiang Mei <redacted>Reviewed-by: Ido Schimmel <idosch@nvidia.com> Nit: I don't think that the Suggested-by is appropriate here since I merely had minor comments on the previous version.