提交 57f2104f 编写于 作者: R Russ Gorby 提交者: Greg Kroah-Hartman

tty: n_gsm: improper skb_pull() use was leaking framed data

gsm_dlci_data_output_framed() was doing:
memcpy(dp, skb_pull(dlci->skb, len), len);

The problem is skb_pull() returns the post-increment data ptr
so the first chunk of dlci->skb->data is leaked.
Signed-off-by: NRuss Gorby <russ.gorby@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7263287a
......@@ -875,7 +875,8 @@ static int gsm_dlci_data_output_framed(struct gsm_mux *gsm,
*dp++ = last << 7 | first << 6 | 1; /* EA */
len--;
}
memcpy(dp, skb_pull(dlci->skb, len), len);
memcpy(dp, dlci->skb->data, len);
skb_pull(dlci->skb, len);
__gsm_data_queue(dlci, msg);
if (last)
dlci->skb = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册