diff mbox

linux-next: powerpc boot failure

Message ID 4BBD966D.8020404@iki.fi
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Timo Teras April 8, 2010, 8:40 a.m. UTC
Stephen Rothwell wrote:
> On Thu, 08 Apr 2010 10:29:49 +0300 Timo Teräs <timo.teras@iki.fi> wrote:
>> You don't probably have any xfrm policies then. And that code should not
>> really get executed.
>>
>> Some of the changes touch globally visible structs, and inline functions.
>> Was this a clean rebuild? And did you update all kernel modules, also in
>> the initramfs?
> 
> Yes, the build is started from scratch and the kernel and modules are
> updated (this is our automated build and test system).
> 
> I have attached the config in case that is of use.

It looks like my new code uses xfrm_pols_put assuming it always does the
proper thing. But seems like it's doing funny stuff if CONFIG_XFRM_SUB_POLICY
is not set, which is your case.

Can you try if this helps?

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Luck, Tony April 8, 2010, 6:55 p.m. UTC | #1
I'm seeing an oops in the same routine on ia64 built from next-20100408

My setup is a SLES11 installation.  next-20100407 booted with no problems.
I'm also clueless about xfrm_policy.

Here's an abbreviated copy of the first (of several) oops.  The code
dereferences a bad pointer:

Unable to handle kernel paging request at virtual address 480cb78f00000024
mount.nfs[7289]: Oops 8821862825984 [1]
Modules linked in: nfs lockd auth_rpcgss sunrpc binfmt_misc loop
dm_mod sr_mod usb_storage sg button container usbhid uhci_hcd ehci_hcd
usbcore fan processor thermal thermal_sys

Pid: 7289, CPU 16, comm:            mount.nfs
psr : 0000101008526030 ifs : 8000000000000e22 ip  :
[<a000000100888f10>]    Not tainted
(2.6.34-rc3-generic-smp-next-20100408)
ip is at __xfrm_lookup+0x650/0x760

Call Trace:
 [<a000000100015950>] show_stack+0x50/0xa0
 [<a0000001000161c0>] show_regs+0x820/0x860
 [<a00000010003ac00>] die+0x1a0/0x300
 [<a000000100068b40>] ia64_do_page_fault+0x8c0/0x9e0
 [<a00000010000bb00>] ia64_native_leave_kernel+0x0/0x270
 [<a000000100888f10>] __xfrm_lookup+0x650/0x760
 [<a0000001007ec410>] ip_route_output_flow+0xf0/0x480
 [<a000000100846c30>] ip4_datagram_connect+0x330/0x5e0
 [<a00000010085f420>] inet_dgram_connect+0x140/0x180
 [<a0000001007854f0>] sys_connect+0xf0/0x1a0
 [<a00000010000b980>] ia64_ret_from_syscall+0x0/0x20
 [<a000000000010720>] __kernel_syscall_via_break+0x0/0x20

I tried the patch you just posted.  Compiling with it gave this warning:

net/xfrm/xfrm_policy.c: In function ‘__xfrm_lookup’:
net/xfrm/xfrm_policy.c:1735: warning: ‘num_xfrms’ may be used
uninitialized in this function

but the patched kernel booted ok.

-Tony
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller April 8, 2010, 8:13 p.m. UTC | #2
From: Tony Luck <tony.luck@intel.com>

Date: Thu, 8 Apr 2010 11:55:34 -0700

> I tried the patch you just posted.  Compiling with it gave this warning:

> 

> net/xfrm/xfrm_policy.c: In function ‘__xfrm_lookup’:

> net/xfrm/xfrm_policy.c:1735: warning: ‘num_xfrms’ may be used

> uninitialized in this function


This is just because gcc is stupid, you can ignore this.

It can't see that when a real 'err' error is returned we never end up
referencing the num_xfrms value.

> but the patched kernel booted ok.


Thanks for testing, I pushed Timo's fix to net-next-2.6 earlier today
so it'll hopefully show up in the next linux-next.
Stephen Rothwell April 9, 2010, 12:08 a.m. UTC | #3
Hi Timo,

On Thu, 08 Apr 2010 11:40:13 +0300 Timo Teräs <timo.teras@iki.fi> wrote:
>
> Can you try if this helps?

That patch allows my machine to boot.

Thanks.
diff mbox

Patch

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 625dd61..cccb049 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -735,19 +735,12 @@  static inline void xfrm_pol_put(struct xfrm_policy *policy
                xfrm_policy_destroy(policy);
 }
 
-#ifdef CONFIG_XFRM_SUB_POLICY
 static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols)
 {
        int i;
        for (i = npols - 1; i >= 0; --i)
                xfrm_pol_put(pols[i]);
 }
-#else
-static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols)
-{
-       xfrm_pol_put(pols[0]);
-}
-#endif
 
 extern void __xfrm_state_destroy(struct xfrm_state *);