Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brk randomization improvements #282

Open
thestinger opened this issue Apr 22, 2023 · 0 comments
Open

brk randomization improvements #282

thestinger opened this issue Apr 22, 2023 · 0 comments

Comments

@thestinger
Copy link

Some malloc implementations still use brk. It would be nice if it did better randomization including taking advantage of the page that it can randomize the lower bits. linux-hardened has a patch set resulting in the same end result as the last available PaX patches but with simpler changes to the existing implementation.

Initial patch to raise entropy on x86_64 to the generic approach used on arm64 and elsewhere:

https://github.com/anthraxx/linux-hardened/commit/73d16f72057d3b1a36a44c39a0e991f733fb074f.patch

Lower bit randomization:

https://github.com/anthraxx/linux-hardened/commit/5bc143f5a39209dbe458d6900ab244df0e50a54b.patch
https://github.com/anthraxx/linux-hardened/commit/f17469b9cf5e9605ef8827e7c6e53c87838b3f75.patch
https://github.com/anthraxx/linux-hardened/commit/df74ddca771370e7f7b656f4a540e026d52c60f2.patch

Adding an extra 1 page to make sure the gap is always at least 1 page without reducing entropy:

https://github.com/anthraxx/linux-hardened/commit/ee9a6cf36f6a836315a4f7fd800bab5ba9c5f69b.patch
https://github.com/anthraxx/linux-hardened/commit/9a6427b469a8d903ccdd465f23ecca4e4b8cc7b0.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant