mirror of
https://github.com/torvalds/linux.git
synced 2024-12-13 22:53:20 +00:00
7df5ff258b
In qmi_handle_init(), a buffer is allocated for to hold messages received through the handle's socket. Any "normal" messages (expected by the caller) will have a header prepended, so the buffer size is adjusted to accomodate that. The buffer must also be of sufficient size to receive control messages, so the size is increased if necessary to ensure these will fit. Unfortunately the calculation is done wrong, making it possible for the calculated buffer size to be too small to hold a "normal" message. Specifically, if: recv_buf_size > sizeof(struct qrtr_ctrl_pkt) - sizeof(struct qmi_header) AND recv_buf_size < sizeof(struct qrtr_ctrl_pkt) the current logic will use sizeof(struct qrtr_ctrl_pkt) as the receive buffer size, which is not enough to hold the maximum "normal" message plus its header. Currently this problem occurs for (13 < recv_buf_size < 20). This patch corrects this. Signed-off-by: Alex Elder <elder@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org> |
||
---|---|---|
.. | ||
cmd-db.c | ||
glink_ssr.c | ||
Kconfig | ||
Makefile | ||
mdt_loader.c | ||
qcom_gsbi.c | ||
qcom-geni-se.c | ||
qmi_encdec.c | ||
qmi_interface.c | ||
rmtfs_mem.c | ||
smd-rpm.c | ||
smem_state.c | ||
smem.c | ||
smp2p.c | ||
smsm.c | ||
spm.c | ||
wcnss_ctrl.c |