{"id":"CVE-2025-38413","aliases":["CVE-2025-38413"],"related":[],"kind":"vulnerability","state":"published","title":"virtio-net: xsk: rx: fix the frame's length check","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nvirtio-net: xsk: rx: fix the frame's length check\n\nWhen calling buf_to_xdp, the len argument is the frame data's length\nwithout virtio header's length (vi->hdr_len). We check that len with\n\n\txsk_pool_get_rx_frame_size() + vi->hdr_len\n\nto ensure the provided len does not larger than the allocated chunk\nsize. The additional vi->hdr_len is because in virtnet_add_recvbuf_xsk,\nwe use part of XDP_PACKET_HEADROOM for virtio header and ask the vhost\nto start placing data from\n\n\thard_start + XDP_PACKET_HEADROOM - vi->hdr_len\nnot\n\thard_start + XDP_PACKET_HEADROOM\n\nBut the first buffer has virtio_header, so the maximum frame's length in\nthe first buffer can only be\n\n\txsk_pool_get_rx_frame_size()\nnot\n\txsk_pool_get_rx_frame_size() + vi->hdr_len\n\nlike in the current check.\n\nThis commit adds an additional argument to buf_to_xdp differentiate\nbetween the first buffer and other ones to correctly calculate the maximum\nframe's length.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nvirtio-net: xsk: rx: fix the frame's length check\n\nWhen calling buf_to_xdp, the len argument is the frame data's length\nwithout virtio header's length (vi->hdr_len). We check that len with\n\n\txsk_pool_get_rx_frame_size() + vi->hdr_len\n\nto ensure the provided len does not larger than the allocated chunk\nsize. The additional vi->hdr_len is because in virtnet_add_recvbuf_xsk,\nwe use part of XDP_PACKET_HEADROOM for virtio header and ask the vhost\nto start placing data from\n\n\thard_start + XDP_PACKET_HEADROOM - vi->hdr_len\nnot\n\thard_start + XDP_PACKET_HEADROOM\n\nBut the first buffer has virtio_header, so the maximum frame's length in\nthe first buffer can only be\n\n\txsk_pool_get_rx_frame_size()\nnot\n\txsk_pool_get_rx_frame_size() + vi->hdr_len\n\nlike in the current check.\n\nThis commit adds an additional argument to buf_to_xdp differentiate\nbetween the first buffer and other ones to correctly calculate the maximum\nframe's length.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: virtio-net: xsk: rx: corrección de la comprobación de la longitud del marco. Al llamar a buf_to_xdp, el argumento len es la longitud de los datos del marco sin la longitud del encabezado de Virtio (vi-&gt;hdr_len). Comprobamos esta longitud con xsk_pool_get_rx_frame_size() + vi-&gt;hdr_len para garantizar que la longitud proporcionada no supere el tamaño del fragmento asignado. El valor adicional de vi-&gt;hdr_len se debe a que, en virtnet_add_recvbuf_xsk, usamos parte de XDP_PACKET_HEADROOM para el encabezado de virtio y solicitamos al vhost que comience a colocar datos desde hard_start + XDP_PACKET_HEADROOM - vi-&gt;hdr_len, no hard_start + XDP_PACKET_HEADROOM. Sin embargo, el primer búfer tiene virtio_header, por lo que la longitud máxima del fotograma en el primer búfer solo puede ser xsk_pool_get_rx_frame_size(), no xsk_pool_get_rx_frame_size() + vi-&gt;hdr_len, como en la comprobación actual. Este commit añade un argumento adicional a buf_to_xdp para diferenciar entre el primer búfer y los demás y calcular correctamente la longitud máxima del fotograma.","source":"nvd"}],"published":"2025-07-25T13:20:17.394Z","modified":"2026-08-05T12:01:42.803Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","score":7.7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"a4e7ba7027012f009f22a68bcfde670f9298d3a4","fixed":"892f6ed9a4a38bb3360fdff091b9241cfa105b61","status":"affected"},{"type":"git","introduced":"a4e7ba7027012f009f22a68bcfde670f9298d3a4","fixed":"6013bb6bc24c2cac3f45b37a15b71b232a5b00ff","status":"affected"},{"type":"git","introduced":"a4e7ba7027012f009f22a68bcfde670f9298d3a4","fixed":"5177373c31318c3c6a190383bfd232e6cf565c36","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.11","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.11","status":"unaffected"},{"type":"semver","introduced":"6.12.37","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.6","lastAffected":"6.15.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.16","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.11","fixed":"6.12.37"},{"status":"affected","introduced":"6.13","fixed":"6.15.6"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/892f6ed9a4a38bb3360fdff091b9241cfa105b61","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6013bb6bc24c2cac3f45b37a15b71b232a5b00ff","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5177373c31318c3c6a190383bfd232e6cf565c36","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38413","url":"https://www.cve.org/CVERecord?id=CVE-2025-38413","licence":"CVE Terms of Use","modified":"2026-08-05T12:01:42.803Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38413","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38413","licence":"Public domain","modified":"2026-07-30T06:23:13.000Z"}],"updatedAt":"2026-11-25T22:59:01.700Z","epss":{"score":0.0028,"percentile":0.13098,"date":"2026-11-30T12:00:22.000Z"}}