Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

heartbleed and CONFIG_PAX_MEMORY_SANITIZE

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

heartbleed and CONFIG_PAX_MEMORY_SANITIZE

  • Quote

Post by Apheus » Fri Apr 11, 2014 1:21 pm

With all the media coverage of the heartbleed bug (which is memory reuse issue), I wonder if the pax kernel option "sanitize all freed memory" (CONFIG_PAX_MEMORY_SANITIZE) server-side would have prevented the data leak, because the additional data would simply consist of zero bits. However, openssl uses an own memory manager, so from the kernel's perspective, the memory in question could still be used... while openssl happily reuses it for the heartbeat response.

I do not own a server, I'm simply curious.
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Fri Apr 11, 2014 2:40 pm

It would depend on the bug. Sometimes the bug will point back to valid address space of the calling process and it couldn't tell if it was a legal or illegal access. Don't know. I haven't seen the exact problematic code yet to see exactly what can be exploited, but it sounds like the private key is the target data (versus passwords - but with the private key, passwords come easily). Being that the private key is not that many bytes and if the hole points back to valid memory space, it's not hard to extract it.

Don't know... I'm not a security expert...
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
TomWij
Retired Dev
Retired Dev
User avatar
Posts: 1553
Joined: Wed Jul 04, 2012 6:52 pm

Re: heartbleed and CONFIG_PAX_MEMORY_SANITIZE

  • Quote

Post by TomWij » Fri Apr 11, 2014 3:01 pm

Apheus wrote:With all the media coverage of the heartbleed bug (which is memory reuse issue), I wonder if the pax kernel option "sanitize all freed memory" (CONFIG_PAX_MEMORY_SANITIZE) server-side would have prevented the data leak, because the additional data would simply consist of zero bits. However, openssl uses an own memory manager, so from the kernel's perspective, the memory in question could still be used... while openssl happily reuses it for the heartbeat response.
No, it would at best have reduced the data leak but not prevented it, for two reasons: The first (as sk3l point outs below) reason is that in the memory of the process that is read there also would be memory that is still in use; the second (less known about, but much more important) reason is that OpenSSL uses its own handmade memory allocator as a wrapper around malloc and free. That handmade memory allocator keeps a cache around before it becomes sanitized, which allows the freed memory to be read for a longer time. As a result of this wrapper OpenSSL doesn't crash when it should when exploiting Heartbleed, as the wrapper allows the freed memory that it has cached to be read; when it would've crashed, an earlier security audit or attack would have made this bug non exploitable as well as clearly visible months ago. For more insight on this second reason, see the links pointed to from this post.

(Edit: Added various details and readability improvements)
Last edited by TomWij on Fri Apr 11, 2014 3:15 pm, edited 9 times in total.
Top
sk3l
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 78
Joined: Sat Jul 14, 2012 11:57 am
Location: CT USA
Contact:
Contact sk3l
Website

  • Quote

Post by sk3l » Fri Apr 11, 2014 3:02 pm

I don't believe that would have saved us in this instance. Like eccerr0r said, the overflow could end up overlapping live address space. Not only were private keys vulnerable, but user authen information, and possibly worst of all session cookie IDs. If the attacker got hold of a session cookie ID, they could spoof a saved session and impersonate you without needing to actually log in.

Here is a nice discussion of the bug details and risk level.

The thing very few folks are talking about is, yes, the code was poorly written, but the protocol semantics are not well thought out. What possible good can come from a keep alive mechanism that allows the client to set what data is used to pass back & forth. The heartbeat payload should be arbitrary, static & small, which IIRC is how it's implemented in TCP/IP
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Sat Apr 12, 2014 5:34 pm

Thanks all, also for the links. Interesting read.
Top
Post Reply

5 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic