mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-24 11:25:43 +00:00
[PATCH] Fix signedness problem at socket creation
CAN-2005-0750 is assigned to this issue ilja <ilja@suresec.org> discovered potential local root exploit in bluetooth socket creation. This patch fixes a small signedness problem when creating the socket. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Chris Wright <chrisw@osdl.org>
This commit is contained in:
parent
cc981951db
commit
ff8b1b95f7
1 changed files with 3 additions and 3 deletions
|
@ -64,7 +64,7 @@ static kmem_cache_t *bt_sock_cache;
|
|||
|
||||
int bt_sock_register(int proto, struct net_proto_family *ops)
|
||||
{
|
||||
if (proto >= BT_MAX_PROTO)
|
||||
if (proto < 0 || proto >= BT_MAX_PROTO)
|
||||
return -EINVAL;
|
||||
|
||||
if (bt_proto[proto])
|
||||
|
@ -77,7 +77,7 @@ EXPORT_SYMBOL(bt_sock_register);
|
|||
|
||||
int bt_sock_unregister(int proto)
|
||||
{
|
||||
if (proto >= BT_MAX_PROTO)
|
||||
if (proto < 0 || proto >= BT_MAX_PROTO)
|
||||
return -EINVAL;
|
||||
|
||||
if (!bt_proto[proto])
|
||||
|
@ -92,7 +92,7 @@ static int bt_sock_create(struct socket *sock, int proto)
|
|||
{
|
||||
int err = 0;
|
||||
|
||||
if (proto >= BT_MAX_PROTO)
|
||||
if (proto < 0 || proto >= BT_MAX_PROTO)
|
||||
return -EINVAL;
|
||||
|
||||
#if defined(CONFIG_KMOD)
|
||||
|
|
Loading…
Reference in a new issue