Herbert Xu wrote: > On Mon, May 22, 2006 at 03:38:36PM +1200, Michal Ludvig wrote: >> +static void padlock_sha_init(struct crypto_tfm *tfm) >> +{ >> + CTX(tfm)->used = 0; >> + CTX(tfm)->bypass = 0; >> + CTX(tfm)->data = (char*)__get_free_page(GFP_KERNEL); >> + if (!CTX(tfm)->data) >> + padlock_sha_bypass(tfm); >> + return; >> +} > > Sorry, you can't do it here. The init/update functions must work within > atomic contexts. So please move the fallback/page allocation to the > cra_init function which I'm about to introduce.
Lots of troubles with the fallback thing, isn't it? Is it possible to implement in the kernel the approach with arbitrary page faults that I did in phe_sum (http://www.logix.cz/michal/devel/padlock/phe_sum.xp)? Briefly: we need two consecutive pages, where the 2nd one is not accessible (like mprotect(PROT_NONE) in userspace). Fill up the first page with data and run PadLock-SHA on it. As soon as it hits the barrier it pagefaults with intermediate digest results saved in memory which can be reused for subsequent sha_update()s. Can we safely handle these pagefaults in the atomic context? Or is it a nonsense? Michal - To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html