From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH igt] lib/kms: Clear unused fields for getproperty ioctl
Date: Tue, 13 Feb 2018 17:49:07 +0200 [thread overview]
Message-ID: <20180213154907.GI5453@intel.com> (raw)
In-Reply-To: <20180213093040.17824-1-chris@chris-wilson.co.uk>
On Tue, Feb 13, 2018 at 09:30:40AM +0000, Chris Wilson wrote:
> ==24749== Syscall param ioctl(generic) points to uninitialised byte(s)
> ==24749== at 0x6A8ADC7: ioctl (syscall-template.S:84)
> ==24749== by 0x5067687: drmIoctl (in /opt/xorg/lib64/libdrm.so.2.4.0)
> ==24749== by 0x138531: kmstest_set_connector_dpms (igt_kms.c:1022)
> ==24749== by 0x112937: set_dpms (kms_flip.c:263)
> ==24749== by 0x112937: run_test_step (kms_flip.c:776)
> ==24749== by 0x112937: event_loop (kms_flip.c:1138)
> ==24749== by 0x115468: run_test_on_crtc_set (kms_flip.c:1378)
> ==24749== by 0x115468: run_test (kms_flip.c:1450)
> ==24749== by 0x1111CF: main (kms_flip.c:1673)
> ==24749== Address 0x1ffefff2a0 is on thread 1's stack
> ==24749== in frame #2, created by kmstest_set_connector_dpms (igt_kms.c:1012)
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Looks like all of the other fields are either stuff the kernel will
return to us, or ignored on account of the count_ stuff. So the kernel
doesn't seem to be missing any crucial input sanity checks.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> lib/igt_kms.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index eb57f4a9..ecc7a799 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1108,11 +1108,10 @@ void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode)
> bool found_it = false;
>
> for (i = 0; i < connector->count_props; i++) {
> - struct drm_mode_get_property prop;
> + struct drm_mode_get_property prop = {
> + .prop_id = connector->props[i],
> + };
>
> - prop.prop_id = connector->props[i];
> - prop.count_values = 0;
> - prop.count_enum_blobs = 0;
> if (drmIoctl(fd, DRM_IOCTL_MODE_GETPROPERTY, &prop))
> continue;
>
> --
> 2.16.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel OTC
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
prev parent reply other threads:[~2018-02-13 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 9:30 [igt-dev] [PATCH igt] lib/kms: Clear unused fields for getproperty ioctl Chris Wilson
2018-02-13 11:19 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-02-13 14:18 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
2018-02-13 15:49 ` Ville Syrjälä [this message]
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=20180213154907.GI5453@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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