mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
Phonet: Correct header retrieval after pskb_may_pull
[ Upstream commit a91e7d471e ]
Retrieve the header after doing pskb_may_pull since, pskb_may_pull
could change the buffer structure.
This is based on the comment given by Eric Dumazet on Phonet
Pipe controller patch for a similar problem.
Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
a39fcb1368
commit
81f9ffe490
|
|
@ -224,12 +224,13 @@ static void pipe_grant_credits(struct sock *sk)
|
|||
static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
struct pep_sock *pn = pep_sk(sk);
|
||||
struct pnpipehdr *hdr = pnp_hdr(skb);
|
||||
struct pnpipehdr *hdr;
|
||||
int wake = 0;
|
||||
|
||||
if (!pskb_may_pull(skb, sizeof(*hdr) + 4))
|
||||
return -EINVAL;
|
||||
|
||||
hdr = pnp_hdr(skb);
|
||||
if (hdr->data[0] != PN_PEP_TYPE_COMMON) {
|
||||
LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n",
|
||||
(unsigned)hdr->data[0]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user