In the Linux kernel, the following vulnerability has been resolved:
wifi: ath12k: Correct tid cleanup when tid setup fails
Currently, if any error occurs during ath12kdprxpeertidsetup(), the tid value is already incremented, even though the corresponding TID is not actually allocated. Proceed to ath12kdprxpeertiddelete() starting from unallocated tid, which might leads to freeing unallocated TID and cause potential crash or out-of-bounds access.
Hence, fix by correctly decrementing tid before cleanup to match only the successfully allocated TIDs.
Also, remove tid-- from failure case of ath12kdprxpeerfrag_setup(), as decrementing the tid before cleanup in loop will take care of this.
Compile tested only.