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: <20220904214134.408619-57-jim.cromie@gmail.com>
Date:   Sun,  4 Sep 2022 15:41:33 -0600
From:   Jim Cromie <jim.cromie@...il.com>
To:     jbaron@...mai.com, gregkh@...uxfoundation.org,
        dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
        intel-gvt-dev@...ts.freedesktop.org,
        intel-gfx@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc:     daniel.vetter@...ll.ch, seanpaul@...omium.org, robdclark@...il.com,
        linux@...musvillemoes.dk, joe@...ches.com,
        Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH v6 56/57] dyndbg: work ddebug_map_site

attempt container-of, broken, missing use of uplink... took that out.

ptr computations are naive, and wrong.

Deeper prob is lack of _ddebug_vec, with header and descs in same struct.
maybe.

builtin_state looks right in debugger
---
 lib/dynamic_debug.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 194367bc13fb..11fea1f818a7 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -173,8 +173,25 @@ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_table cons
 	return NULL;
 }
 
-static inline struct _ddebug_site * _ddebug_map_site(const struct _ddebug *desc)
+/*
+ * mapping from desc to site is multi-step:
+ * - _index back to &descs[0]
+ * - container-of to get header struct above
+ * - ._uplink field, pointing to _ddebug_info (for builtins, loadables)
+ * - di->sites[desc->_map]
+ */
+static struct _ddebug_site * _ddebug_map_site(const struct _ddebug *desc)
 {
+	struct _ddebug_info *di;
+	struct _ddebug const *d0 = desc - desc->_index * sizeof(struct _ddebug);
+
+	di = (struct _ddebug_info *) d0;
+
+	v3pr_info("map_site idx:%d map:%d %s.%s  di:%px site:%px ds:%px\n",
+		  desc->_index, desc->_map,
+		  desc->site->_modname, desc->site->_function,
+		  di, desc->site, &di->sites[desc->_map]);
+
 	return desc->site;
 }
 #define _desc_field(desc, _fld)	(desc ? (_ddebug_map_site(desc)->_fld) : "_na_")
@@ -866,7 +883,7 @@ static char *__dynamic_emit_prefix(const struct _ddebug *desc, char *buf)
 	return buf;
 }
 
-static inline char *dynamic_emit_prefix(struct _ddebug *desc, char *buf)
+char *dynamic_emit_prefix(struct _ddebug *desc, char *buf)
 {
 	if (unlikely(desc->flags & _DPRINTK_FLAGS_INCL_ANY))
 		return __dynamic_emit_prefix(desc, buf);
-- 
2.37.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ