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: <535E2DD5.3020501@linaro.org>
Date:	Mon, 28 Apr 2014 11:30:45 +0100
From:	Daniel Thompson <daniel.thompson@...aro.org>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	kgdb-bugreport@...ts.sourceforge.net,
	Jason Wessel <jason.wessel@...driver.com>, patches@...aro.org,
	linaro-kernel@...ts.linaro.org, linux-kernel@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>,
	John Stultz <john.stultz@...aro.org>,
	Anton Vorontsov <anton.vorontsov@...aro.org>,
	Colin Cross <ccross@...roid.com>, kernel-team@...roid.com
Subject: Re: [RFC v3 7/9] kdb: Categorize kdb commands (similar to SysRq categorization)

On 25/04/14 17:57, Steven Rostedt wrote:
>> +	KDB_ENABLE_ALL_NO_ARGS = KDB_ENABLE_ALL << 16,
>> +	KDB_ENABLE_MEM_READ_NO_ARGS = KDB_ENABLE_MEM_READ << 16,
>> +	KDB_ENABLE_MEM_WRITE_NO_ARGS = KDB_ENABLE_MEM_WRITE << 16,
>> +	KDB_ENABLE_REG_READ_NO_ARGS = KDB_ENABLE_REG_READ << 16,
>> +	KDB_ENABLE_REG_WRITE_NO_ARGS = KDB_ENABLE_REG_WRITE << 16,
>> +	KDB_ENABLE_INSPECT_NO_ARGS = KDB_ENABLE_INSPECT << 16,
>> +	KDB_ENABLE_FLOW_CTRL_NO_ARGS = KDB_ENABLE_FLOW_CTRL << 16,
>> +	KDB_ENABLE_SIGNAL_NO_ARGS = KDB_ENABLE_SIGNAL << 16,
>> +	KDB_ENABLE_REBOOT_NO_ARGS = KDB_ENABLE_REBOOT << 16,
>> +	KDB_ENABLE_ALWAYS_SAFE_NO_ARGS = KDB_ENABLE_ALWAYS_SAFE << 16,
>> +	KDB_ENABLE_MASK_NO_ARGS = KDB_ENABLE_MASK << 16,
> 
> I would recommend defining a KDB_NO_ARGS_SHIFT to be 16 and use that
> instead of having a magic number 16 to deal with. This also makes it
> easier if you need to shift a bit more in the future.
> 
> 	KDB_ENABLE_ALL_NO_ARGS = KDB_ENABLE_ALL << KDB_NO_ARGS_SHIFT,

Good point. I will fix this (and reduce KDB_NO_ARGS_SHIFT to the proper
value).

> Although, I'm not sure why you just didn't have a KDB_ENABLE_ARGS flag,
> and then you don't need to repeat all the flags again. Seems rather
> silly.
> 
> KDB_ENABLE_ALL_NO_ARGS would then be just
> KDB_ENABLE_ALL|KDB_ENABLE_NO_ARGS.
> 
> Or can you have multiple settings? That is, MEM_READ and
> MEM_WRITE_NO_ARGS both set such that you can't just have a simple args
> or no args command for the entire flags?

That's basically it. Some commands change classification if they have an
argument ('go' is the best example; it changes from always-safe to
register-write because if an argument is given it gets copied to the PC).

Actually only two of the _NO_ARGS values are currently used, however
having a shift relationship between the flags makes it much simpler to
do the permissions check.


Daniel.
--
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