Skip to content

Commit

Permalink
[SCTP]: Fix sctp_assoc_seq_show() panics on big-endian systems.
Browse files Browse the repository at this point in the history
This patch corrects the panic by casting the argument to the
pointer of correct size.  On big-endian systems we ended up loading
only 32 bits of data because we are treating the pointer as an int*.
By treating this pointer as loff_t*, we'll load the full 64 bits
and then let regular integer demotion take place which will give us
the correct value.

Signed-off-by: Vlad Yaseivch <vladislav.yasevich@hp.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
  • Loading branch information
Vlad Yasevich authored and Sridhar Samudrala committed Jan 17, 2006
1 parent 49392e5 commit 38b0e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sctp/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
struct sctp_ep_common *epb;
struct sctp_endpoint *ep;
struct sock *sk;
int hash = *(int *)v;
int hash = *(loff_t *)v;

if (hash >= sctp_ep_hashsize)
return -ENOMEM;
Expand Down Expand Up @@ -313,7 +313,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
struct sctp_ep_common *epb;
struct sctp_association *assoc;
struct sock *sk;
int hash = *(int *)v;
int hash = *(loff_t *)v;

if (hash >= sctp_assoc_hashsize)
return -ENOMEM;
Expand Down

0 comments on commit 38b0e42

Please sign in to comment.