Commit 638be344593b66ccca6802c6076a5b3d9200829d
Committed by
David S. Miller
1 parent
bfd823bd74
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
net/phonet/pep.c
... | ... | @@ -1055,7 +1055,7 @@ |
1055 | 1055 | if (!skb) |
1056 | 1056 | return err; |
1057 | 1057 | |
1058 | - skb_reserve(skb, MAX_PHONET_HEADER + 3); | |
1058 | + skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned); | |
1059 | 1059 | err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); |
1060 | 1060 | if (err < 0) |
1061 | 1061 | goto outfree; |