netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jwestfall@surrealistic.net
Cc: netdev@vger.kernel.org, acme@ghostprotocols.net
Subject: Re: kernel BUG at net/core/skbuff.c:95!
Date: Wed, 20 Feb 2008 21:57:07 -0800 (PST)	[thread overview]
Message-ID: <20080220.215707.194209573.davem@davemloft.net> (raw)
In-Reply-To: <20080221054648.GU84358@surrealistic.net>

From: Jim Westfall <jwestfall@surrealistic.net>
Date: Wed, 20 Feb 2008 21:46:48 -0800

> static inline void llc_pdu_init_as_test_rsp(struct sk_buff *skb,
>                                             struct sk_buff *ev_skb)
> {
>         struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
>          
>         pdu->ctrl_1  = LLC_PDU_TYPE_U;
>         pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST;
>         pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
>         if (ev_skb->protocol == htons(ETH_P_802_2)) {
>                 struct llc_pdu_un *ev_pdu = llc_pdu_un_hdr(ev_skb);
>                 int dsize;
> 
>                 dsize = ntohs(eth_hdr(ev_skb)->h_proto) - 3;
>                 memcpy(((u8 *)pdu) + 3, ((u8 *)ev_pdu) + 3, dsize);
>                 skb_put(skb, dsize);
>         }
> ..
> }

Probably what should happen is:

1) First this function validates that there are really
   'dsize' bytes available in the ev_skb source.

2) Second, skb_realloc_headroom() is called on 'skb' with
   a second argument of 'dsize'.

That means also this function now needs to return error
values, and the callers updated to handle that.

  reply	other threads:[~2008-02-21  5:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20  0:20 kernel BUG at net/core/skbuff.c:95! Jim Westfall
2008-02-21  5:46 ` Jim Westfall
2008-02-21  5:57   ` David Miller [this message]
2008-02-21 19:13     ` Jim Westfall
2008-02-24  4:01       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080220.215707.194209573.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=acme@ghostprotocols.net \
    --cc=jwestfall@surrealistic.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).