Commit 19c7e9ee authored by Vladislav Yasevich's avatar Vladislav Yasevich Committed by David S. Miller

[SCTP]: Fix ia64 NaT consumption fault with sctp_sideffect commands.

On ia64, it is possible to get NaT Consumption Fault and a kernel panic
when initializing sctp sideeffect commands arguments.  The union
sctp_arg_t contains different sized elements and when loading a smaller
sized element (32 or 16 bits), it is possible for a speculative load to
fail and result in a NaT bit set which causes a kernel crash.  The easy
way to get around it is to load the largerst member of the union.
Signed-off-by: default avatarVladislav Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: default avatarSridhar Samudrala <sri@us.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e7d3d90
...@@ -120,6 +120,7 @@ typedef union { ...@@ -120,6 +120,7 @@ typedef union {
int error; int error;
sctp_state_t state; sctp_state_t state;
sctp_event_timeout_t to; sctp_event_timeout_t to;
unsigned long zero;
void *ptr; void *ptr;
struct sctp_chunk *chunk; struct sctp_chunk *chunk;
struct sctp_association *asoc; struct sctp_association *asoc;
...@@ -148,17 +149,17 @@ static inline sctp_arg_t SCTP_NULL(void) ...@@ -148,17 +149,17 @@ static inline sctp_arg_t SCTP_NULL(void)
} }
static inline sctp_arg_t SCTP_NOFORCE(void) static inline sctp_arg_t SCTP_NOFORCE(void)
{ {
sctp_arg_t retval; retval.i32 = 0; return retval; sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval;
} }
static inline sctp_arg_t SCTP_FORCE(void) static inline sctp_arg_t SCTP_FORCE(void)
{ {
sctp_arg_t retval; retval.i32 = 1; return retval; sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval;
} }
#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ #define SCTP_ARG_CONSTRUCTOR(name, type, elt) \
static inline sctp_arg_t \ static inline sctp_arg_t \
SCTP_## name (type arg) \ SCTP_## name (type arg) \
{ sctp_arg_t retval; retval.elt = arg; return retval; } { sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; }
SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) SCTP_ARG_CONSTRUCTOR(I32, __s32, i32)
SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) SCTP_ARG_CONSTRUCTOR(U32, __u32, u32)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment