Page MenuHomeFreeBSD

iwm: mask closed_rb_num to the RX ring size
ClosedPublic

Authored by adrian on Sat, Oct 17, 9:27 PM.
Referenced Files
F176379460: D60824.id.diff
Sun, Oct 18, 9:32 AM
F176375095: D60824.id190153.diff
Sun, Oct 18, 8:45 AM
F176374925: D60824.id190153.diff
Sun, Oct 18, 8:44 AM
F176373855: D60824.id190153.diff
Sun, Oct 18, 8:31 AM
F176372640: D60824.diff
Sun, Oct 18, 8:12 AM
F176355587: D60824.id190150.diff
Sun, Oct 18, 4:35 AM
F176355450: D60824.id190153.diff
Sun, Oct 18, 4:32 AM
F176354414: D60824.id190150.diff
Sun, Oct 18, 4:21 AM
Subscribers

Details

Summary

iwm_notif_intr() reads hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff and
loops while (sc->rxq.cur != hw) without masking hw to the ring size (512 entries
for 9000-series MQ RX, 256 for legacy). If the hardware reports a value at or
above the ring size, cur never equals hw: the loop walks stale ring entries
indefinitely and the write-pointer update uses a bogus index. Linux iwlwifi
masks the value (5eae443eb5e2) and OpenBSD has done the same since 9000-series
support was added (3287dca4fa10).

This was found while debugging an iwm crash on another BSD using the same
driver lineage (DragonFly, upstream bug 3449)

Locally tested:

  • 7260, 9260, STA mode

PR: kern/299427
Submitted by: David Bidner <david@crap.solutions>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Sat, Oct 17, 9:38 PM
This revision was automatically updated to reflect the committed changes.