code changes for sock_alloc_send_skb() to avoid panics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
     I came across a bug with a panic because of a 'blocking' call to
sock_alloc_send_skb( ) called from ndisc code [2.4].
I had a look at the patch from:
        http://www.linux-ipv6.org/ml/usagi-users/msg02309.html

where all these calls are changed from 'blocking' to 'non-blocking'.

I was just curious to know if instead of doing this, could we have a
check in sock_alloc_send_skb( ) by a call to in_interrupt( ) and send an

error message if we are in interrupt or bottom half context?   Because,
this is a generic function and would prevent the panics if any of the
upper layers is trying to block in interrupt or bhp context.  [and thus
preventing code changes from blocking to non-blocking at all relevant
locations of code]

The code change could be in net/core/sock.c:
                        err = -EAGAIN;
                         if (!timeo ||  in_interrupt( ))     <<<<<<<
                             goto failure;
                         if (signal_pending(current)
                               goto interrupted;

Please correct me if i am wrong.
Prashanth

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux