Message ID | 3643756b626bf18fdc38dd50fc41c5acca61e9b3.1719302367.git.tanggeliang@kylinos.cn (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Fixes for BPF selftests on Loongarch | expand |
diff --git a/net/core/skmsg.c b/net/core/skmsg.c index bafcc1e2eadf..495b18b5dce5 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -375,6 +375,8 @@ int sk_msg_memcopy_from_iter(struct sock *sk, struct iov_iter *from, do { sge = sk_msg_elem(msg, i); + if (!sg_page(sge)) + goto out; /* This is possible if a trim operation shrunk the buffer */ if (msg->sg.copybreak >= sge->length) { msg->sg.copybreak = 0;