[igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 13 22:52:59 UTC 2019


Quoting Antonio Argenziano (2019-03-13 22:18:15)
> 
> 
> On 12/03/19 15:02, Chris Wilson wrote:
> > Quoting Antonio Argenziano (2019-03-12 21:57:36)
> >> +       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?

vm_mmap() should be reporting an error if args->offset + arg->size
overflow. Or at least that is what we assumed.
-Chris


More information about the igt-dev mailing list