aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-07-26 21:03:28 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-07-26 21:09:16 +0000
commitbe79f30d6c3e353856d4f82227b270abc26be702 (patch)
tree0afa41c7c18ae17cc4a106cd73b4444f1960e200 /sys/kern/uipc_mbuf.c
parentd8787d4f7848bad8bd69325969806e1a76d0c3df (diff)
downloadsrc-be79f30d6c3e353856d4f82227b270abc26be702.tar.gz
src-be79f30d6c3e353856d4f82227b270abc26be702.zip
m_dup: Handle unmapped mbufs as an input mbuf.
Use m_copydata() instead of a direct bcopy() when copying data out of a source mbuf into a newly-allocated mbuf. PR: 256610 Reported by: Niels Bakker <niels=freebsd@bakker.net> Reviewed by: markj MFC after: 2 weeks
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r--sys/kern/uipc_mbuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 74c8ef62eb8d..0f1a0c5e4e0c 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -729,7 +729,7 @@ m_dup(const struct mbuf *m, int how)
while (n->m_len < nsize && m != NULL) {
int chunk = min(nsize - n->m_len, m->m_len - moff);
- bcopy(m->m_data + moff, n->m_data + n->m_len, chunk);
+ m_copydata(m, moff, chunk, n->m_data + n->m_len);
moff += chunk;
n->m_len += chunk;
remain -= chunk;