From: Arjan van de Ven Date: Wed, 30 Sep 2009 11:51:11 +0000 (+0200) Subject: net ax25: Fix signed comparison in the sockopt handler X-Git-Tag: v2.6.27.36~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc7fec29e1f24be79190e25aef1583c92111b052;p=pandora-kernel.git net ax25: Fix signed comparison in the sockopt handler fixed upstream in commit b7058842c940ad2c08dd829b21e5c92ebe3b8758 in a different way The ax25 code tried to use if (optlen < sizeof(int)) return -EINVAL; as a security check against optlen being negative (or zero) in the set socket option. Unfortunately, "sizeof(int)" is an unsigned property, with the result that the whole comparison is done in unsigned, letting negative values slip through. This patch changes this to if (optlen < (int)sizeof(int)) return -EINVAL; so that the comparison is done as signed, and negative values get properly caught. Signed-off-by: Arjan van de Ven Cc: David S. Miller Cc: Ingo Molnar Cc: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed