anthraxx / linux-hardened

Minimal supplement to upstream Kernel Self Protection Project changes. Features already provided by SELinux + Yama and archs other than multiarch arm64 / x86_64 aren't in scope. Only tags have stable history. Shared IRC channel with KSPP: irc.libera.chat #linux-hardening
Other
567 stars 56 forks source link

5.3.11-12 update taking some small effort. #17

Closed patchMonkey156 closed 4 years ago

patchMonkey156 commented 4 years ago

If Im terrible at this, I apologize, but I saw an opportunity to learn. Here's the single issue to be fixed in Branch 5.3: mm/slub.c:1470 - static inline bool slab_free_freelist_hook

This function is reworked upstream. Where the contents had been separates into two loops, and the latter only being defined when kasan, memleak protection, etc is enabled in the config? The contents of these two loops has been condensed into a single loop.

Upstream has kept the contents faithfully intact, and I believe we should as well. I kept the "set_canary" line unique to our fork at its place at the end of the first old-loop, but not entirely at the end of the new-loop. I dont quite understand the intricacies of this part, which gives me some pause. If there is cause for discussion, I believe this would prove a sufficient medium for it.

This is the only holdup to a smooth upgrade to 5.3.12.

Bernhard40 commented 4 years ago

@patchMonkey156 update to 5.3.12 was done independently: https://github.com/anthraxx/linux-hardened/releases/tag/5.3.12.a

anthraxx commented 4 years ago

@patchMonkey156 its very hard to follow the patch changes you mentioned, as you have a single commit that squashes in the patch change and the whole v5.3.12 changes. Next time it would be easier to rebase against v5.3.x and change the patch afterwards, or just have a patch ontop (after rebase) that alters the patch in question and will be squashed into the original patch when applying. The changes you mentioned made it into https://github.com/anthraxx/linux-hardened/commit/c81e042a89e40985af90a196903f45bed2619385 but were already locally existing for a bit of time for testing purposes. Thanks for contribution either way and next time, with the tips from above, it will be easier to grasp what changes you propose :)

patchMonkey156 commented 4 years ago

Thanks for the feedback!

I look forward to learning more, maybe even contributing one day.