* [66/82] Phonet: Correct header retrieval after pskb_may_pull
@ 2010-11-19 21:56 Greg KH
0 siblings, 0 replies; only message in thread
From: Greg KH @ 2010-11-19 21:56 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Kumar Sanghvi, Linus Walleij,
Eric Dumazet, Rémi Denis-Courmont, David S. Miller
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]
2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kumar Sanghvi <kumar.sanghvi@stericsson.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@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>
---
net/phonet/pep.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -225,12 +225,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]);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-19 22:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-19 21:56 [66/82] Phonet: Correct header retrieval after pskb_may_pull Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox