kernel - merge m_pulldown() bug fix
commitc24e3890e671f6034b05eae5dd9bde472d210931
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 21 Aug 2019 01:36:46 +0000 (20 18:36 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 21 Aug 2019 01:55:46 +0000 (20 18:55 -0700)
tree5b5e5f9dfa0b48cf4a2453cf32c15e988008ba25
parentb26f4075da739f8e5b11109cea6ecd53c2fb5f47
kernel - merge m_pulldown() bug fix

In m_pulldown(), before trying to prepend bytes to the subsequent mbuf,
ensure that the subsequent mbuf contains the remainder of the bytes
the caller sought. If this is not the case, fall through to the code
which gathers the bytes in a new mbuf.

This fixes a bug where m_pulldown() could fail to gather all the desired
bytes into consecutive memory.

Patch-by: sephe
FreeBSD-PR: 238787
Reported by: A reddit user
Discussed with: emaste
Obtained from: NetBSD
Obtained from: FreeBSD
sys/kern/uipc_mbuf2.c