* [PATCH] drm/i915: silence coverity warning
@ 2017-11-02 11:41 Lionel Landwerlin
2017-11-02 12:06 ` Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Lionel Landwerlin @ 2017-11-02 11:41 UTC (permalink / raw)
To: intel-gfx; +Cc: Rodrigo Vivi
Because dev_priv is 0-ed it's not currently an issue, but since we
have dev_priv->perf.oa.test_config.uuid size at uuid + 1, we could
just copy the null character and silence this warning.
Detected by CoverityScan, CID#369632 ("Buffer not null terminated")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/i915_oa_bdw.c | 2 +-
drivers/gpu/drm/i915/i915_oa_bxt.c | 2 +-
drivers/gpu/drm/i915/i915_oa_cflgt2.c | 2 +-
drivers/gpu/drm/i915/i915_oa_chv.c | 2 +-
drivers/gpu/drm/i915/i915_oa_glk.c | 2 +-
drivers/gpu/drm/i915/i915_oa_hsw.c | 2 +-
drivers/gpu/drm/i915/i915_oa_kblgt2.c | 2 +-
drivers/gpu/drm/i915/i915_oa_kblgt3.c | 2 +-
drivers/gpu/drm/i915/i915_oa_sklgt2.c | 2 +-
drivers/gpu/drm/i915/i915_oa_sklgt3.c | 2 +-
drivers/gpu/drm/i915/i915_oa_sklgt4.c | 2 +-
11 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_oa_bdw.c b/drivers/gpu/drm/i915/i915_oa_bdw.c
index abdf4d0abcce..cdc6456dceeb 100644
--- a/drivers/gpu/drm/i915/i915_oa_bdw.c
+++ b/drivers/gpu/drm/i915/i915_oa_bdw.c
@@ -87,7 +87,7 @@ i915_perf_load_test_config_bdw(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"d6de6f55-e526-4f79-a6a6-d7315c09044e",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_bxt.c b/drivers/gpu/drm/i915/i915_oa_bxt.c
index b69b900de0fe..0abf71a08912 100644
--- a/drivers/gpu/drm/i915/i915_oa_bxt.c
+++ b/drivers/gpu/drm/i915/i915_oa_bxt.c
@@ -85,7 +85,7 @@ i915_perf_load_test_config_bxt(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"5ee72f5c-092f-421e-8b70-225f7c3e9612",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_cflgt2.c b/drivers/gpu/drm/i915/i915_oa_cflgt2.c
index 368c87d7ee9a..cdda100cdc4d 100644
--- a/drivers/gpu/drm/i915/i915_oa_cflgt2.c
+++ b/drivers/gpu/drm/i915/i915_oa_cflgt2.c
@@ -86,7 +86,7 @@ i915_perf_load_test_config_cflgt2(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"74fb4902-d3d3-4237-9e90-cbdc68d0a446",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_chv.c b/drivers/gpu/drm/i915/i915_oa_chv.c
index 322a3f94cd16..ce0975c2173d 100644
--- a/drivers/gpu/drm/i915/i915_oa_chv.c
+++ b/drivers/gpu/drm/i915/i915_oa_chv.c
@@ -86,7 +86,7 @@ i915_perf_load_test_config_chv(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"4a534b07-cba3-414d-8d60-874830e883aa",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_glk.c b/drivers/gpu/drm/i915/i915_oa_glk.c
index 4ee527e4c926..1c8d72495259 100644
--- a/drivers/gpu/drm/i915/i915_oa_glk.c
+++ b/drivers/gpu/drm/i915/i915_oa_glk.c
@@ -85,7 +85,7 @@ i915_perf_load_test_config_glk(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"dd3fd789-e783-4204-8cd0-b671bbccb0cf",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_hsw.c b/drivers/gpu/drm/i915/i915_oa_hsw.c
index 56b03773bb9d..b02430bf2eaa 100644
--- a/drivers/gpu/drm/i915/i915_oa_hsw.c
+++ b/drivers/gpu/drm/i915/i915_oa_hsw.c
@@ -115,7 +115,7 @@ i915_perf_load_test_config_hsw(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"403d8832-1a27-4aa6-a64e-f5389ce7b212",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_render_basic;
diff --git a/drivers/gpu/drm/i915/i915_oa_kblgt2.c b/drivers/gpu/drm/i915/i915_oa_kblgt2.c
index b6e7cc774136..ff01de704781 100644
--- a/drivers/gpu/drm/i915/i915_oa_kblgt2.c
+++ b/drivers/gpu/drm/i915/i915_oa_kblgt2.c
@@ -86,7 +86,7 @@ i915_perf_load_test_config_kblgt2(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"baa3c7e4-52b6-4b85-801e-465a94b746dd",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_kblgt3.c b/drivers/gpu/drm/i915/i915_oa_kblgt3.c
index 5576afdd9a7e..4ac014c2d685 100644
--- a/drivers/gpu/drm/i915/i915_oa_kblgt3.c
+++ b/drivers/gpu/drm/i915/i915_oa_kblgt3.c
@@ -86,7 +86,7 @@ i915_perf_load_test_config_kblgt3(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"f1792f32-6db2-4b50-b4b2-557128f1688d",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_sklgt2.c b/drivers/gpu/drm/i915/i915_oa_sklgt2.c
index 890d55879946..f74cd5b0b28c 100644
--- a/drivers/gpu/drm/i915/i915_oa_sklgt2.c
+++ b/drivers/gpu/drm/i915/i915_oa_sklgt2.c
@@ -85,7 +85,7 @@ i915_perf_load_test_config_sklgt2(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"1651949f-0ac0-4cb1-a06f-dafd74a407d1",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_sklgt3.c b/drivers/gpu/drm/i915/i915_oa_sklgt3.c
index 85e51addf86a..7f4812893846 100644
--- a/drivers/gpu/drm/i915/i915_oa_sklgt3.c
+++ b/drivers/gpu/drm/i915/i915_oa_sklgt3.c
@@ -86,7 +86,7 @@ i915_perf_load_test_config_sklgt3(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"2b985803-d3c9-4629-8a4f-634bfecba0e8",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_sklgt4.c b/drivers/gpu/drm/i915/i915_oa_sklgt4.c
index bce031ee4445..4487235be28e 100644
--- a/drivers/gpu/drm/i915/i915_oa_sklgt4.c
+++ b/drivers/gpu/drm/i915/i915_oa_sklgt4.c
@@ -86,7 +86,7 @@ i915_perf_load_test_config_sklgt4(struct drm_i915_private *dev_priv)
{
strncpy(dev_priv->perf.oa.test_config.uuid,
"882fa433-1f4a-4a67-a962-c741888fe5f5",
- UUID_STRING_LEN);
+ sizeof(dev_priv->perf.oa.test_config.uuid));
dev_priv->perf.oa.test_config.id = 1;
dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
--
2.15.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: silence coverity warning
2017-11-02 11:41 [PATCH] drm/i915: silence coverity warning Lionel Landwerlin
@ 2017-11-02 12:06 ` Chris Wilson
2017-11-02 13:22 ` Ville Syrjälä
2017-11-02 12:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-02 13:11 ` ✗ Fi.CI.IGT: warning " Patchwork
2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2017-11-02 12:06 UTC (permalink / raw)
To: Lionel Landwerlin, intel-gfx; +Cc: Rodrigo Vivi
Quoting Lionel Landwerlin (2017-11-02 11:41:26)
> Because dev_priv is 0-ed it's not currently an issue, but since we
> have dev_priv->perf.oa.test_config.uuid size at uuid + 1, we could
> just copy the null character and silence this warning.
It doesn't copy the nul over exactly, to be complete s/strncpy/strlcpy/
as well.
That should prevent even the simplest of static checkers from warning.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: silence coverity warning
2017-11-02 11:41 [PATCH] drm/i915: silence coverity warning Lionel Landwerlin
2017-11-02 12:06 ` Chris Wilson
@ 2017-11-02 12:18 ` Patchwork
2017-11-02 13:11 ` ✗ Fi.CI.IGT: warning " Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-11-02 12:18 UTC (permalink / raw)
To: Lionel Landwerlin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: silence coverity warning
URL : https://patchwork.freedesktop.org/series/33041/
State : success
== Summary ==
Series 33041v1 drm/i915: silence coverity warning
https://patchwork.freedesktop.org/api/1.0/series/33041/revisions/1/mbox/
Test gem_exec_reloc:
Subgroup basic-cpu-active:
fail -> PASS (fi-gdg-551) fdo#102582 +1
Test kms_flip:
Subgroup basic-flip-vs-dpms:
incomplete -> PASS (fi-cnl-y) fdo#103339
Test kms_frontbuffer_tracking:
Subgroup basic:
dmesg-warn -> PASS (fi-bdw-5557u) fdo#102473
Test kms_pipe_crc_basic:
Subgroup nonblocking-crc-pipe-a-frame-sequence:
notrun -> INCOMPLETE (fi-cnl-y)
Test drv_module_reload:
Subgroup basic-reload:
pass -> DMESG-WARN (fi-bsw-n3050) fdo#103479
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#103339 https://bugs.freedesktop.org/show_bug.cgi?id=103339
fdo#102473 https://bugs.freedesktop.org/show_bug.cgi?id=102473
fdo#103479 https://bugs.freedesktop.org/show_bug.cgi?id=103479
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:444s
fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:454s
fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:379s
fi-bsw-n3050 total:289 pass:242 dwarn:1 dfail:0 fail:0 skip:46 time:533s
fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:277s
fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:509s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:509s
fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:0 skip:35 time:512s
fi-byt-n2820 total:289 pass:249 dwarn:1 dfail:0 fail:0 skip:39 time:498s
fi-cfl-s total:289 pass:253 dwarn:4 dfail:0 fail:0 skip:32 time:555s
fi-cnl-y total:289 pass:209 dwarn:0 dfail:0 fail:0 skip:24
fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:426s
fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:264s
fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:589s
fi-glk-dsi total:289 pass:258 dwarn:0 dfail:0 fail:1 skip:30 time:496s
fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:432s
fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:431s
fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:434s
fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:501s
fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:467s
fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:495s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:576s
fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:477s
fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:591s
fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:583s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:450s
fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:595s
fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:650s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:524s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:500s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:473s
fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:573s
fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:431s
dcf7d008f606b543fef53609a6e336097e6b5694 drm-tip: 2017y-11m-02d-08h-43m-13s UTC integration manifest
9e2e9351534b drm/i915: silence coverity warning
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6923/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✗ Fi.CI.IGT: warning for drm/i915: silence coverity warning
2017-11-02 11:41 [PATCH] drm/i915: silence coverity warning Lionel Landwerlin
2017-11-02 12:06 ` Chris Wilson
2017-11-02 12:18 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-11-02 13:11 ` Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-11-02 13:11 UTC (permalink / raw)
To: Lionel Landwerlin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: silence coverity warning
URL : https://patchwork.freedesktop.org/series/33041/
State : warning
== Summary ==
Test kms_setmode:
Subgroup basic:
fail -> PASS (shard-hsw) fdo#99912
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-primscrn-cur-indfb-draw-mmap-cpu:
pass -> SKIP (shard-hsw)
Subgroup fbc-1p-primscrn-cur-indfb-draw-blt:
skip -> PASS (shard-hsw)
Subgroup fbc-1p-primscrn-pri-shrfb-draw-blt:
skip -> PASS (shard-hsw)
Test kms_atomic_transition:
Subgroup plane-all-transition-fencing:
skip -> PASS (shard-hsw)
Subgroup plane-all-modeset-transition:
skip -> PASS (shard-hsw)
Test kms_flip:
Subgroup wf_vblank-vs-dpms-interruptible:
skip -> PASS (shard-hsw) fdo#102614
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
shard-hsw total:2539 pass:1431 dwarn:2 dfail:0 fail:8 skip:1098 time:9252s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6923/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: silence coverity warning
2017-11-02 12:06 ` Chris Wilson
@ 2017-11-02 13:22 ` Ville Syrjälä
2017-11-02 13:38 ` Chris Wilson
0 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2017-11-02 13:22 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx, Rodrigo Vivi
On Thu, Nov 02, 2017 at 12:06:27PM +0000, Chris Wilson wrote:
> Quoting Lionel Landwerlin (2017-11-02 11:41:26)
> > Because dev_priv is 0-ed it's not currently an issue, but since we
> > have dev_priv->perf.oa.test_config.uuid size at uuid + 1, we could
> > just copy the null character and silence this warning.
>
> It doesn't copy the nul over exactly, to be complete s/strncpy/strlcpy/
> as well.
Or just memcpy(), thugh maybe that'd be more dangerous if the size
gets changed for some reasonn.
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: silence coverity warning
2017-11-02 13:22 ` Ville Syrjälä
@ 2017-11-02 13:38 ` Chris Wilson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2017-11-02 13:38 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx, Rodrigo Vivi
Quoting Ville Syrjälä (2017-11-02 13:22:51)
> On Thu, Nov 02, 2017 at 12:06:27PM +0000, Chris Wilson wrote:
> > Quoting Lionel Landwerlin (2017-11-02 11:41:26)
> > > Because dev_priv is 0-ed it's not currently an issue, but since we
> > > have dev_priv->perf.oa.test_config.uuid size at uuid + 1, we could
> > > just copy the null character and silence this warning.
> >
> > It doesn't copy the nul over exactly, to be complete s/strncpy/strlcpy/
> > as well.
>
> Or just memcpy(), thugh maybe that'd be more dangerous if the size
> gets changed for some reasonn.
struct uuid { char [UUID_STRING_LEN+1]; }
test_config.uuid = (struct uuid) { "aaaa-bbbb-cccc-dddd" };
?
The compiler should then warn if it wants to about the string being the
wrong size; anything too short is nul-extended.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-11-02 13:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 11:41 [PATCH] drm/i915: silence coverity warning Lionel Landwerlin
2017-11-02 12:06 ` Chris Wilson
2017-11-02 13:22 ` Ville Syrjälä
2017-11-02 13:38 ` Chris Wilson
2017-11-02 12:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-02 13:11 ` ✗ Fi.CI.IGT: warning " Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.