From: Alexander Popov References: <1515766769-9120-1-git-send-email-alex.popov@linux.com> <0c1950e9-626d-c7b8-5551-fcc233501025@linux.com> <9e6d74cf-ac51-463e-feae-b2df0e5fb85e@linux.com> Message-ID: Date: Thu, 25 Jan 2018 18:13:55 +0300 MIME-Version: 1.0 In-Reply-To: <9e6d74cf-ac51-463e-feae-b2df0e5fb85e@linux.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [kernel-hardening] Re: [PATCH RFC v7 0/6] Introduce the STACKLEAK feature and a test for it To: Kees Cook Cc: kernel-hardening@lists.openwall.com, PaX Team , Brad Spengler , Ingo Molnar , Andy Lutomirski , Tycho Andersen , Laura Abbott , Mark Rutland , Ard Biesheuvel , Borislav Petkov , Thomas Gleixner , "H . Peter Anvin" , Peter Zijlstra , "Dmitry V . Levin" , X86 ML List-ID: On 20.01.2018 13:13, Alexander Popov wrote: > On 19.01.2018 00:13, Kees Cook wrote: >> On Thu, Jan 18, 2018 at 5:09 AM, Alexander Popov wrote: >>> So I don't think that (1) without (2) is actually a good feature. I would >>> propose to refrain from separating the stack erasing and the lowest_stack tracking. >> >> How about an option to clear the _entire_ stack, then, when the plugin >> isn't available? That gives us a range of options and provides an easy >> way to compare the performance of the tracking. i.e. can compare off, >> full, and smart. > > Yes, I should try it. I'll return with the results of the performance tests. > We'll discuss them; if full stack erasing is not too slow, I'll introduce it in > the 8'th version of the patch series. I've made a brief performance test on x86_64 (similar to the test described in the cover letter). I guess there might be workloads with higher performance penalty. Hardware: Intel Core i7-4770, 16 GB RAM Test: hackbench -s 4096 -l 2000 -g 15 -f 25 -P Average time on v4.14.15: 9.194s Average time on v4.14.15-stackleak-with-plugin: 9.490 (+3.22%) Average time on v4.14.15-stackleak-full-erasing: 12.149 (+32.14%) Honestly, I think, it is not worth having this full stack erasing as a separate feature. Moreover, it brings some #ifdef conditionals to the erase_kstack() code, which don't look nice. May I ask for your opinion? Best regards, Alexander