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: <20240210235009.2405808-28-ukaszb@chromium.org>
Date: Sun, 11 Feb 2024 00:49:57 +0100
From: Łukasz Bartosik <ukaszb@...omium.org>
To: Jason Baron <jbaron@...mai.com>,
	Jim Cromie <jim.cromie@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Kees Cook <keescook@...omium.org>,
	Douglas Anderson <dianders@...omium.org>
Cc: Guenter Roeck <groeck@...gle.com>,
	Yaniv Tzoreff <yanivt@...gle.com>,
	Benson Leung <bleung@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Vincent Whitchurch <vincent.whitchurch@...s.com>,
	Pekka Paalanen <ppaalanen@...il.com>,
	Sean Paul <seanpaul@...omium.org>,
	Daniel Vetter <daniel@...ll.ch>,
	Simon Ser <contact@...rsion.fr>,
	John Ogness <john.ogness@...utronix.de>,
	Petr Mladek <pmladek@...e.com>,
	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	linux-kernel@...r.kernel.org,
	upstream@...ihalf.com
Subject: [PATCH v4 27/39] dyndbg: update "ddcmd =:foo" behavior

Previously the following commands were equivalent

      ddcmd =_:foo
      ddcmd =:foo

and both unset all flags and set foo label.

This patch modifies the behavior of the command

      ddcmd =:foo

to set (only) the foo label and preserve the flags.

Signed-off-by: Łukasz Bartosik <ukaszb@...omium.org>
---
 lib/dynamic_debug.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 3a9dd73357c8..7723bb7dfc46 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -882,6 +882,7 @@ static int ddebug_parse_query(char *words[], int nwords,
  */
 static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers)
 {
+	bool explicit_no_flags = !strchr(str, '_') ? false : true;
 	read_flag_args_f read_args;
 	int op, i;
 	char *fst;
@@ -927,6 +928,14 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers)
 	case '=':
 		/* modifiers->flags already set */
 		modifiers->mask = 0;
+
+		/*
+		 * cover the case where "ddcmd =:foo" sets (only)
+		 * the foo label, since no flags are given
+		 */
+		if (!explicit_no_flags && !modifiers->flags &&
+		    modifiers->trace_dst != DST_NOT_SET)
+			modifiers->mask = ~0U;
 		break;
 	case '+':
 		modifiers->mask = ~0U;
-- 
2.43.0.687.g38aa6559b0-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ