WSL2-Linux-Kernel/drivers/bus/mhi/host
Krishna chaitanya chundru 94991728c8 bus: mhi: host: Add alignment check for event ring read pointer
[ Upstream commit eff9704f5332a13b08fbdbe0f84059c9e7051d5f ]

Though we do check the event ring read pointer by "is_valid_ring_ptr"
to make sure it is in the buffer range, but there is another risk the
pointer may be not aligned.  Since we are expecting event ring elements
are 128 bits(struct mhi_ring_element) aligned, an unaligned read pointer
could lead to multiple issues like DoS or ring buffer memory corruption.

So add a alignment check for event ring read pointer.

Fixes: ec32332df7 ("bus: mhi: core: Sanity check values from remote device before use")
cc: stable@vger.kernel.org
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20231031-alignment_check-v2-1-1441db7c5efd@quicinc.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 08:54:33 +01:00
..
Kconfig
Makefile
boot.c bus: mhi: host: Use mhi_tryset_pm_state() for setting fw error state 2023-05-17 11:50:14 +02:00
debugfs.c
init.c bus: mhi: host: Rename "struct mhi_tre" to "struct mhi_ring_element" 2024-02-23 08:54:33 +01:00
internal.h bus: mhi: host: Rename "struct mhi_tre" to "struct mhi_ring_element" 2024-02-23 08:54:33 +01:00
main.c bus: mhi: host: Add alignment check for event ring read pointer 2024-02-23 08:54:33 +01:00
pci_generic.c
pm.c bus: mhi: host: Skip MHI reset if device is in RDDM 2023-09-19 12:22:56 +02:00