Re: 2.1.111: Could not allocate TCP control block

Andrew McGregor (andrew@indranet.co.nz)
Wed, 29 Jul 1998 04:47:49 +0000


Andi Kleen wrote:

> Andrew McGregor <andrew@indranet.co.nz> writes:
>
> > (Please CC: me, as I read the digest form of the list and replying can be messy.)
> >
> >
> > I just compiled 2.1.111 (UP) and got this message when I tried to boot it:
> >
> > kernel panic: Could not allocate TCP control block
> >
> > upon which it hung, saying "in swapper task, not syncing.".
>
> My 2.1.111 kernel source does not contain this message. Did you really get
> this exact message, or do you use any non-standard modules?
>
> -Andi
>
>

I didn't get that exact message, I relied on memory and got it wrong.
Here's the code which created it, from tcp_ipv4.c, the panic is line 1777:

tcp_socket->inode = &tcp_inode;
tcp_socket->state = SS_UNCONNECTED;
tcp_socket->type=SOCK_RAW;

if ((err=ops->create(tcp_socket, IPPROTO_TCP))<0)
panic("Failed to create the TCP control socket, err=%d.\n", err)
;

The err= etc. is mine, to help debug a bit further.
When I boot this it gives

Failed to create the TCP control socket, err=-1.

which is EPERM.

As far as I can see, this comes from af_inet.c:inet_create lines 376-378:

case SOCK_RAW:
if (!capable(CAP_NET_RAW))
goto free_and_badperm;

which results in inet_create returning -EPERM, which is silly during bootup!

I don't really know where to look now...
where are the capabilities of the kernel itself set during boot?
can I just do a
cap_raise(current->cap_effective,CAP_NET_RAW);
before trying to create it, or is the problem I'm having due to something else?

If I try doing that, the machine gets to

PCI: Sorting device list...

or some such (I don't get long enough to see it!)
and then reboots.

Wierd... at least it gets further than the last 2.1 I tried, 2.1.105, which crashed
in the bootloader stage (ie Uncompressing kernel... bang.).

Andrew McGregor

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html