opnsense-src/sys/compat/linuxkpi/common/include
Austin Shafer 3f686532c9 linuxkpi: Fix __sg_alloc_table_from_pages loop
Commit 3e0856b63f updated
__sg_alloc_table_from_pages to use the same API as linux, but modified
the loop condition when going over the pages in a sg list. Part of the
change included moving the sg_next call out of the for loop and into the
body, which causes an off by one error when traversing the list. Since
sg_next is called before the loop body it will skip the first element
and read one past the last element.

This caused panics when running PRIME with nvidia-drm as the off-by-one
issue causes a NULL dereference.

Reviewed by:	bz, hselasky
Differential Revision:	https://reviews.freebsd.org/D39628
Fixes:	3e0856b63f ("linuxkpi: Fix `sg_alloc_table_from_pages()` to have the same API as Linux")
2023-04-21 09:56:50 +02:00
..
acpi linuxkpi: Include errno.h from acpi/video.h 2023-01-02 22:05:27 +01:00
asm linuxkpi: Add alderlake defines in intel-family 2023-03-28 10:57:13 +02:00
asm-generic linuxkpi: Add io.h 2022-08-08 15:22:35 +02:00
linux linuxkpi: Fix __sg_alloc_table_from_pages loop 2023-04-21 09:56:50 +02:00
net LinuxKPI: 802.11: improve assertion and tkip code 2023-04-20 16:07:50 +00:00
video linuxkpi: Add video/mipi_display.h 2022-08-18 09:47:12 +02:00
stdarg.h LinuxKPI: Add stdarg.h proxy header 2022-01-10 22:49:37 +03:00