Page MenuHomeFreeBSD

linuxkpi: Fix an off-by-one error in the kfifo implementation
ClosedPublic

Authored by markj on Mon, Apr 13, 3:05 AM.
Tags
None
Referenced Files
F153416922: D56371.id.diff
Tue, Apr 21, 1:24 AM
Unknown Object (File)
Mon, Apr 20, 2:10 AM
Unknown Object (File)
Sat, Apr 18, 11:52 PM
Unknown Object (File)
Sat, Apr 18, 1:21 PM
Unknown Object (File)
Sat, Apr 18, 8:33 AM
Unknown Object (File)
Sat, Apr 18, 8:15 AM
Unknown Object (File)
Sat, Apr 18, 6:26 AM
Unknown Object (File)
Sat, Apr 18, 6:26 AM
Subscribers

Details

Summary

"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Reported by: Stanislav Fort <stanislav.fort@aisle.com>

Diff Detail

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

Event Timeline

markj requested review of this revision.Mon, Apr 13, 3:05 AM
This revision is now accepted and ready to land.Mon, Apr 13, 1:50 PM
bz added a subscriber: bz.

This seems to be correct given we do the check after updating the values.

Do we know what is using the kfifo these days; I am just curious where the report came from?
I know I wrote it for ath10k (which is not connected to the official build yet) and it was only stubs before.
Hmm drm-kmod 6.10 amdgpu uses it for RAS poison events. OK.

In D56371#1290515, @bz wrote:

This seems to be correct given we do the check after updating the values.

Do we know what is using the kfifo these days; I am just curious where the report came from?

I believe it comes from analyzing kernel sources rather than testing any affected drivers.

I know I wrote it for ath10k (which is not connected to the official build yet) and it was only stubs before.
Hmm drm-kmod 6.10 amdgpu uses it for RAS poison events. OK.

Seems to be used by mt76 too.

In D56371#1290515, @bz wrote:

This seems to be correct given we do the check after updating the values.

Do we know what is using the kfifo these days; I am just curious where the report came from?

I believe it comes from analyzing kernel sources rather than testing any affected drivers.

Ah, makes sense :)

I know I wrote it for ath10k (which is not connected to the official build yet) and it was only stubs before.
Hmm drm-kmod 6.10 amdgpu uses it for RAS poison events. OK.

Seems to be used by mt76 too.

For (old) mt7610/12/30 cards. Not even sure if my stash goes so far back. Not compiled on FreeBSD. I do have a 7615 which is worthwhile as on SoCs as well but doesn't use the mt76x02 "lib" parts.