mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
rpmsg: slatecom: maintain rx_size to read
For cmd close_ack or open request where rx_size is being incrementing with respect to offset might lead to out of bound read from rx_data. Decrease rx_size as we process commands. Change-Id: I492eadcbebb78386fc20f744eb9ad8db4a2914fc Signed-off-by: Kaushal Hooda <quic_khooda@quicinc.com>
This commit is contained in:
parent
58e401790a
commit
ab0f86134f
1 changed files with 2 additions and 2 deletions
|
|
@ -1935,7 +1935,7 @@ static void glink_slatecom_process_cmd(struct glink_slatecom *glink, void *rx_da
|
|||
case SLATECOM_CMD_CLOSE_ACK:
|
||||
glink_slatecom_rx_defer(glink,
|
||||
rx_data + offset - sizeof(*msg),
|
||||
rx_size + offset - sizeof(*msg), 0);
|
||||
rx_size - offset + sizeof(*msg), 0);
|
||||
break;
|
||||
case SLATECOM_CMD_RX_INTENT_REQ:
|
||||
glink_slatecom_handle_intent_req(glink, param1, param2);
|
||||
|
|
@ -1948,7 +1948,7 @@ static void glink_slatecom_process_cmd(struct glink_slatecom *glink, void *rx_da
|
|||
name = rx_data + offset;
|
||||
glink_slatecom_rx_defer(glink,
|
||||
rx_data + offset - sizeof(*msg),
|
||||
rx_size + offset - sizeof(*msg),
|
||||
rx_size - offset + sizeof(*msg),
|
||||
ALIGN(name_len, SLATECOM_ALIGNMENT));
|
||||
|
||||
offset += ALIGN(name_len, SLATECOM_ALIGNMENT);
|
||||
|
|
|
|||
Loading…
Reference in a new issue