Skip to content

Commit 57f2104

Browse files
rgorby1gregkh
authored andcommitted
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: Russ Gorby <russ.gorby@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 7263287 commit 57f2104

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/tty/n_gsm.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,8 @@ static int gsm_dlci_data_output_framed(struct gsm_mux *gsm,
875875
*dp++ = last << 7 | first << 6 | 1; /* EA */
876876
len--;
877877
}
878-
memcpy(dp, skb_pull(dlci->skb, len), len);
878+
memcpy(dp, dlci->skb->data, len);
879+
skb_pull(dlci->skb, len);
879880
__gsm_data_queue(dlci, msg);
880881
if (last)
881882
dlci->skb = NULL;

0 commit comments

Comments
 (0)