-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-EN-25:11.ena Errata Notice The FreeBSD Project Topic: ena resets and kernel panic on Nitro v4 or newer instances Category: core Module: ena Announced: 2025-07-02 Credits: Arthur Kiyanovski Affects: FreeBSD 13.5 and FreeBSD 14.2 Corrected: 2025-05-01 17:56:11 UTC (stable/14, 14.3-STABLE) 2025-07-02 18:28:12 UTC (releng/14.2, 14.2-RELEASE-p4) 2025-05-01 18:15:18 UTC (stable/13, 13.5-STABLE) 2025-07-02 18:28:31 UTC (releng/13.5, 13.5-RELEASE-p2) For general information regarding FreeBSD Errata Notices and Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background The ena(4) driver is used to access the Elastic Network Adapter network interface on recent Amazon Elastic Compute Cloud (EC2) instances. It is designed to make full use of the EC2 cloud architecture for optimal network performance. ENA Express is a feature that allows increased bandwidth and reduced latency in the AWS cloud. For optimal performance of the ENA Express feature, it is necessary to reduce LLQ width to 128. AWS instances that use Nitro card v4 or newer have a maximum tx burst size when sending tx packets. The driver is responsible to adhere to this maximum burst size by sending a doorbell to the device with no more than this burst size packets. If the burst size is exceeded a device reset happens. Since driver 2.8.0 it is possible to change the width of the tx queue LLQ (Low Latency Queues) entries. There are 2 possible widths: 128 and 256 bytes. The default is 256, however in some cases, i.e. when using the ENA Express feature, it is recommended to use a width of 128. II. Problem Description When running on instances that have a max tx burst size and the ENA device supports 256-byte wide LLQ entries, if 128-byte wide entries are selected, either by setting hw.ena.force_large_llq_header = 0 via sysctl or by turning on ENA Express for the interface, the ena(4) driver does not initialize a stack variable which is later used to setup the maximum tx burst size. III. Impact Due to the uninitialized stack variable, the ena(4) driver will exceed the maximum tx burst size, leading to device resets, making the device unusable. Additionally, the calculation of the tx burst size includes division by the uninitialized stack variable. If the stack variable is 0, this will cause division by 0 in the kernel, leading to a kernel panic. IV. Workaround It is possible to force the LLQ width to 256 by setting hw.ena.force_large_llq_header=1 via sysctl, however this causes peformance degredation when using the ENA Express feature. V. Solution Upgrade your system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date and reboot. Perform one of the following: 1) To update your system via a binary patch: Systems running a RELEASE version of FreeBSD on the amd64 or arm64 platforms, or the i386 platform on FreeBSD 13, can be updated via the freebsd-update(8) utility: # freebsd-update fetch # freebsd-update install # shutdown -r +10min "Rebooting for erratum update" 2) To update your system via a source code patch: The following patches have been verified to apply to the applicable FreeBSD release branches. a) Download the relevant patch from the location below, and verify the detached PGP signature using your PGP utility. # fetch https://security.FreeBSD.org/patches/EN-25:11/ena.patch # fetch https://security.FreeBSD.org/patches/EN-25:11/ena.patch.asc # gpg --verify ena.patch.asc b) Apply the patch. Execute the following commands as root: # cd /usr/src # patch < /path/to/patch c) Recompile your kernel as described in and reboot the system. VI. Correction details This issue is corrected as of the corresponding Git commit hash in the following stable and release branches: Branch/path Hash Revision - ------------------------------------------------------------------------- stable/14/ 3f4a674a8ee4 stable/14-n271320 releng/14.2/ ca1f7650a80d releng/14.2-n269528 stable/13/ 162b5bbb4048 stable/13-n259268 releng/13.5/ 575644144d5c releng/13.5-n259170 - ------------------------------------------------------------------------- Run the following command to see which files were modified by a particular commit: # git show --stat Or visit the following URL, replacing NNNNNN with the hash: To determine the commit count in a working tree (for comparison against nNNNNNN in the table above), run: # git rev-list --count --first-parent HEAD VII. References The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEthUnfoEIffdcgYM7bljekB8AGu8FAmhlfSUACgkQbljekB8A Gu9/qBAAsP6QA+6kpRo94XBr7mRIvrsxK76sGMDcoTX+7WhQpVOQ3NP7VteNfTJc L0NF/PPhxxjJsYzz+o5SmW7RMgLlqL/Ofi4/VWqwwW8KTAjc4nAzKn5QNWb0fdWM gBYHGWrxYb8jt8twzIZ5HCOL47mN7obbEhi/y+WN+TehjJso2GiyM7gD+haaPlBa uAjSHYh+gf2tO7o9uSvIWYHP/qqjOphShJAwyX73ePZ9DLdra4FknWzryOU4Y3LP H4ToBZHkYJV/1P/GHSGYr5hqDuqxmxoCrzr+57IyfQiKPRiRvYsRMhAzlsrMp3aJ TQucgS5wN/TbHcSIXWLkO/DZ3poKjx73pBdayR2sS1ue3zz6FktNxMSub786jtPw icqPc24nsQt3PZI6wKViZAWJgDn4U/WfJhzWTR3mix3s8oal+Y8xYviYa9GQbo9p bzld/8Of6HVcbEhg+Ayq1WI3Cez3ahvek74/KnJc9EHX+20lI3OEpIzKWw/Q6wNy L+C1s4vG6dMY8Hr7OSUVJADiVCcvX+/7WGMppqua07jbuBpGSpZyAKBUlEoiGyyu aFob0xHlcYb/ongNzyDkmGufAGl+TpqJYcajvy/jDVXQpG3zlmAqizP2IfDlzcF5 ojgxw7B9KaccauMDdASM7nGDR/Q1s8O1MMWGnwptjcmpEuC2D7s= =nJXg -----END PGP SIGNATURE-----