diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 42b02c1bd9e7..d476aad5a124 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -312,8 +312,9 @@ __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, continue; if (hdr->e_machine == bi->machine && (hdr->e_ident[EI_OSABI] == bi->brand || + (bi->compat_3_brand != NULL && strcmp((const char *)&hdr->e_ident[OLD_EI_BRAND], - bi->compat_3_brand) == 0)) { + bi->compat_3_brand) == 0))) { /* Looks good, but give brand a chance to veto */ if (!bi->header_supported || bi->header_supported(imgp)) {