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] [thread-next>] [day] [month] [year] [list]
Message-ID: <55046C5B.6020308@gmail.com>
Date:	Sat, 14 Mar 2015 19:14:03 +0200
From:	Alex Dowad <alexinbeijing@...il.com>
To:	David Rientjes <rientjes@...gle.com>, josh@...htriplett.org
CC:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Rik van Riel <riel@...hat.com>,
	Vladimir Davydov <vdavydov@...allels.com>
Subject: Re: [PATCH 01/32] do_fork(): Rename 'stack_size' argument to reflect
 actual use


On 14/03/15 01:21, David Rientjes wrote:
> On Fri, 13 Mar 2015, josh@...htriplett.org wrote:
>
>> On Fri, Mar 13, 2015 at 08:04:16PM +0200, Alex Dowad wrote:
>>> The 'stack_size' argument is never used to pass a stack size. It's only used when
>>> forking a kernel thread, in which case it is an argument which should be passed
>>> to the 'main' function which the kernel thread executes. Hence, rename it to
>>> 'kthread_arg'.
>> That's not the only use of stack_size.  Take a look at the clone2 system
>> call (very minimally documented in the clone manpage) and the
>> implementation of copy_thread on ia64, which does use stack_size in the
>> non-kthread path.
>>
> Exactly, and it seems like Alex just disregarded this early feedback when
> this was first raised that suggested it just be named "arg" and to comment
> the individual usage in the functions that get called with the formal.
David, just to clarify: your feedback was much appreciated and has not 
been disregarded. I am still not convinced that "arg" is the best name 
for the argument now called "stack_start"; I think there must be a 
better name, but can't think of what it is. If you or others have more 
suggestions, that would be helpful.

Because of the uncertainty, I have avoided modifying that part of the 
code, and have focused on what seems like a more clear and unequivocal 
win for readability: renaming the "stack_size" argument. Josh Triplett 
kindly pointed out that "stack_size" is in fact used for a stack size 
when processing one particular syscall on one arch. However, rather than 
naming the args according to that rare case, it seems like a better idea 
to name them according to the 99.9% case, and add a comment mentioning 
the 0.1% case.

Or maybe "arg1" and "arg2" are really best. If the other maintainers 
concur with that, I would be happy to rewrite this set of patches 
accordingly.

Again, I appreciate your feedback and hope to receive more (if you have 
more to give).

Thanks,
Alex Dowad
--
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