]> git.baikalelectronics.ru Git - kernel.git/commit
bus: mhi: host: Range check CHDBOFF and ERDBOFF
authorJeffrey Hugo <quic_jhugo@quicinc.com>
Fri, 24 Mar 2023 16:13:04 +0000 (10:13 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:05 +0000 (23:03 +0900)
commit4481f2e4ae63623d8f4e71923a2a7e27aebe2ffc
treec5b31989cb090a004668761b765fecbb70b0cfd6
parent21fd0a4c260f868c8b649f94febda035668bf44c
bus: mhi: host: Range check CHDBOFF and ERDBOFF

commit 6a0c637bfee69a74c104468544d9f2a6579626d0 upstream.

If the value read from the CHDBOFF and ERDBOFF registers is outside the
range of the MHI register space then an invalid address might be computed
which later causes a kernel panic.  Range check the read value to prevent
a crash due to bad data from the device.

Fixes: 0fbb37722fec ("bus: mhi: core: Add support for ringing channel/event ring doorbells")
Cc: stable@vger.kernel.org
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/1679674384-27209-1-git-send-email-quic_jhugo@quicinc.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/mhi/host/init.c