From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 749243858D3C; Tue, 23 Jan 2024 22:36:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 749243858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706049412; bh=8Js3PunjNR3LaBXcSUUflPhBZp5z91VxRcBewB/cyiQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eaFUVzqblA5Z6C49JKvZZTIk3KP9NAu4B4qZlr0UT0aHAIxUPHsfKklu+/0Ce3BRT I/9ZtCMEjxsxb3SuzNpwJlf0yKHSCSkNmyC1ramDbO92s1b2cfDRjOq/FblnBntQfM PM3dJ/uBx/9Q9uDment6VNpBdYg49NhPFLkbbv0s= From: "bruening at google dot com" To: elfutils-devel@sourceware.org Subject: [Bug libelf/31225] Crash when using elf_memory() on a compressed section; fixed with s/ELF_C_READ/ELF_C_READ_MMAP/ Date: Tue, 23 Jan 2024 22:36:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libelf X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bruening at google 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=3D31225 --- Comment #2 from Derek Bruening --- Our usage is inside a large complex code base that mmaps the file on its ow= n.=20 It seems that any use of elf_memory() that has mapped the file on their own= as read-only will hit this. I know it may not be easy to read random code inside our code base but FTR elf_memory is called here: https://github.com/DynamoRIO/dynamorio/blob/master/ext/drsyms/drsyms_elf.c#= L283 This is our own code which maps the file (this is pre-existing code that wo= rked with the libelf from elftoolchain): https://github.com/DynamoRIO/dynamorio/blob/master/ext/drsyms/drsyms_unix_c= ommon.c#L134 It looks like we are passing MAP_PRIVATE, so we may be able to change our mapping to include write privileges (as copy-on-write): is that what elfuti= ls expects? I had thought with the ELF_C_READ_MMAP support elfutils deliberat= ely supported read-only mappings in general? --=20 You are receiving this mail because: You are on the CC list for the bug.=