android_kernel_msm-6.1_noth.../drivers/net/ipa
Alex Elder 6e43dc9dcf net: ipa: compute DMA pool size properly
[ Upstream commit 6c75dc94f2b27fff57b305af9236eea181a00b6c ]

In gsi_trans_pool_init_dma(), the total size of a pool of memory
used for DMA transactions is calculated.  However the calculation is
done incorrectly.

For 4KB pages, this total size is currently always more than one
page, and as a result, the calculation produces a positive (though
incorrect) total size.  The code still works in this case; we just
end up with fewer DMA pool entries than we intended.

Bjorn Andersson tested booting a kernel with 16KB pages, and hit a
null pointer derereference in sg_alloc_append_table_from_pages(),
descending from gsi_trans_pool_init_dma().  The cause of this was
that a 16KB total size was going to be allocated, and with 16KB
pages the order of that allocation is 0.  The total_size calculation
yielded 0, which eventually led to the crash.

Correcting the total_size calculation fixes the problem.

Reported-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Tested-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Fixes: 9dd441e4ed ("soc: qcom: ipa: GSI transactions")
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20230328162751.2861791-1-elder@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-06 12:10:48 +02:00
..
data net: ipa: fix v3.5.1 resource limit max values 2022-10-25 19:48:57 -07:00
reg net: ipa: fix v3.1 resource limit masks 2022-10-25 19:48:58 -07:00
gsi.c net: ipa: generic command param fix 2023-03-10 09:33:02 +01:00
gsi.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
gsi_private.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
gsi_reg.h net: ipa: generic command param fix 2023-03-10 09:33:02 +01:00
gsi_trans.c net: ipa: compute DMA pool size properly 2023-04-06 12:10:48 +02:00
gsi_trans.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_cmd.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_cmd.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_data.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_endpoint.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_endpoint.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_gsi.c
ipa_gsi.h
ipa_interrupt.c net: ipa: disable ipa interrupt during suspend 2023-02-01 08:34:22 +01:00
ipa_interrupt.h net: ipa: disable ipa interrupt during suspend 2023-02-01 08:34:22 +01:00
ipa_main.c net: ipa: don't configure IDLE_INDICATION on v3.1 2022-10-25 19:49:13 -07:00
ipa_mem.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_mem.h
ipa_modem.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_modem.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_power.c net: ipa: disable ipa interrupt during suspend 2023-02-01 08:34:22 +01:00
ipa_power.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi_msg.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi_msg.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_reg.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_reg.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_resource.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_resource.h
ipa_smp2p.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_smp2p.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_sysfs.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_sysfs.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_table.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_table.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_uc.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_uc.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_version.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
Kconfig
Makefile net: ipa: add per-version IPA register definition files 2022-09-27 18:42:49 -07:00