[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 16 May 2008 16:49:18 +0800
From: Gui Jianfeng <guijianfeng@...fujitsu.com>
To: vladislav <vladislav.yasevich@...com>, linux-sctp@...r.kernel.org
CC: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: [PATCH] [SCTP] Fix a type cast bug
Vlad,
event_arg can never be the type of "struct sctp_chunk *"
if the event_type is SCTP_EVENT_T_OTHER. This fix
prevents from potential kernel crash by some misuse.
Signed-off-by: Gui Jianfeng <guijianfeng@...fujitsu.com>
---
net/sctp/sm_sideeffect.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index a4763fd..1b4bae9 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1072,7 +1072,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
struct sctp_sackhdr sackh;
int local_cork = 0;
- if (SCTP_EVENT_T_TIMEOUT != event_type)
+ if (SCTP_EVENT_T_TIMEOUT != event_type &&
+ SCTP_EVENT_T_OTHER != event_type)
chunk = (struct sctp_chunk *) event_arg;
/* Note: This whole file is a huge candidate for rework.
--
1.5.3
--
Regards
Gui Jianfeng
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists