public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests
Date: Wed, 13 Mar 2019 15:18:15 -0700	[thread overview]
Message-ID: <8a508da4-37f1-fcba-e81c-b6fe0d6a865b@intel.com> (raw)
In-Reply-To: <155242812120.30003.18128376671223213396@skylake-alporthouse-com>



On 12/03/19 15:02, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-03-12 21:57:36)
>> Add a couple of tests that supply invalid parameters to the mmap IOCTL.
>>
>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>> ---
>>   tests/i915/gem_mmap.c | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>>
>> diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
>> index 0ed15878..2a676b9a 100644
>> --- a/tests/i915/gem_mmap.c
>> +++ b/tests/i915/gem_mmap.c
>> @@ -136,6 +136,24 @@ igt_main
>>                  igt_assert(ret == -1 && errno == ENOENT);
>>          }
>>   
>> +       igt_subtest("bad-offset") {
>> +               memset(&arg, 0, sizeof(arg));
>> +               arg.handle = gem_create(fd, 4096);
>> +               arg.offset = 4096 + 1;
>> +               arg.size = 4096;
>> +               ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
>> +               igt_assert(ret == -1 && errno == EINVAL);
> 
> Also arg.offset = -size is a good one.
> 
> Then size=8192 and arg.offset=-4096;
> 
>> +       }
>> +
>> +       igt_subtest("bad-size") {
>> +               memset(&arg, 0, sizeof(arg));
>> +               arg.handle = gem_create(fd, 4096);
>> +               arg.offset = 4096;
>> +               arg.size = 0;
>> +               ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg);
>> +               igt_assert(ret == -1 && errno == EINVAL);
> 
> Also >4096, -4096

Hmmm, >4096 seems not to be returning an error. Where should it be 
checked against the size of the object?

Antonio

> -Chris
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-03-13 22:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test Antonio Argenziano
2019-03-12 22:04   ` Chris Wilson
2019-03-12 22:11     ` Antonio Argenziano
2019-03-12 22:18       ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests Antonio Argenziano
2019-03-12 22:02   ` Chris Wilson
2019-03-12 22:13     ` Antonio Argenziano
2019-03-13 22:18     ` Antonio Argenziano [this message]
2019-03-13 22:52       ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 3/4] tests/i915/gem_mmap_wc: Add invalid params tests Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test Antonio Argenziano
2019-03-12 22:07   ` Chris Wilson
2019-03-13 13:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Improve mmap interface coverage Patchwork
2019-03-13 16:12 ` [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=8a508da4-37f1-fcba-e81c-b6fe0d6a865b@intel.com \
    --to=antonio.argenziano@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