|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:56:34 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: undefined function `ice_kmod_get_shdr`, so the FreeBSD build fails**

The helper is defined under one name but called under another:

```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)
```

Every call site uses 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);
```

- On FreeBSD, `ice_kmod_get_shdr` is an implicit or undeclared function, which is a compile error.
- `ice_kmod_get_sect_hdr` is an unused static function, which `-Werror` rejects.
- The code is inside `#ifdef RTE_EXEC_ENV_FREEBSD`, so Linux CI will not catch this.

Fix: rename either the definition or the call sites so they match.

**Info: possible out-of-bounds read in the end-symbol search on a malformed module**

```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) {
```

- The start-symbol loop rejects names with no terminator inside the string table (`len == max_len`). This loop does not.
- If `strnlen()` returns exactly `max_len`, the string has no NUL inside the section. `strcmp()` then reads past the end of the string table, and past the end of the mmap'd image if the strtab is at the end of the file.
- The module comes from the system module path, so this is hardening rather than a trust-boundary issue.

Fix: compute the length into a local, require it to be less than `max_len`, and use `memcmp()` for the suffix. This mirrors the start-symbol loop.

Review-Result: ERROR


More information about the test-report mailing list