Module Name: src Committed By: maxv Date: Sun Mar 17 15:33:50 UTC 2019
Modified Files: src/sys/kern: subr_pool.c Log Message: Kernel Heap Hardening: put the pool header at the beginning of the backing page, not at the end of it. This makes it harder to exploit buffer overflows, because it eliminates the certainty that sensitive kernel data is located after the item space and is therefore overwritable. The pr_itemoffset field is recycled, and holds the (aligned) offset of the item space. The pr_phoffset field becomes unused. We align 'itemspace' for clarity, but it's not strictly necessary. This comes with no performance cost or increase in memory usage, in particular the potential padding consumed by roundup(PHSIZE, align) was already implicitly consumed before, because of the (necessary) truncations in the divisions. Now it's just more explicit, but not bigger. To generate a diff of this commit: cvs rdiff -u -r1.240 -r1.241 src/sys/kern/subr_pool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.