Re: Possible alignment issue in kernel's sha256 implementation

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

 



From: Jurij Smakov <jurij@xxxxxxxxx>
Date: Fri, 12 May 2006 19:59:10 -0700 (PDT)

> 60 static inline void LOAD_OP(int I, u32 *W, const u8 *input)
> 61 {
> 62         W[I] = __be32_to_cpu( ((__be32*)(input))[I] );
> 63 }
 ...
> I cannot really determine how dangerous this is. It might be that the 
> cryptographic layer takes care of alignment, or the kernel will just 
> handle the unaligned access gracefully. In any case, I think it's worth 
> checking out by someone with more knowledge on the matter than myself.
> 
> [0] http://bugs.debian.org/366717

We allow kernel unaligned accesses to be fixed up transparently
by a relatively expensive trap handler, but we don't allow it for
user accesses.

Maybe the unaligned case cannot happen in the kernel for some
reason.

Herbert, is there anything which ensures 32-bit alignment
for the data accessed by LOAD_OP()?
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux