|WARNING| [27.03] net/ice: enable DDP loading from FreeBSD kernel module

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Thu Nov 19 18:28:27 CET 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173051

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-19

**Error**

1. FreeBSD build failure: the section-header helper is defined under one name and called under another.

   The definition is:
   ```c
   static const Elf64_Shdr *
   ice_kmod_get_sect_hdr(const uint8_t *img, size_t img_len, const Elf64_Ehdr *eh, unsigned int idx)
   ```
   But all three call sites use a different name:
   ```c
   *sec = ice_kmod_get_shdr(img, img_len, eh, sym->st_shndx);
   symtab = ice_kmod_get_shdr(img, img_len, eh, i);
   const Elf64_Shdr *strtab = ice_kmod_get_shdr(img, img_len, eh, symtab->sh_link);
   ```
   `ice_kmod_get_shdr` is never declared, so the FreeBSD build fails with an implicit-declaration error.
   CI on Linux will not catch this, because the code is inside `#ifdef RTE_EXEC_ENV_FREEBSD`.
   Fix: use one name for both the definition and the callers.

**Info**

1. The end-symbol match can read one byte past the end of the string table.

   The check is:
   ```c
   if (strnlen(name, strtab->sh_size - syms[i].st_name) == fw_name_len + end_len &&
   		strncmp(name, start_name, fw_name_len) == 0 &&
   		strcmp(name + fw_name_len, ICE_KMOD_FW_SYM_END) == 0) {
   ```
   If the name is not NUL-terminated within the section, `strnlen()` returns the full remaining length.
   If that length happens to equal `fw_name_len + end_len`, `strcmp()` then reads the terminator byte just outside the section.
   That byte could also be past the end of the mapped file.

   The start-symbol loop already guards against this with `len == max_len`.
   Apply the same guard here, for example:
   ```c
   const size_t max_len = strtab->sh_size - syms[i].st_name;
   const size_t len = strnlen(name, max_len);
   if (len == max_len || len != fw_name_len + end_len || ...)
   	continue;
   ```
   This is hardening only, since the module file comes from the kernel module path.

Review-Result: ERROR


More information about the test-report mailing list