Herbert Xu 0f6bb83cb1 crypto: algif_skcipher - Fixed overflow when sndbuf is page aligned
When sk_sndbuf is not a multiple of PAGE_SIZE, the limit tests
in sendmsg fail as the limit variable becomes negative and we're
using an unsigned comparison.

The same thing can happen if sk_sndbuf is lowered after a sendmsg
call.

This patch fixes this by always taking the signed maximum of limit
and 0 before we perform the comparison.

It also rounds the value of sk_sndbuf down to a multiple of PAGE_SIZE
so that we don't end up allocating a page only to use a small number
of bytes in it because we're bound by sk_sndbuf.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2010-11-30 16:49:02 +08:00
..
2010-02-16 20:24:07 +08:00
2010-02-16 20:26:46 +08:00
2010-05-26 10:36:51 +10:00
2010-10-26 16:52:08 -07:00
2010-11-13 21:47:55 +09:00
2010-02-16 20:29:45 +08:00
2010-02-16 20:31:19 +08:00
2010-05-26 10:36:51 +10:00
2010-11-27 16:30:39 +08:00
2010-02-16 20:33:49 +08:00
2010-11-29 22:56:03 +08:00
2010-11-27 16:32:57 +08:00
2010-03-02 21:58:16 +08:00
2010-03-18 20:22:55 +08:00
2010-05-26 10:36:51 +10:00
2010-11-27 16:30:39 +08:00