From: "David S. Miller" Date: Tue, 08 Feb 2005 04:16:00 +0000 Subject: Re: Hang in SIOCGIFCONF ioctl handler Message-Id: <20050207201600.58123046.davem@davemloft.net> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: sparclinux@vger.kernel.org On Mon, 7 Feb 2005 22:34:44 -0500 (EST) Jurij Smakov wrote: > dev_ifconf[518]: i=0 ifr000001efffacf8 ifr32000000efffd898 > > alloc_size is the amount allocated by compat_alloc_user_space(). The only > "strange" thing I can notice is the ifr address. On a few previous calls > to this function starting ifr (at i=0) looks like that: > > ifr000000efffb3b0 > ifr000000efffacc0 > ifr000000efffb328 > ifr000000efffb2b8 > > and so on. The ifr address right before the hang has an extra bit set. Yep, and notice that the "extra bit" is (1 << 32), or the first bit in the upper 32-bits of the 64-bit kernel pointer. In short, we get garbage from the upper 32-bits of the stack pointer, and need to mask it out for 32-bit tasks. The fix is obvious, try this: === include/asm-sparc64/compat.h 1.17 vs edited ==--- 1.17/include/asm-sparc64/compat.h 2005-02-02 04:05:45 -08:00 +++ edited/include/asm-sparc64/compat.h 2005-02-07 19:51:15 -08:00 @@ -133,6 +133,8 @@ if (!(test_thread_flag(TIF_32BIT))) usp += STACK_BIAS; + else + usp &= 0xffffffffUL; return (void __user *) (usp - len); }