From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data
Date: Wed, 16 Jan 2019 13:20:36 +0200 [thread overview]
Message-ID: <20190116112050.27647-8-petri.latvala@intel.com> (raw)
In-Reply-To: <20190116112050.27647-1-petri.latvala@intel.com>
The code assumes (correctly) that perf_event_header's size is
non-zero. Write that out so static analysis also knows it.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
overlay/gpu-perf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c
index 5629f826..7addd78d 100644
--- a/overlay/gpu-perf.c
+++ b/overlay/gpu-perf.c
@@ -494,6 +494,7 @@ int gpu_perf_update(struct gpu_perf *gp)
const struct perf_event_header *header;
header = (const struct perf_event_header *)(data + (tail & mask));
+ assert(header->size > 0);
if (header->size > head - tail)
break;
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-01-16 11:21 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
2019-01-16 14:26 ` Chris Wilson
2019-01-18 10:34 ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-21 11:33 ` [igt-dev] [PATCH i-g-t v3 01/21] lib: Introduce BUILD_BUG_ON_INVALID and igt_assume() Petri Latvala
2019-01-21 11:41 ` Chris Wilson
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
2019-01-16 11:30 ` Chris Wilson
2019-01-16 14:22 ` Chris Wilson
2019-01-18 10:42 ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 03/21] lib/ioctl_wrappers: " Petri Latvala
2019-01-18 10:42 ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc Petri Latvala
2019-01-17 9:55 ` Abdiel Janulgue
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 05/21] tests: " Petri Latvala
2019-01-16 11:28 ` Kahola, Mika
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL Petri Latvala
2019-01-17 11:14 ` Arkadiusz Hiler
2019-01-16 11:20 ` Petri Latvala [this message]
2019-01-28 13:21 ` [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error Petri Latvala
2019-01-16 11:45 ` Tvrtko Ursulin
2019-01-16 12:03 ` Petri Latvala
2019-01-16 12:07 ` Chris Wilson
2019-01-16 12:08 ` Tvrtko Ursulin
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane Petri Latvala
2019-01-16 17:11 ` Robert Foss
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes Petri Latvala
2019-01-28 13:04 ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane Petri Latvala
2019-01-16 11:30 ` Kahola, Mika
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory Petri Latvala
2019-01-16 11:48 ` Tvrtko Ursulin
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment Petri Latvala
2019-01-16 14:14 ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect() Petri Latvala
2019-01-16 14:16 ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully Petri Latvala
2019-01-28 13:18 ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present Petri Latvala
2019-01-17 12:17 ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc Petri Latvala
2019-01-16 14:18 ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet Petri Latvala
2019-01-17 9:56 ` Abdiel Janulgue
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow Petri Latvala
2019-01-28 13:17 ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis Petri Latvala
2019-01-28 13:11 ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver Petri Latvala
2019-01-16 12:15 ` Rodrigo Siqueira
2019-01-16 12:12 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes Patchwork
2019-01-16 22:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-18 11:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for Static analysis: misc cleanups and fixes (rev4) Patchwork
2019-01-18 12:44 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-01-18 17:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-21 12:09 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes (rev5) Patchwork
2019-01-21 16:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190116112050.27647-8-petri.latvala@intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox