When a reply message outgrew its buffer, _nlmsg_refill_buffer() allocated a larger one and copied the partially written message into it. The new buffer was sized for the data being added but not for the part of the message already written, so the kernel could write past its end. An unprivileged local user, including one in a jail, can overflow a kernel heap buffer, potentially escalating privileges and gaining full control of the affected system.