From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 17 16:42:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87B2A1065679; Fri, 17 Apr 2009 16:42:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 714928FC14; Fri, 17 Apr 2009 16:42:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HGgwZF028290; Fri, 17 Apr 2009 16:42:58 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HGgvu8028279; Fri, 17 Apr 2009 16:42:57 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200904171642.n3HGgvu8028279@svn.freebsd.org> From: Dmitry Chagin Date: Fri, 17 Apr 2009 16:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: 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 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2009 16:42:59 -0000 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);