Bug 1518243

Summary: GDB no longer dumps memory regions marked with the VM_DONTDUMP flag
Product: Red Hat Enterprise Linux 7 Reporter: Sergio Lopez <slopezpa>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: Michal Kolar <mkolar>
Severity: high Docs Contact: Vladimír Slávik <vslavik>
Priority: high    
Version: 7.4CC: alanm, gdb-bugs, gwatson, jan.kratochvil, mcermak, mkalinin, mkolar, ohudlick, ovasik, sergiodj, uobergfe, vslavik
Target Milestone: rcKeywords: Regression, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gdb-7.6.1-108.el7 Doc Type: Bug Fix
Doc Text:
*GDB* can again dump memory protected by the "VM_DONTDUMP" flag Previous changes to the GNU Debugger *GDB* made the behavior of the "gcore" command more similar to the behavior of the Linux kernel when dumping process memory to increase data security. Consequently, users of *GDB* could not dump memory protected by the "VM_DONTDUMP" flag. The new "set dump-excluded-mappings" setting has been added to *GDB* to enable dumping of memory with this flag. As a result, users can dump the whole process memory with *GDB* again.
Story Points: ---
Clone Of:
: 1524312 (view as bug list) Environment:
Last Closed: 2018-04-10 10:25:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1524312    

Description Sergio Lopez 2017-11-28 13:34:12 UTC
Versions prior to gdb-7.6.1-83.el7, unconditionally included all memory regions when generating a dump file. Starting with this version, by default GDB will both inspect /proc/PID/coredump_filter, and unconditionally ignore memory regions marked with VM_DONTDUMP.

While it's possible requesting to GDB to ignore /proc/PID/coredump_filter by using the 'set use-coredump-filter' command, there's no way to request it to ignore the VM_DONTDUMP flag.

The change that altered the behavior is this one:

commit 38e1562bc360e0b89490b9b6903e1982a2f2f7fe
Author: Jan Kratochvil <jan.kratochvil>
Date:   Fri Nov 27 20:43:41 2015 +0100

    Support for /proc/PID/coredump_filter (Sergio Durigan Junior, RH
BZ 1265351).

    Sergio Durigan Junior, RH BZ 1265351

    7.6.1-83.el7

    - Resolves: rhbz#1265351

I've posted a tentative fix for this upstream:

 - https://sourceware.org/ml/gdb-patches/2017-11/msg00724.html

Comment 10 Michal Kolar 2017-12-12 14:38:23 UTC
Reproduced against gdb-7.6.1-100.el7 and verified against gdb-7.6.1-108.el7.

Comment 17 errata-xmlrpc 2018-04-10 10:25:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0701