Re: Problem with dev_kfree_skb_any() in 2.6.0

From: David S. Miller (davem_at_redhat.com)
Date: 12/30/03

  • Next message: Gene Heskett: "Re: [PATCH] drivers/cdrom/sjcd.c check_region() fix"
    Date:	Mon, 29 Dec 2003 22:01:22 -0800
    To: Jeff Garzik <jgarzik@pobox.com>
    
    

    On Tue, 30 Dec 2003 00:15:19 -0500
    Jeff Garzik <jgarzik@pobox.com> wrote:

    > OK, agreed. But fixing it in the driver is still incorrect, also.
    >
    > We need a single solution in the net stack, not a per-driver solution.

    I totally disagree.

    Let's quickly review, this is illegal:

            local_irq_disable();
            {
                    local_bh_disable();
                    ... do kfree_skb work ...
                    local_bh_enable();
            }
            local_irq_enable();

    as is this:

            local_irq_disable();
            {
                    ... queue to softirq TX work ...
            }
            local_irq_enable();
            ... oops this won't make softirq TX work get run ...

    The driver must therefore recognize that it may only free packets
    in it's IRQ handler or in situations where BH protection has occurred
    at a higher level or BH protection is the only protection it uses
    from base context.

    This is similar to how the driver must be aware that
    netif_receive_skb() can cause it's ->hard_start_xmit() method to run
    and therefore it must prevent deadlocks that might occur as a result
    of locks held during the netif_receive_skb() call.

    So let's fix the drivers. :)
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Gene Heskett: "Re: [PATCH] drivers/cdrom/sjcd.c check_region() fix"

    Relevant Pages

    • Re: OT: And so it begins...
      ... a protection scheme owned by ... driver. ... Player needed to be upgraded to play the CD. ... mandatory requirement to use godawful highschool-reject programmers to ...
      (comp.sys.ibm.pc.games.action)
    • Re: On my head be it if I dont wear a helmet
      ... So that they are better made and offer better protection to cyclists ... unreasonable speed for a fit cyclist), 30mph crashes (easily ... I can remember the days when if a driver gave you a lift and fastened his own seat-belt, it made you suspect that he was a nervous driver, lacking in confidence in his own skills and experience- because you perceived him as actively preparing to have a collision. ...
      (uk.rec.cycling)
    • Re: Kernel support for peer-to-peer protection models...
      ... Kernel support for peer-to-peer protection models... ... > Just FYI - Linux has been ported to several architectures with similar ... the owner of the page will have exposed the page to the driver before or as ...
      (Linux-Kernel)
    • [NT] Bypassing Pedestal Software Integrity Protection Driver (Time Vulnerability)
      ... This driver was created to provide protection against Rootkit ... To give administrator ability to uninstall IPD, ... which fixes this vulnerability. ...
      (Securiteam)
    • Re: Codevirtualizer - a new protection system?
      ... another problem with driver solution: ... I try latest Themida and WinLicense under Vista and don't work at all, ... When I read this article about Vista: ... Author said that to protect his protection engine, ...
      (borland.public.delphi.thirdpartytools.general)