* [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list
@ 2025-09-22 16:23 Peter Senna Tschudin
2025-09-22 19:49 ` ✓ Xe.CI.BAT: success for " Patchwork
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Peter Senna Tschudin @ 2025-09-22 16:23 UTC (permalink / raw)
To: igt-dev; +Cc: Peter Senna Tschudin
Add a check to igt_list_empty() to return true if the list head pointer
or its next/prev pointers are NULL, preventing segfaults when operating
on uninitialized or potentially broken lists.
Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com>
---
lib/igt_list.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/igt_list.c b/lib/igt_list.c
index 37ae139c4..f77aef7dd 100644
--- a/lib/igt_list.c
+++ b/lib/igt_list.c
@@ -79,5 +79,9 @@ int igt_list_length(const struct igt_list_head *head)
bool igt_list_empty(const struct igt_list_head *head)
{
+ /* Detect uninitialized / potentially broken list */
+ if (!head || !head->next || !head->prev)
+ return true;
+
return head->next == head;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* ✓ Xe.CI.BAT: success for lib/igt_list: igt_list_empty() Detect uninitialized list 2025-09-22 16:23 [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list Peter Senna Tschudin @ 2025-09-22 19:49 ` Patchwork 2025-09-22 19:56 ` ✗ i915.CI.BAT: failure " Patchwork ` (2 subsequent siblings) 3 siblings, 0 replies; 7+ messages in thread From: Patchwork @ 2025-09-22 19:49 UTC (permalink / raw) To: Peter Senna Tschudin; +Cc: igt-dev [-- Attachment #1: Type: text/plain, Size: 1900 bytes --] == Series Details == Series: lib/igt_list: igt_list_empty() Detect uninitialized list URL : https://patchwork.freedesktop.org/series/154855/ State : success == Summary == CI Bug Log - changes from XEIGT_8548_BAT -> XEIGTPW_13797_BAT ==================================================== Summary ------- **WARNING** Minor unknown changes coming with XEIGTPW_13797_BAT need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in XEIGTPW_13797_BAT, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them to document this new failure mode, which will reduce false positives in CI. Participating hosts (11 -> 11) ------------------------------ No changes in participating hosts Possible new issues ------------------- Here are the unknown changes that may have been introduced in XEIGTPW_13797_BAT: ### IGT changes ### #### Warnings #### * igt@xe_module_load@load: - bat-bmg-1: [ABORT][1] ([Intel XE#6201]) -> [ABORT][2] [1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8548/bat-bmg-1/igt@xe_module_load@load.html [2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_13797/bat-bmg-1/igt@xe_module_load@load.html Known issues ------------ Here are the changes found in XEIGTPW_13797_BAT that come from known issues: ### IGT changes ### {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [Intel XE#6201]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6201 Build changes ------------- * IGT: IGT_8548 -> IGTPW_13797 IGTPW_13797: 13797 IGT_8548: 8548 xe-3813-3ff214d6c6a86025aa3feadcb5bba4abfc2dd8f1: 3ff214d6c6a86025aa3feadcb5bba4abfc2dd8f1 == Logs == For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_13797/index.html [-- Attachment #2: Type: text/html, Size: 2484 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* ✗ i915.CI.BAT: failure for lib/igt_list: igt_list_empty() Detect uninitialized list 2025-09-22 16:23 [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list Peter Senna Tschudin 2025-09-22 19:49 ` ✓ Xe.CI.BAT: success for " Patchwork @ 2025-09-22 19:56 ` Patchwork 2025-09-23 1:16 ` ✓ Xe.CI.Full: success " Patchwork 2025-09-23 8:14 ` [PATCH i-g-t] " Manszewski, Christoph 3 siblings, 0 replies; 7+ messages in thread From: Patchwork @ 2025-09-22 19:56 UTC (permalink / raw) To: Peter Senna Tschudin; +Cc: igt-dev [-- Attachment #1: Type: text/plain, Size: 4822 bytes --] == Series Details == Series: lib/igt_list: igt_list_empty() Detect uninitialized list URL : https://patchwork.freedesktop.org/series/154855/ State : failure == Summary == CI Bug Log - changes from IGT_8548 -> IGTPW_13797 ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with IGTPW_13797 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_13797, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/index.html Participating hosts (39 -> 38) ------------------------------ Missing (1): bat-adls-6 Possible new issues ------------------- Here are the unknown changes that may have been introduced in IGTPW_13797: ### IGT changes ### #### Possible regressions #### * igt@core_auth@basic-auth: - fi-glk-j4005: NOTRUN -> [INCOMPLETE][1] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/fi-glk-j4005/igt@core_auth@basic-auth.html * igt@i915_selftest@live@requests: - bat-atsm-1: [PASS][2] -> [DMESG-WARN][3] [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8548/bat-atsm-1/igt@i915_selftest@live@requests.html [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/bat-atsm-1/igt@i915_selftest@live@requests.html * igt@kms_force_connector_basic@force-edid: - bat-kbl-2: NOTRUN -> [ABORT][4] [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/bat-kbl-2/igt@kms_force_connector_basic@force-edid.html * igt@runner@aborted: - fi-glk-j4005: NOTRUN -> [FAIL][5] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/fi-glk-j4005/igt@runner@aborted.html Known issues ------------ Here are the changes found in IGTPW_13797 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@kms_force_connector_basic@force-connector-state: - fi-kbl-8809g: [PASS][6] -> [ABORT][7] ([i915#15020]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8548/fi-kbl-8809g/igt@kms_force_connector_basic@force-connector-state.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/fi-kbl-8809g/igt@kms_force_connector_basic@force-connector-state.html #### Possible fixes #### * igt@i915_module_load@load: - fi-glk-j4005: [ABORT][8] ([i915#15020]) -> [PASS][9] [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8548/fi-glk-j4005/igt@i915_module_load@load.html [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/fi-glk-j4005/igt@i915_module_load@load.html * igt@kms_force_connector_basic@force-connector-state: - bat-kbl-2: [ABORT][10] ([i915#15020]) -> [PASS][11] [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8548/bat-kbl-2/igt@kms_force_connector_basic@force-connector-state.html [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/bat-kbl-2/igt@kms_force_connector_basic@force-connector-state.html #### Warnings #### * igt@i915_module_load@load: - fi-elk-e7500: [ABORT][12] -> [ABORT][13] ([i915#15020]) [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8548/fi-elk-e7500/igt@i915_module_load@load.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/fi-elk-e7500/igt@i915_module_load@load.html * igt@i915_selftest@live: - bat-atsm-1: [DMESG-FAIL][14] ([i915#12061] / [i915#14204]) -> [DMESG-FAIL][15] ([i915#12061] / [i915#13929]) [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8548/bat-atsm-1/igt@i915_selftest@live.html [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/bat-atsm-1/igt@i915_selftest@live.html * igt@i915_selftest@live@mman: - bat-atsm-1: [DMESG-FAIL][16] ([i915#14204]) -> [DMESG-FAIL][17] ([i915#13929]) [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8548/bat-atsm-1/igt@i915_selftest@live@mman.html [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/bat-atsm-1/igt@i915_selftest@live@mman.html [i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061 [i915#13929]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13929 [i915#14204]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14204 [i915#15020]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15020 Build changes ------------- * CI: CI-20190529 -> None * IGT: IGT_8548 -> IGTPW_13797 CI-20190529: 20190529 CI_DRM_17254: 3ff214d6c6a86025aa3feadcb5bba4abfc2dd8f1 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_13797: 13797 IGT_8548: 8548 == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_13797/index.html [-- Attachment #2: Type: text/html, Size: 6139 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Xe.CI.Full: success for lib/igt_list: igt_list_empty() Detect uninitialized list 2025-09-22 16:23 [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list Peter Senna Tschudin 2025-09-22 19:49 ` ✓ Xe.CI.BAT: success for " Patchwork 2025-09-22 19:56 ` ✗ i915.CI.BAT: failure " Patchwork @ 2025-09-23 1:16 ` Patchwork 2025-09-23 8:14 ` [PATCH i-g-t] " Manszewski, Christoph 3 siblings, 0 replies; 7+ messages in thread From: Patchwork @ 2025-09-23 1:16 UTC (permalink / raw) To: Peter Senna Tschudin; +Cc: igt-dev [-- Attachment #1: Type: text/plain, Size: 780 bytes --] == Series Details == Series: lib/igt_list: igt_list_empty() Detect uninitialized list URL : https://patchwork.freedesktop.org/series/154855/ State : success == Summary == CI Bug Log - changes from XEIGT_8548_FULL -> XEIGTPW_13797_FULL ==================================================== Summary ------- **SUCCESS** No regressions found. Participating hosts (4 -> 3) ------------------------------ Missing (1): shard-adlp Changes ------- No changes found Build changes ------------- * IGT: IGT_8548 -> IGTPW_13797 IGTPW_13797: 13797 IGT_8548: 8548 xe-3813-3ff214d6c6a86025aa3feadcb5bba4abfc2dd8f1: 3ff214d6c6a86025aa3feadcb5bba4abfc2dd8f1 == Logs == For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_13797/index.html [-- Attachment #2: Type: text/html, Size: 1325 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list 2025-09-22 16:23 [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list Peter Senna Tschudin ` (2 preceding siblings ...) 2025-09-23 1:16 ` ✓ Xe.CI.Full: success " Patchwork @ 2025-09-23 8:14 ` Manszewski, Christoph 2025-09-23 9:20 ` Peter Senna Tschudin 3 siblings, 1 reply; 7+ messages in thread From: Manszewski, Christoph @ 2025-09-23 8:14 UTC (permalink / raw) To: Peter Senna Tschudin, igt-dev Hi Peter, On 22.09.2025 18:23, Peter Senna Tschudin wrote: > Add a check to igt_list_empty() to return true if the list head pointer > or its next/prev pointers are NULL, preventing segfaults when operating > on uninitialized or potentially broken lists. > > Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com> > --- > lib/igt_list.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/igt_list.c b/lib/igt_list.c > index 37ae139c4..f77aef7dd 100644 > --- a/lib/igt_list.c > +++ b/lib/igt_list.c > @@ -79,5 +79,9 @@ int igt_list_length(const struct igt_list_head *head) > > bool igt_list_empty(const struct igt_list_head *head) > { > + /* Detect uninitialized / potentially broken list */ > + if (!head || !head->next || !head->prev) > + return true; > + Without this change: 1. Passing an uninitialized list is a bug 2. The function doesn't check any condition and returns 'normally' regardless With this change: 1. Passing an uninitialized list is a bug (still) 2. The function *may* detect an uninitialized list which is a bug but returns 'normally' regardless If we are adding a check that catches some invalid/buggy condition the reasonable thing to do would be to assert/abort. Regards, Christoph > return head->next == head; > } ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list 2025-09-23 8:14 ` [PATCH i-g-t] " Manszewski, Christoph @ 2025-09-23 9:20 ` Peter Senna Tschudin 2025-09-23 9:32 ` Manszewski, Christoph 0 siblings, 1 reply; 7+ messages in thread From: Peter Senna Tschudin @ 2025-09-23 9:20 UTC (permalink / raw) To: Manszewski, Christoph, igt-dev, Kamil Konieczny Hi Christoph, On 9/23/2025 10:14 AM, Manszewski, Christoph wrote: > Hi Peter, > > On 22.09.2025 18:23, Peter Senna Tschudin wrote: >> Add a check to igt_list_empty() to return true if the list head pointer >> or its next/prev pointers are NULL, preventing segfaults when operating >> on uninitialized or potentially broken lists. >> >> Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com> >> --- >> lib/igt_list.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/lib/igt_list.c b/lib/igt_list.c >> index 37ae139c4..f77aef7dd 100644 >> --- a/lib/igt_list.c >> +++ b/lib/igt_list.c >> @@ -79,5 +79,9 @@ int igt_list_length(const struct igt_list_head *head) >> bool igt_list_empty(const struct igt_list_head *head) >> { >> + /* Detect uninitialized / potentially broken list */ >> + if (!head || !head->next || !head->prev) >> + return true; >> + > > Without this change: > 1. Passing an uninitialized list is a bug > 2. The function doesn't check any condition and returns 'normally' > regardless > > With this change: > 1. Passing an uninitialized list is a bug (still) > 2. The function *may* detect an uninitialized list which is a bug but > returns 'normally' regardless > > If we are adding a check that catches some invalid/buggy condition the > reasonable thing to do would be to assert/abort. I agree with you. I would say that even more concerning is to distance our implementation from the kernel implementation. I suggest we nack this change. If you are ok with it Nacked-by: Peter Senna Tschudin <peter.senna@linux.intel.com> > > Regards, > Christoph > > >> return head->next == head; >> } > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list 2025-09-23 9:20 ` Peter Senna Tschudin @ 2025-09-23 9:32 ` Manszewski, Christoph 0 siblings, 0 replies; 7+ messages in thread From: Manszewski, Christoph @ 2025-09-23 9:32 UTC (permalink / raw) To: Peter Senna Tschudin, igt-dev, Kamil Konieczny Hi Peter, On 23.09.2025 11:20, Peter Senna Tschudin wrote: > Hi Christoph, > > On 9/23/2025 10:14 AM, Manszewski, Christoph wrote: >> Hi Peter, >> >> On 22.09.2025 18:23, Peter Senna Tschudin wrote: >>> Add a check to igt_list_empty() to return true if the list head pointer >>> or its next/prev pointers are NULL, preventing segfaults when operating >>> on uninitialized or potentially broken lists. >>> >>> Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com> >>> --- >>> lib/igt_list.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/lib/igt_list.c b/lib/igt_list.c >>> index 37ae139c4..f77aef7dd 100644 >>> --- a/lib/igt_list.c >>> +++ b/lib/igt_list.c >>> @@ -79,5 +79,9 @@ int igt_list_length(const struct igt_list_head *head) >>> bool igt_list_empty(const struct igt_list_head *head) >>> { >>> + /* Detect uninitialized / potentially broken list */ >>> + if (!head || !head->next || !head->prev) >>> + return true; >>> + >> >> Without this change: >> 1. Passing an uninitialized list is a bug >> 2. The function doesn't check any condition and returns 'normally' >> regardless >> >> With this change: >> 1. Passing an uninitialized list is a bug (still) >> 2. The function *may* detect an uninitialized list which is a bug but >> returns 'normally' regardless >> >> If we are adding a check that catches some invalid/buggy condition the >> reasonable thing to do would be to assert/abort. > > I agree with you. I would say that even more concerning is to distance > our implementation from the kernel implementation. I suggest we nack > this change. If you are ok with it Well either way is fine with by me. I just wanted to make a point that when we add a check that catches a bug it makes sense to alarm the developer right away. Regards, Christoph > > Nacked-by: Peter Senna Tschudin <peter.senna@linux.intel.com> > >> >> Regards, >> Christoph >> >> >>> return head->next == head; >>> } >> > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-09-23 9:32 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-09-22 16:23 [PATCH i-g-t] lib/igt_list: igt_list_empty() Detect uninitialized list Peter Senna Tschudin 2025-09-22 19:49 ` ✓ Xe.CI.BAT: success for " Patchwork 2025-09-22 19:56 ` ✗ i915.CI.BAT: failure " Patchwork 2025-09-23 1:16 ` ✓ Xe.CI.Full: success " Patchwork 2025-09-23 8:14 ` [PATCH i-g-t] " Manszewski, Christoph 2025-09-23 9:20 ` Peter Senna Tschudin 2025-09-23 9:32 ` Manszewski, Christoph
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox