lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <274124B9C6907D4B8CE985903EAA19E91B2C998E04@SI-MBX06.de.bosch.com>
Date:	Wed, 14 Mar 2012 15:31:36 +0100
From:	"EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31)" 
	<external.Peter.Waechtler@...bosch.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"pwaechtler@....com" <pwaechtler@....com>
Subject: [RFD] how to get something like chkspace / kinfo_getvmmap?

Hi,

for implementing robust exception handlers that print out a backtrace in
the signal handler, it would be nice to have a syscall to check if a
memory access would fail.

I know that one can parse /proc/self/maps (like libsigsegv does).
libunwind employs an addrspace->access_mem() method that does an
unprotected access because there is no (easy) way on Linux.


How about enhancing mincore() with a few bits that tells the caller how
the protection bits are?
The main use case is in an embedded system to avoid that the handler
(already running on an alternate signal stack) faults if the stack pointer
achieved to point into the guard page - causing backtrace() to fail.

mincore() on FreeBSD provides some more bits, but still the access bits
are missing.

     MINCORE_INCORE            Page is in core (resident).
     MINCORE_REFERENCED        Page has been referenced by us.
     MINCORE_MODIFIED          Page has been modified by us.
     MINCORE_REFERENCED_OTHER  Page has been referenced.
     MINCORE_MODIFIED_OTHER    Page has been modified.
     MINCORE_SUPER             Page is part of a "super" page. (only i386 &
                               amd64)

add

        MINCORE_PROT_W
        MINCORE_PROT_R
        MINCORE_PROT_X

So essentially I'm looking for a way for mgetprotect(2) or
mprotect(addr, len, PROT_GET, &prot_bits)?

But this is really ugly ;)


input welcome
        Peter Wächtler

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ