]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix bpf_msg_pull_data()
authorTushar Dave <tushar.n.dave@oracle.com>
Fri, 31 Aug 2018 21:45:16 +0000 (23:45 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Sun, 2 Sep 2018 20:29:53 +0000 (22:29 +0200)
commit9f3c52482c6a0adde88875e59ebeb0c17f05352f
treea38eb4ddd5568fcd3647115dd0cae63c8fcf3bb4
parent47c5ac56e04c08a3483ed470a8fc79ed0e89b1bb
bpf: Fix bpf_msg_pull_data()

Helper bpf_msg_pull_data() mistakenly reuses variable 'offset' while
linearizing multiple scatterlist elements. Variable 'offset' is used
to find first starting scatterlist element
    i.e. msg->data = sg_virt(&sg[first_sg]) + start - offset"

Use different variable name while linearizing multiple scatterlist
elements so that value contained in variable 'offset' won't get
overwritten.

Fixes: d345afaf638d ("bpf: sk_msg program helper bpf_sk_msg_pull_data")
Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/filter.c