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: <3f7fa537d49fbd96ffae84f62029bd9e56e99d5a.1701993656.git.jim.cromie@gmail.com>
Date:   Thu,  7 Dec 2023 17:15:07 -0700
From:   Jim Cromie <jim.cromie@...il.com>
To:     lb@...ihalf.com, linux-kernel@...r.kernel.org
Cc:     akpm@...ux-foundation.org, bleung@...gle.com, contact@...rsion.fr,
        daniel@...ll.ch, dianders@...omium.org, groeck@...gle.com,
        jbaron@...mai.com, jim.cromie@...il.com, john.ogness@...utronix.de,
        keescook@...omium.org, pmladek@...e.com, ppaalanen@...il.com,
        rostedt@...dmis.org, seanpaul@...omium.org,
        sergey.senozhatsky@...il.com, upstream@...ihalf.com,
        vincent.whitchurch@...s.com, yanivt@...gle.com,
        gregkh@...uxfoundation.org
Subject: [re: PATCH v2 00/15 -  04/11] dyndbg: fix old BUG_ON in >control parser

Fix a BUG_ON from 2009.  I have hit it while fuzzing >control on some
other patches, and panic from user input is bad.  Replace the BUG_ON
with pr_error and return -EINVAL.

Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
 lib/dynamic_debug.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index bde96ad867c6..2ac1bd7f105f 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -660,7 +660,11 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
 		} else {
 			for (end = buf; *end && !isspace(*end); end++)
 				;
-			BUG_ON(end == buf);
+			if (end == buf) {
+				pr_err("parse err after word:%d=%s\n", nwords,
+				       nwords ? words[nwords - 1] : "<none>");
+				return -EINVAL;
+			}
 		}
 
 		/* `buf' is start of word, `end' is one past its end */
-- 
2.43.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ