mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
tuntap: add sanity checks about msg_controllen in sendmsg
[ Upstream commit 74a335a07a17d131b9263bfdbdcb5e40673ca9ca ] In patch [1], tun_msg_ctl was added to allow pass batched xdp buffers to tun_sendmsg. Although we donot use msg_controllen in this path, we should check msg_controllen to make sure the caller pass a valid msg_ctl. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fe8dd45bb7556246c6b76277b1ba4296c91c2505 Reported-by: Eric Dumazet <[email protected]> Suggested-by: Jason Wang <[email protected]> Signed-off-by: Harold Huang <[email protected]> Acked-by: Jason Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
c68dd44fb8
commit
1166f5c139
3 changed files with 5 additions and 2 deletions
|
|
@ -472,6 +472,7 @@ static void vhost_tx_batch(struct vhost_net *net,
|
|||
goto signal_used;
|
||||
|
||||
msghdr->msg_control = &ctl;
|
||||
msghdr->msg_controllen = sizeof(ctl);
|
||||
err = sock->ops->sendmsg(sock, msghdr, 0);
|
||||
if (unlikely(err < 0)) {
|
||||
vq_err(&nvq->vq, "Fail to batch sending packets\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue