lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0705032338450.1479@scrub.home>
Date:	Thu, 3 May 2007 23:45:32 +0200 (CEST)
From:	Roman Zippel <zippel@...ux-m68k.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...e.de>
Subject: Re: [PATCH 2/2] rename thread_info to stack

Hi,

On Thu, 3 May 2007, Andrew Morton wrote:

> > This finally renames the thread_info field in task structure to stack,
> > so that the assumptions about this field are gone and archs have more
> > freedom about placing the thread_info structure.
> 
> It needed this build fix:
> 
> --- a/include/asm-x86_64/system.h~rename-thread_info-to-stack-fix
> +++ a/include/asm-x86_64/system.h
> @@ -39,7 +39,7 @@
>  		       [threadrsp] "i" (offsetof(struct task_struct, thread.rsp)), \
>  		       [ti_flags] "i" (offsetof(struct thread_info, flags)),\
>  		       [tif_fork] "i" (TIF_FORK),			  \
> -		       [thread_info] "i" (offsetof(struct task_struct, thread_info)), \
> +		       [thread_info] "i" (offsetof(struct task_struct, stack)), \
>  		       [pda_pcurrent] "i" (offsetof(struct x8664_pda, pcurrent))   \
>  		     : "memory", "cc" __EXTRA_CLOBBER)
>      
> _
> 
> 
> It is unpleasing that this code is forced to implicitly assume that the
> thing pointed to by task_struct.stack has type `struct thread_info'.
> 
> Are we sure this patch is a good thing?

Assembler code is difficult to wrap, there are more places where assembler 
code assumes that the thread_info is at the start of the stack.
Anyway, in this case it looks a little weird that TIF_FORK needs to be 
cleared at every context switch, other archs setup a different return 
address (usually ret_from_fork) and then finish scheduling by calling 
schedule_tail().

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ