Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Apr 2009 16:42:57 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r191210 - in stable/7/sys: . amd64/amd64 amd64/linux32 arm/arm compat/ia32 contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/linux ia64/ia64 kern powerpc/powerpc sparc64/sparc64 sys
Message-ID:  <200904171642.n3HGgvu8028279@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Fri Apr 17 16:42:57 2009
New Revision: 191210
URL: http://svn.freebsd.org/changeset/base/191210

Log:
  Merge r190708 from HEAD to stable/7:
  Fix KBI breakage by r190520 which affects older linux.ko binaries:
  
  1) Move the new field (brand_note) to the end of the Brandinfo structure.
  2) Add a new flag BI_BRAND_NOTE that indicates that the brand_note pointer
     is valid.
  3) Use the brand_note field if the flag BI_BRAND_NOTE is set and as old
     modules won't have the flag set, so the new field brand_note would be
     ignored.
  
  Suggested by:   jhb
  Reviewed by:	jhb
  Approved by:	re (Ken Smith), kib (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/amd64/elf_machdep.c
  stable/7/sys/amd64/linux32/linux32_sysvec.c
  stable/7/sys/arm/arm/elf_machdep.c
  stable/7/sys/compat/ia32/ia32_sysvec.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/i386/i386/elf_machdep.c
  stable/7/sys/i386/linux/linux_sysvec.c
  stable/7/sys/ia64/ia64/elf_machdep.c
  stable/7/sys/kern/imgact_elf.c
  stable/7/sys/powerpc/powerpc/elf_machdep.c
  stable/7/sys/sparc64/sparc64/elf_machdep.c
  stable/7/sys/sys/imgact_elf.h

Modified: stable/7/sys/amd64/amd64/elf_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/amd64/amd64/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -84,7 +84,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -100,7 +100,7 @@ static Elf64_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/7/sys/amd64/linux32/linux32_sysvec.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/amd64/linux32/linux32_sysvec.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -1066,7 +1066,7 @@ static Elf32_Brandinfo linux_brand = {
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux32_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 static Elf32_Brandinfo linux_glibc2brand = {
@@ -1078,7 +1078,7 @@ static Elf32_Brandinfo linux_glibc2brand
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux32_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 Elf32_Brandinfo *linux_brandlist[] = {

Modified: stable/7/sys/arm/arm/elf_machdep.c
==============================================================================
--- stable/7/sys/arm/arm/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/arm/arm/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -84,7 +84,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -100,7 +100,7 @@ static Elf32_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/compat/ia32/ia32_sysvec.c
==============================================================================
--- stable/7/sys/compat/ia32/ia32_sysvec.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/compat/ia32/ia32_sysvec.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -148,7 +148,7 @@ static Elf32_Brandinfo ia32_brand_info =
 	.sysvec		= &ia32_freebsd_sysvec,
 	.interp_newpath	= "/libexec/ld-elf32.so.1",
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -164,7 +164,7 @@ static Elf32_Brandinfo ia32_brand_oinfo 
 	.sysvec		= &ia32_freebsd_sysvec,
 	.interp_newpath	= "/libexec/ld-elf32.so.1",
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oia32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/i386/i386/elf_machdep.c
==============================================================================
--- stable/7/sys/i386/i386/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/i386/i386/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -84,7 +84,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -100,7 +100,7 @@ static Elf32_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/7/sys/i386/linux/linux_sysvec.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/i386/linux/linux_sysvec.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -1036,7 +1036,7 @@ static Elf32_Brandinfo linux_brand = {
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 static Elf32_Brandinfo linux_glibc2brand = {
@@ -1048,7 +1048,7 @@ static Elf32_Brandinfo linux_glibc2brand
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 Elf32_Brandinfo *linux_brandlist[] = {

Modified: stable/7/sys/ia64/ia64/elf_machdep.c
==============================================================================
--- stable/7/sys/ia64/ia64/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/ia64/ia64/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -92,7 +92,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
     (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info);
@@ -106,7 +106,7 @@ static Elf64_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
     (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo);

Modified: stable/7/sys/kern/imgact_elf.c
==============================================================================
--- stable/7/sys/kern/imgact_elf.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/kern/imgact_elf.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -192,7 +192,7 @@ __elfN(get_brandinfo)(struct image_param
 	for (i = 0; i < MAX_BRANDS; i++) {
 		bi = elf_brand_list[i];
 		if (bi != NULL && hdr->e_machine == bi->machine &&
-		    bi->brand_note != NULL) {
+		    (bi->flags & BI_BRAND_NOTE) != 0) {
 			ret = __elfN(check_note)(imgp, bi->brand_note, osrel);
 			if (ret)
 				return (bi);

Modified: stable/7/sys/powerpc/powerpc/elf_machdep.c
==============================================================================
--- stable/7/sys/powerpc/powerpc/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/powerpc/powerpc/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -87,7 +87,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -103,7 +103,7 @@ static Elf32_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/sparc64/sparc64/elf_machdep.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/sparc64/sparc64/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -99,7 +99,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -115,7 +115,7 @@ static Elf64_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/sys/imgact_elf.h
==============================================================================
--- stable/7/sys/sys/imgact_elf.h	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/sys/imgact_elf.h	Fri Apr 17 16:42:57 2009	(r191210)
@@ -70,9 +70,10 @@ typedef struct {
 	const char *interp_path;
 	struct sysentvec *sysvec;
 	const char *interp_newpath;
-	Elf_Brandnote *brand_note;
 	int flags;
+	Elf_Brandnote *brand_note;
 #define	BI_CAN_EXEC_DYN	0x0001
+#define	BI_BRAND_NOTE	0x0002
 } __ElfN(Brandinfo);
 
 __ElfType(Auxargs);



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