[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-port-amd64
Subject:    Re: Insufficient locking in via_padlock_cbc?
From:       Maxime Villard <max () m00nbsd ! net>
Date:       2018-07-07 12:00:50
Message-ID: 7df7433a-7af8-151c-549e-0b37e3c08de2 () m00nbsd ! net
[Download RAW message or body]

Le 14/10/2017 à 02:38, coypu@sdf.org 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.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic