Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Insufficient locking in via_padlock_cbc?



Le 14/10/2017 à 02:38, coypu%sdf.org@localhost a écrit :
Hi,

via_padlock_cbc does this:

     337 	creg0 = rcr0();		/* Permit access to SIMD/FPU path */
     338 	lcr0(creg0 & ~(CR0_EM|CR0_TS));
     339
     340 	/* Do the deed */
     341 	__asm __volatile("pushfl; popfl");	/* force key reload */
     342 	__asm __volatile(".byte 0xf3, 0x0f, 0xa7, 0xd0" : /* rep xcrypt-cbc */
     343 			: "a" (iv), "b" (key), "c" (rep), "d" (cw), "S" (src), "D" (dst)
     344 			: "memory", "cc");
     345
     346 	lcr0(creg0);


I don't see an indication it's disabling hw interrupts during, doesn't
this mean that it can be interrupted/migrated in the middle?

Le 17/10/2017 à 09:12, Maxime Villard a écrit :
I don't see an indication it's disabling hw interrupts during, doesn't
this mean that it can be interrupted/migrated in the middle?

yes, that's bad

Well well well, it looks like this never got fixed, so I will fix it in a
few days unless there is some disagreement. By adding an splhigh around the
code, I guess; without testing, too, since I don't have a VIA CPU.


Home | Main Index | Thread Index | Old Index