aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2011-03-15 17:55:49 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-15 17:55:49 -0400
commit638be344593b66ccca6802c6076a5b3d9200829d (patch)
tree41a285f44792037362bc4efaf938b73999b76bd1
parentbfd823bd74333615783d8108889814c6d82f2ab0 (diff)
Phonet: fix aligned-mode pipe socket buffer header reserve
When the pipe uses aligned-mode data packets, we must reserve 4 bytes instead of 3 for the pipe protocol header. Otherwise the Phonet header would not be aligned, resulting in potentially corrupted headers with later unaligned memory writes. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/phonet/pep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 68e635f11de8..f17fd841f948 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -1055,7 +1055,7 @@ static int pep_sendmsg(struct kiocb *iocb, struct sock *sk,
1055 if (!skb) 1055 if (!skb)
1056 return err; 1056 return err;
1057 1057
1058 skb_reserve(skb, MAX_PHONET_HEADER + 3); 1058 skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned);
1059 err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); 1059 err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
1060 if (err < 0) 1060 if (err < 0)
1061 goto outfree; 1061 goto outfree;