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: <20071129195032.GC15245@elte.hu>
Date:	Thu, 29 Nov 2007 20:50:32 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Christoph Hellwig <hch@...radead.org>,
	Roland McGrath <roland@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH x86/mm 08/11] x86 ia32 ptrace getreg/putreg merge


* H. Peter Anvin <hpa@...or.com> wrote:

> Christoph Hellwig wrote:
>> On Thu, Nov 29, 2007 at 04:00:31AM -0800, Roland McGrath wrote:
>>> +#define R32(l,q)							\
>>> +	case offsetof(struct user32, regs.l):				\
>>> +		regs->q = value; break
>>> +
>>> +#define SEG32(rs)							\
>>> +	case offsetof(struct user32, regs.rs):				\
>>> +		return set_segment_reg(child,				\
>>> +				       offsetof(struct user_regs_struct, rs), \
>>> +				       value);				\
>>> +		break
>>
>> The code would be a lot more readable if you just opencoded this in the
>> caller instead of these obsfucated macros.
>
> For better or worse, though, that is style of existing code.  I 
> personally found it easy to deal with when I went through the code 
> recently.

yep. The ptrace code has certainly lots of inconsistent style crap piled 
up during its 10 year history of only be touched with a 10 foot pole. 
I'd go for small patches that continuously improve the picture within 
the existing mechanisms than any "100% pure required" approach. With 48 
clean patches from Roland we are already on the right granularity level 
i think.

See how ptrace.c raw code quality has already increased leaps and 
bounds:

                                       errors   lines of code   errors/KLOC
 [before]
 arch/x86/kernel/ptrace_64.c               58             621          93.3
 arch/x86/kernel/ptrace_32.c               39             717          54.3

 [after]
 arch/x86/kernel/ptrace.c                  13            1135          11.4

so i'm not worried about that aspect. We are definitely "for the 
better".

	Ingo
-
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