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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240617173426.6.Ia1d546061f9430a90df0e7521097040e0e939c58@changeid>
Date: Mon, 17 Jun 2024 17:34:40 -0700
From: Douglas Anderson <dianders@...omium.org>
To: Daniel Thompson <daniel.thompson@...aro.org>
Cc: kgdb-bugreport@...ts.sourceforge.net,
	Douglas Anderson <dianders@...omium.org>,
	Christophe JAILLET <christophe.jaillet@...adoo.fr>,
	Jason Wessel <jason.wessel@...driver.com>,
	Thorsten Blum <thorsten.blum@...lux.com>,
	Yuran Pereira <yuran.pereira@...mail.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 06/13] kdb: Remove "mdW" and "mdWcN" handling of "W" == 0

The "mdW" and "mdWcN" generally lets the user control more carefully
what word size we display memory in and exactly how many words should
be displayed. Specifically, "md4" says to display memory w/ 4
bytes-per word and "md4c6" says to display 6 words of memory w/
4-bytes-per word.

The kdb "md" implementation has a special rule for when "W" is 0. In
this case:
* If you run with "W" == 0 and you've never run a kdb "md" command
  this reboot then it will pick 4 bytes-per-word, ignoring the normal
  default from the environment.
* If you run with "W" == 0 and you've run a kdb "md" command this
  reboot then it will pick up the bytes per word of the last command.

As an example:
  [1]kdb> md2 0xffffff80c8e2b280 1
  0xffffff80c8e2b280 0200 0000 0000 0000 e000 8235 0000 0000   ...
  [1]kdb> md0 0xffffff80c8e2b280 1
  0xffffff80c8e2b280 0200 0000 0000 0000 e000 8235 0000 0000   ...
  [1]kdb> md 0xffffff80c8e2b280 1
  0xffffff80c8e2b280 0000000000000200 000000008235e000   ...
  [1]kdb> md0 0xffffff80c8e2b280 1
  0xffffff80c8e2b280 0000000000000200 000000008235e000   ...

This doesn't seem like particularly useful behavior and adds a bunch
of complexity to the arg parsing. Remove it.

Signed-off-by: Douglas Anderson <dianders@...omium.org>
---

 kernel/debug/kdb/kdb_main.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index c013b014a7d3..700b4e355545 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1611,11 +1611,6 @@ static int kdb_md(int argc, const char **argv)
 
 	if (isdigit(argv[0][2])) {
 		bytesperword = (int)(argv[0][2] - '0');
-		if (bytesperword == 0) {
-			bytesperword = last_bytesperword;
-			if (bytesperword == 0)
-				bytesperword = 4;
-		}
 		last_bytesperword = bytesperword;
 		repeat = mdcount * 16 / bytesperword;
 		if (!argv[0][3])
-- 
2.45.2.627.g7a2c4fd464-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ