mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] Drivers/8255: Page fault in comedi_8255.c
@ 2025-11-29 13:19 李天宇
  2025-12-03 13:08 ` Ian Abbott
  0 siblings, 1 reply; 6+ messages in thread
From: 李天宇 @ 2025-11-29 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: abbotti, hsweeten, xujiakai2025, zhaoruilin22

Hi,

There’s a bug in the comedi_8255.c file, specifically related to a page fault. This issue occurs when an illegal address is passed as a parameter to outb() function at line 47. This illegal address is subsequently used in asm code, leading to a page fault when trying to write to -0x70(%rsi).

The bug was initially discovered via a fuzzing framework on Linux kernel version 6.18-rc6, and it was later found reproducible on Linux kernel version 6.18-rc7.

After analyzing the calling stack, I suspect that the root cause may lie in the dev_8255_attach function. Specifically, at 8255.c:70, when reading iobase from it->options[i], there seems to be no validation for the conversion from int to unsigned long. If a negative value is encountered, it is cast to an illegally large number (e.g., 0xffff…), which may be causing the issue.

I’m not entirely confident in this analysis, but fortunately, there’s enough information provided for your reference:

	Kernel Source: https://git.kernel.org/torvalds/t/linux-6.18-rc7.tar.gz
	Configuration: https://github.com/j1akai/KConfigFuzz_bug/raw/refs/heads/main/x86/mainline-config
	Reproducible Code: https://github.com/Wxm-233/KConfigFuzz_crashes/raw/refs/heads/main/405536bde2d1b503f3903a2a3de2d6dd94cef0a3/repro.cprog
        GCC Info: https://github.com/Wxm-233/KConfigFuzz_crashes/raw/refs/heads/main/405536bde2d1b503f3903a2a3de2d6dd94cef0a3/gccinfo
	Kernel Log(First found): https://github.com/Wxm-233/KConfigFuzz_crashes/raw/refs/heads/main/405536bde2d1b503f3903a2a3de2d6dd94cef0a3/report0
	Kernel Log(Later Repro): https://github.com/Wxm-233/KConfigFuzz_crashes/raw/refs/heads/main/405536bde2d1b503f3903a2a3de2d6dd94cef0a3/report

I hope this information is helpful in identifying and resolving the issue. Thanks for your time and attention.


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

end of thread, other threads:[~2025-12-10 10:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-29 13:19 [BUG] Drivers/8255: Page fault in comedi_8255.c 李天宇
2025-12-03 13:08 ` Ian Abbott
2025-12-04 12:03   ` 李天宇
2025-12-04 17:11     ` Ian Abbott
2025-12-09 13:24       ` Tianyu Li
2025-12-10 10:06         ` Ian Abbott

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

all inboxes | Powered by JetHome®