Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH v3 0/3] s390/debug: Fix several s390dbf issues reported by AI scan
@ 2026-09-03 13:07 Mikhail Zaslonko
  2026-09-03 13:07 ` [PATCH v3 1/3] s390/debug: Fix NULL pointer dereference in debug_set_level() Mikhail Zaslonko
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Mikhail Zaslonko @ 2026-09-03 13:07 UTC (permalink / raw)
  To: linux-s390
  Cc: Heiko Carstens, Alexander Gordeev, Vasily Gorbik,
	Ilya Leoshkevich, Peter Oberparleiter

The s390dbf kernel parameter was added in commit a2cec6863709
("s390/debug: Add s390dbf kernel parameter"). This series fixes
three issues found in the surrounding code.

Patch 1 fixes a NULL pointer dereference in debug_set_level()
introduced by that commit: the NULL check for the id argument
was moved into the _debug_set_level() helper, but the newly added
debug_get_param() call was left in the wrapper ahead of it.

Patch 2 eliminates a duplicate override notice that appears when
drivers call debug_set_level() right after debug_register(), which
is the common pattern. With the s390dbf= parameter active and
many devices (e.g. many DASDs), this produced a lot of redundant
log lines during boot.

Patch 3 fixes a pre-existing race between debug area resize and
event logging. Setting pages to zero via the debugfs interface
races with concurrent event writers: the unlocked id->areas check
passes, but by the time the lock is acquired debug_areas_swap()
may have published a NULL pointer, which get_active_entry() then
dereferences. The race was confirmed to hang the system in testing
by running concurrent debug area resize (pages 0->4 in a tight
loop) against parallel DASD I/O.

Changes in v3:
- Patch 3: put back !id->areas check under lock in debug_flush()
  and remove existing !id->areas check before the lock (Peter Oberparleiter)

Changes in v2:
- Patch 1: Trimmed commit message; !id check removed from
  _debug_set_level() (Peter Oberparleiter)
- Patch 3: Trimmed commit message; !id->areas check removed
  from debug_flush() (Peter Oberparleiter)

Mikhail Zaslonko (3):
  s390/debug: Fix NULL pointer dereference in debug_set_level()
  s390/debug: Do not repeat parameter override notice on
    debug_set_level()
  s390/debug: Fix race between debug area resize and event logging

 arch/s390/kernel/debug.c | 54 ++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 18 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-03 19:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 13:07 [PATCH v3 0/3] s390/debug: Fix several s390dbf issues reported by AI scan Mikhail Zaslonko
2026-09-03 13:07 ` [PATCH v3 1/3] s390/debug: Fix NULL pointer dereference in debug_set_level() Mikhail Zaslonko
2026-09-03 13:16   ` sashiko-bot
2026-09-03 13:07 ` [PATCH v3 2/3] s390/debug: Do not repeat parameter override notice on debug_set_level() Mikhail Zaslonko
2026-09-03 13:17   ` sashiko-bot
2026-09-03 13:07 ` [PATCH v3 3/3] s390/debug: Fix race between debug area resize and event logging Mikhail Zaslonko
2026-09-03 13:21   ` sashiko-bot
2026-09-03 19:33 ` [PATCH v3 0/3] s390/debug: Fix several s390dbf issues reported by AI scan Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox