* [patch] net/llc: make opt unsigned in llc_ui_setsockopt()
@ 2010-09-10 11:56 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-09-10 11:56 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: David S. Miller, Octavian Purdila, Stephen Hemminger,
Eric Dumazet, netdev, kernel-janitors
The members of struct llc_sock are unsigned so if we pass a negative
value for "opt" it can cause a sign bug. Also it can cause an integer
overflow when we multiply "opt * HZ".
CC: stable@kernel.org
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 023ba82..5826129 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -1024,7 +1024,8 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname,
{
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
- int rc = -EINVAL, opt;
+ unsigned int opt;
+ int rc = -EINVAL;
lock_sock(sk);
if (unlikely(level != SOL_LLC || optlen != sizeof(int)))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [patch] net/llc: make opt unsigned in llc_ui_setsockopt()
@ 2010-09-10 11:56 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-09-10 11:56 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: David S. Miller, Octavian Purdila, Stephen Hemminger,
Eric Dumazet, netdev, kernel-janitors
The members of struct llc_sock are unsigned so if we pass a negative
value for "opt" it can cause a sign bug. Also it can cause an integer
overflow when we multiply "opt * HZ".
CC: stable@kernel.org
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 023ba82..5826129 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -1024,7 +1024,8 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname,
{
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
- int rc = -EINVAL, opt;
+ unsigned int opt;
+ int rc = -EINVAL;
lock_sock(sk);
if (unlikely(level != SOL_LLC || optlen != sizeof(int)))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] net/llc: make opt unsigned in llc_ui_setsockopt()
2010-09-10 11:56 ` Dan Carpenter
@ 2010-09-13 19:45 ` David Miller
-1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-09-13 19:45 UTC (permalink / raw)
To: error27; +Cc: acme, opurdila, shemminger, eric.dumazet, netdev, kernel-janitors
From: Dan Carpenter <error27@gmail.com>
Date: Fri, 10 Sep 2010 13:56:16 +0200
> The members of struct llc_sock are unsigned so if we pass a negative
> value for "opt" it can cause a sign bug. Also it can cause an integer
> overflow when we multiply "opt * HZ".
>
> CC: stable@kernel.org
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] net/llc: make opt unsigned in llc_ui_setsockopt()
@ 2010-09-13 19:45 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-09-13 19:45 UTC (permalink / raw)
To: error27; +Cc: acme, opurdila, shemminger, eric.dumazet, netdev, kernel-janitors
From: Dan Carpenter <error27@gmail.com>
Date: Fri, 10 Sep 2010 13:56:16 +0200
> The members of struct llc_sock are unsigned so if we pass a negative
> value for "opt" it can cause a sign bug. Also it can cause an integer
> overflow when we multiply "opt * HZ".
>
> CC: stable@kernel.org
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-13 19:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 11:56 [patch] net/llc: make opt unsigned in llc_ui_setsockopt() Dan Carpenter
2010-09-10 11:56 ` Dan Carpenter
2010-09-13 19:45 ` David Miller
2010-09-13 19:45 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.