Re: [PATCH] crypto: blkcipher_get_spot() handling of buffer at end of page

2007-09-11 Thread Herbert Xu
On Mon, Sep 10, 2007 at 09:46:46PM +0200, Ingo Oeser wrote: > > What about using max() for this to make your intention obvious? > > static inline u8 *blkcipher_get_spot(u8 *start, unsigned int len) > { > u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK); > return m

Re: [PATCH] crypto: blkcipher_get_spot() handling of buffer at end of page

2007-09-10 Thread Ingo Oeser
Hi Herbert, On Monday 10 September 2007, Herbert Xu wrote: > On Sat, Sep 08, 2007 at 12:14:23PM +0800, Herbert Xu wrote: > > > > [CRYPTO] blkcipher: Fix handling of kmalloc page straddling > > As Bob correctly noted, I had the boolean test inverted. > Here is the correction: > > [CRYPTO] blkcip

Re: [PATCH] crypto: blkcipher_get_spot() handling of buffer at end of page

2007-09-10 Thread Herbert Xu
On Sat, Sep 08, 2007 at 12:14:23PM +0800, Herbert Xu wrote: > > [CRYPTO] blkcipher: Fix handling of kmalloc page straddling As Bob correctly noted, I had the boolean test inverted. Here is the correction: [CRYPTO] blkcipher: Fix inverted test in blkcipher_get_spot The previous patch had the con

Re: [PATCH] crypto: blkcipher_get_spot() handling of buffer at end of page

2007-09-07 Thread Herbert Xu
On Fri, Sep 07, 2007 at 05:09:17PM -0700, Bob Gilligan wrote: > > Proposed patch is below. We found the problem and tested this fix in > 2.6.20, but it looks like the relevant code in blkcipher.c is the same > in the latest tree. Good catch! I've fixed this slightly differently. Also, the kmall

[PATCH] crypto: blkcipher_get_spot() handling of buffer at end of page

2007-09-07 Thread Bob Gilligan
Hi -- There appears to be a bug in the function blkcipher_get_spot(), which resides in crypto/blkcipher.c. This small function reads: static inline u8 *blkcipher_get_spot(u8 *start, unsigned int len) { if (offset_in_page(start + len) < len) return (u8 *)((unsigned long)(st