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: <230723205506.M0106064@vega.pgw.jp>
Date:   Sun, 23 Jul 2023 20:55:06 +0900
From:   <kkabe@...a.pgw.jp>
To:     rostedt@...dmis.org
Cc:     regressions@...ts.linux.dev, bagasdotme@...il.com,
        alexander.deucher@....com, christian.koenig@....com,
        Xinhui.Pan@....com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
        linux-kernel@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
        kkabe@...a.pgw.jp
Subject: Re: radeon.ko/i586: BUG: kernel NULL pointer dereference,address:00000004

Since the problem with enabling FTRACE_MCOUNT_MAX_OFFSET may be
test_for_valid_rec() returning wrong results, I made a small patch to 
catch the result:

================ patch-test_for_valid_rec-printk.patch
diff -up ./kernel/trace/ftrace.c.ft ./kernel/trace/ftrace.c
--- ./kernel/trace/ftrace.c.ft	2023-07-21 21:51:29.450928552 +0900
+++ ./kernel/trace/ftrace.c	2023-07-23 01:59:59.321558953 +0900
@@ -3678,6 +3678,7 @@ static int test_for_valid_rec(struct dyn
 	/* Weak functions can cause invalid addresses */
 	if (!ret || offset > FTRACE_MCOUNT_MAX_OFFSET) {
 		rec->flags |= FTRACE_FL_DISABLED;
+		printk("%s: disable ftrace for %s offset 0x%lx\n", __func__, str, offset);
 		return 0;
 	}
 	return 1;
================

I will attach the console output (with another panic).
Steve, does this look sane?


Another panic seems to occuring here:
    void drm_vblank_cancel_pending_works(struct drm_vblank_crtc *vblank)
    {
            struct drm_vblank_work *work, *next;

            assert_spin_locked(&vblank->dev->event_lock);   <<<probably here

            list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
                    list_del_init(&work->node);
                    drm_vblank_put(vblank->dev, vblank->pipe);
            }

            wake_up_all(&vblank->work_wait_queue);
    }


So I tried to trap NULL and return:

================ patch-drm_vblank_cancel_pending_works-printk-NULL-ret.patch
diff -up ./drivers/gpu/drm/drm_vblank_work.c.pk2 ./drivers/gpu/drm/drm_vblank_work.c
--- ./drivers/gpu/drm/drm_vblank_work.c.pk2	2023-06-06 20:50:40.000000000 +0900
+++ ./drivers/gpu/drm/drm_vblank_work.c	2023-07-23 14:29:56.383093673 +0900
@@ -71,6 +71,10 @@ void drm_vblank_cancel_pending_works(str
 {
 	struct drm_vblank_work *work, *next;
 
+	if (!vblank->dev) {
+		printk(KERN_WARNING "%s: vblank->dev == NULL? returning\n", __func__);
+		return;
+	}
 	assert_spin_locked(&vblank->dev->event_lock);
 
 	list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
================

This time, the printk trap does not happen!! and radeon.ko works.
(NULL check for vblank->worker is still fireing though)

Now this is puzzling.
Is this a timing issue?
Is systemd-udevd doing something not favaorble to kernel?
Is drm vblank code running without enough initialization?

Puzzling is, that purely useland activity
(logging in on tty1 before radeon.ko load)
is affecting kernel panic/no-panic.

-- 
kabe
View attachment "putty-5.18.0-13.4.log" of type "text/plain" (105399 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ