Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2017 13:37:35 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314850 - head/sys/kern
Message-ID:  <201703071337.v27DbZWe070086@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Mar  7 13:37:35 2017
New Revision: 314850
URL: https://svnweb.freebsd.org/changeset/base/314850

Log:
  Require whole brand string matching for old Elf branding.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Tue Mar  7 13:36:43 2017	(r314849)
+++ head/sys/kern/imgact_elf.c	Tue Mar  7 13:37:35 2017	(r314850)
@@ -309,8 +309,8 @@ __elfN(get_brandinfo)(struct image_param
 			continue;
 		if (hdr->e_machine == bi->machine &&
 		    (hdr->e_ident[EI_OSABI] == bi->brand ||
-		    strncmp((const char *)&hdr->e_ident[OLD_EI_BRAND],
-		    bi->compat_3_brand, strlen(bi->compat_3_brand)) == 0)) {
+		    strcmp((const char *)&hdr->e_ident[OLD_EI_BRAND],
+		    bi->compat_3_brand) == 0)) {
 			/* Looks good, but give brand a chance to veto */
 			if (!bi->header_supported || bi->header_supported(imgp))
 				return (bi);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703071337.v27DbZWe070086>