From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C16C13858D33; Thu, 16 Feb 2023 22:33:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C16C13858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676586815; bh=xSNjpn97MCRLGlXqfUWTbW3ZcxthOFjJVKJspigbjjk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FLLGc8E7apvNuAB5MBbIhFVtspqAxlQGeUG40AakOlwwW6ejGxVNhDCj81o45vVZu 1RfBq9JbtNlWwCBABHieRVEYm4gmhebLLIamJmuBPJi/QCBkwCyxQZJ4wBBN6Vhq8F txYK2385HW4BUKjRaxmCufS6jWrnJmBO29fvQQqA= From: "petelomax at ymail dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/30020] segfault in ld-linux after aug 2022 Date: Thu, 16 Feb 2023 22:33:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: petelomax at ymail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30020 --- Comment #12 from Pete Lomax --- Here's a 32 bit nasm example that works fine on 3.2.0-126-generic-pae but segfaults on 5.15.0-58-generic. I have narrowed it down to the PT_LOAD 3 or= 4, if you put 4 of 4 back in it'll work again, I'll continue playing with that= to see whether I can get what I need out of it (and make me a 64-bit version). ; tiny.asm BITS 32 %define ET_EXEC 2 %define EM_386 3 %define EV_CURRENT 1 %define PT_LOAD 1 %define PT_DYNAMIC 2 %define PT_INTERP 3 %define PF_X 1 %define PF_W 2 %define PF_R 4 %define STT_FUNC 2 %define STB_GLOBAL 1 %define R_386_PC32 2 %define DT_NULL 0 %define DT_NEEDED 1 %define DT_HASH 4 %define DT_STRTAB 5 %define DT_SYMTAB 6 %define DT_STRSZ 10 %define DT_SYMENT 11 %define DT_REL 17 %define DT_RELSZ 18 %define DT_RELENT 19 %define ST_INFO(b, t) (((b) << 4) | (t)) %define R_INFO(s, t) (((s) << 8) | (t)) phentsz equ 0x20 ; shentsz equ 0x28 shentsz equ 0x0 org 0x08048000 ;; The ELF header ehdr: ; Elf32_Ehdr db 0x7F, "ELF", 1, 1, 1 ; e_ident times 9 db 0 dw ET_EXEC ; e_type dw EM_386 ; e_machine dd EV_CURRENT ; e_version dd _start ; e_entry dd phdr - $$ ; e_phoff dd 0 ; e_shoff dd 0 ; e_flags dw ehdrsz ; e_ehsize dw phentsz ; e_phentsize dw 3 ; e_phnum dw shentsz ; e_shentsize dw 0 ; e_shnum dw 0 ; e_shstrndx ehdrsz equ $ - ehdr ;; The program segment header table phdr: ; Elf32_Phdr dd PT_INTERP ; p_type dd interp - $$ ; p_offset dd interp ; p_vaddr dd interp ; p_paddr dd interpsz ; p_filesz dd interpsz ; p_memsz dd PF_R ; p_flags dd 0 ; p_align ; phentsz equ $ - phdr dd PT_DYNAMIC ; p_type dd dyntab - $$ ; p_offset dd dyntab ; p_vaddr dd dyntab ; p_paddr dd dyntabsz ; p_filesz dd dyntabsz ; p_memsz dd PF_R | PF_W ; p_flags dd 4 ; p_align ; dd PT_LOAD ; p_type ; dd symtab - $$ ; p_offset ; dd symtab ; p_vaddr ; dd symtab ; p_paddr ; dd symtabsz ; p_filesz ; dd symtabsz ; p_memsz ; dd PF_R | PF_W ; p_flags ; dd 4 ; p_align ; ; dd PT_LOAD ; p_type ; dd data - $$ ; p_offset ; dd data ; p_vaddr ; dd data ; p_paddr ; dd datasz ; p_filesz ; dd datasz ; p_memsz ; dd PF_R | PF_W ; p_flags ; dd 4 ; p_align dd PT_LOAD ; p_type dd code - $$ ; p_offset dd code ; p_vaddr dd code ; p_paddr dd codesz ; p_filesz dd codesz ; p_memsz dd PF_R | PF_W | PF_X ; p_flags dd 0x1000 ; p_align ; dd PT_LOAD ; p_type ; dd 0 ; p_offset ; dd $$ ; p_vaddr ; dd $$ ; p_paddr ; dd filesz ; p_filesz ; dd memsz ; p_memsz ; dd PF_R | PF_W | PF_X ; p_flags ; dd 0x1000 ; p_align ;; The interpreter segment interp: db '/lib/ld-linux.so.2', 0 interpsz equ $ - interp db 0 ; pad/dword-align ;; The dynamic section dyntab: dd DT_STRTAB, strtab dd DT_STRSZ, strtabsz dd DT_SYMTAB, symtab dd DT_SYMENT, symentsz dd DT_REL, reltab dd DT_RELSZ, reltabsz dd DT_RELENT, relentsz dd DT_HASH, hashtab dd DT_NEEDED, libc_name dd DT_NULL, 0 dyntabsz equ $ - dyntab ;; The symbol table symtab: ; Elf32_Sym dd 0 ; st_name dd 0 ; st_value dd 0 ; st_size db 0 ; st_info db 0 ; st_other dw 0 ; st_shndx symentsz equ $ - symtab=20=20 dd exit_name ; st_name dd 0 ; st_value dd 0 ; st_size db ST_INFO(STB_GLOBAL, STT_FUNC) ; st_info db 0 ; st_other dw 0 ; st_shndx ;; The hash table hashtab: dd 1 ; no. of buckets dd 2 ; no. of symbols dd 1 ; the bucket: symbo= l #1 dd 0, 0 ; two links, both z= ero ;; The string table strtab: db 0 libc_name equ $ - strtab db 'libc.so.6', 0 exit_name equ $ - strtab db '_exit', 0 strtabsz equ $ - strtab ;; The relocation table reltab: ; Elf32_Rel dd exit_call ; r_offset dd R_INFO(1, R_386_PC32) ; r_info relentsz equ $ - reltab reltabsz equ $ - reltab symtabsz equ $ - symtab=20=20 ;; Data section data db 'Phix'=20=20 ; exit dd 0 datasz equ $ - data ;; Our program _start: push byte 42 call exit_call exit_call equ $ - 4 code equ _start codesz equ $ - code ;; End of the file image. filesz equ $ - $$ memsz equ filesz --=20 You are receiving this mail because: You are on the CC list for the bug.=