]> git.ipfire.org Git - thirdparty/openwrt.git/commit
ltq-adsl-mei: check status register before reading mailbox messages
authorJan Hoffmann <jan@3e8.eu>
Fri, 11 Jul 2025 18:31:29 +0000 (20:31 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Aug 2025 13:30:57 +0000 (15:30 +0200)
commitba7b5d23f6977a65613ee32c28c2190cd01b485e
treed93aa6af037f92b6041f88001be51804d1993a9d
parente627539601d61099970ff41317f34dbc74342c75
ltq-adsl-mei: check status register before reading mailbox messages

The interrupt handler reads from the mailbox if no other reason for the
interrupt is known. If a spurious interrupt is received just after a
mailbox message has been sent, this means that the response to the
previous message is read again and returned by DSL_BSP_SendCMV instead
of the actual response.

To fix this, check the status register before reading from the mailbox
in the interrupt handler.

Tested on Fritzbox 7320. Without this change, there is occasionally a
kernel panic due to an out-of-bounds memory access in the ltq-adsl
driver (in DSL_DRV_DEV_G997_SnrAllocationNscGet), as a result of an
incorrect value returned by DSL_DRV_DANUBE_CmvRead. This is reproducible
by calling "dsl_cpe_pipe.sh g997dsnrg 1 1" multiple times.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/19385
(cherry picked from commit 6889ea7b9a466b73f59fad9c6ae942728b907200)
Link: https://github.com/openwrt/openwrt/pull/19839
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c