diff options
| author | Will Deacon <will@kernel.org> | 2025-07-17 12:01:13 +0300 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2025-08-01 16:11:09 +0300 |
| commit | fac6b82e0f3eaca33c8c67ec401681b21143ae17 (patch) | |
| tree | 0cd114a995d746b84cf606cecccf78a83ce21d45 /include/linux | |
| parent | 2304c64a2866c58534560c63dc6e79d09b8f8d8d (diff) | |
| download | linux-fac6b82e0f3eaca33c8c67ec401681b21143ae17.tar.xz | |
vsock/virtio: Move SKB allocation lower-bound check to callers
virtio_vsock_alloc_linear_skb() checks that the requested size is at
least big enough for the packet header (VIRTIO_VSOCK_SKB_HEADROOM).
Of the three callers of virtio_vsock_alloc_linear_skb(), only
vhost_vsock_alloc_skb() can potentially pass a packet smaller than the
header size and, as it already has a check against the maximum packet
size, extend its bounds checking to consider the minimum packet size
and remove the check from virtio_vsock_alloc_linear_skb().
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Will Deacon <will@kernel.org>
Message-Id: <20250717090116.11987-7-will@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/virtio_vsock.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h index 4504ea29ff82..36dd0cd55368 100644 --- a/include/linux/virtio_vsock.h +++ b/include/linux/virtio_vsock.h @@ -57,9 +57,6 @@ virtio_vsock_alloc_linear_skb(unsigned int size, gfp_t mask) { struct sk_buff *skb; - if (size < VIRTIO_VSOCK_SKB_HEADROOM) - return NULL; - skb = alloc_skb(size, mask); if (!skb) return NULL; |
