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: <CABqD9hb0O8DKr0FeKA3WsP7deQW5v9HKGJQq5Cw_D6wN20z6og@mail.gmail.com>
Date:	Sat, 28 Jan 2012 15:06:15 -0600
From:	Will Drewry <wad@...omium.org>
To:	LKML <linux-kernel@...r.kernel.org>, Greg KH <gregkh@...e.de>
Cc:	keescook@...omium.org, john.johansen@...onical.com,
	serge.hallyn@...onical.com, coreyb@...ux.vnet.ibm.com,
	pmoore@...hat.com, eparis@...hat.com, djm@...drot.org,
	torvalds@...ux-foundation.org, segoon@...nwall.com,
	rostedt@...dmis.org, jmorris@...ei.org, scarybeasts@...il.com,
	avi@...hat.com, penberg@...helsinki.fi, viro@...iv.linux.org.uk,
	luto@....edu, mingo@...e.hu, akpm@...ux-foundation.org,
	khilman@...com, borislav.petkov@....com, oleg@...hat.com,
	ak@...ux.intel.com, eric.dumazet@...il.com, dhowells@...hat.com,
	daniel.lezcano@...e.fr, linux-fsdevel@...r.kernel.org,
	linux-security-module@...r.kernel.org, olofj@...omium.org,
	mhalcrow@...gle.com, dlaor@...hat.com, corbet@....net,
	alan@...rguk.ukuu.org.uk, indan@....nu, mcgrathr@...omium.org
Subject: Re: [PATCH v5 1/3] seccomp: kill the seccomp_t typedef

On Sat, Jan 28, 2012 at 5:13 AM, Cong Wang <amwang@...hat.com> wrote:
> On Fri, 2012-01-27 at 17:47 -0600, Will Drewry wrote:
>> On Fri, Jan 27, 2012 at 5:41 PM, Greg KH <gregkh@...e.de> wrote:
>> > On Fri, Jan 27, 2012 at 05:24:39PM -0600, Will Drewry wrote:
>> >> Replaces the seccomp_t typedef with seccomp_struct to match modern
>> >> kernel style.
>> >>
>> >> Signed-off-by: Will Drewry <wad@...omium.org>
>> >> ---
>> >>  include/linux/sched.h   |    2 +-
>> >>  include/linux/seccomp.h |   10 ++++++----
>> >>  2 files changed, 7 insertions(+), 5 deletions(-)
>> >>
>> >> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> >> index 4032ec1..288b5cb 100644
>> >> --- a/include/linux/sched.h
>> >> +++ b/include/linux/sched.h
>> >> @@ -1418,7 +1418,7 @@ struct task_struct {
>> >>       uid_t loginuid;
>> >>       unsigned int sessionid;
>> >>  #endif
>> >> -     seccomp_t seccomp;
>> >> +     struct seccomp_struct seccomp;
>> >
>> > Isn't 'struct seccomp_struct' a bit redundant?
>> >
>> > How about a simple 'struct seccomp' instead?
>>
>> Works for me - I can't recall why that seemed to make sense (other
>> than the user of similar redundant names elsewhere).
>
> seccomp_struct for a type is okay, but you also have:

Thanks. Looking again, I see the main benefit of seccomp_struct over
seccomp being that it help avoids error.  Ignoring task_struct :),
signal_struct and sighand_structs are a good example.  Since the
member name is "signal" and "sighand", I think this bit of redundancy
helps disambiuguate, but perhaps I'm just being overly conservative.

I'll leave it as is unless Greg or someone else feels strongly :)

> +#define seccomp_struct_init_task(_seccomp) do { } while (0);
> +#define seccomp_struct_fork(_tsk, _orig) do { } while (0);
> +#define seccomp_struct_free_task(_seccomp) do { } while (0);
>
> in patch 2/3, "struct" in these function/macro names is redundant.

Fixed - thanks!
--
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