On Thu, Dec 07, 2017 at 11:43:09AM +0100, Martin Pieuchot wrote: > On 05/12/17(Tue) 14:52, Visa Hankala wrote: > > On Tue, Dec 05, 2017 at 11:32:53AM +0100, Martin Pieuchot wrote: > > > On 04/12/17(Mon) 12:24, Martin Pieuchot wrote: > > > > Since SMAP is enabled ddb(4)'s 'trace /u' and 'trace /p' for a userland > > > > processes result, as expected, in page faults. > > > > > > > > Diff below disable SMAP for the duration of the command. This allows us > > > > to see any possible frame corruption. > > > > > > Updated version that: > > > > > > - Removes the goto by shuffling parameter tests > > > - Initializes cr4save to limit the effect of this gadget. > > > - Skip lcr4() completely if the CPU doesn't support SMAP. > > > > On i386, it might be necessary to make the rcr4() conditional to a CPU > > feature flag because olden x86 processors do not have the CR4 register. > > Condition curcpu()->ci_feature_sefflags_ebx & SEFF0EBX_SMAP might be > > good enough in this case.
> Good point, I'd like to commit the diff below then. OK visa@
