[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101022183559.590258671@clark.site>
Date: Fri, 22 Oct 2010 11:35:05 -0700
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...nel.org
Cc: stable-review@...nel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
Kumar Sanghvi <kumar.sanghvi@...ricsson.com>,
Linus Walleij <linus.walleij@...ricsson.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Rémi Denis-Courmont
<remi.denis-courmont@...ia.com>,
"David S. Miller" <davem@...emloft.net>
Subject: [38/66] Phonet: Correct header retrieval after pskb_may_pull
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kumar Sanghvi <kumar.sanghvi@...ricsson.com>
[ Upstream commit a91e7d471e2e384035b9746ea707ccdcd353f5dd ]
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@...ricsson.com>
Acked-by: Linus Walleij <linus.walleij@...ricsson.com>
Acked-by: Eric Dumazet <eric.dumazet@...il.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@...ia.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
net/phonet/pep.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -224,12 +224,13 @@ static void pipe_grant_credits(struct so
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]);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists