All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address)
@ 2020-09-03  9:35 Tony.LI
  2020-09-03  9:37 ` [Bug 1894071] " Tony.LI
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-03  9:35 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
First I added some ioctl operations.
Then I tried to do some DRM operations like test.c.
This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
I can get some strace info like this:

403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
403 brk(NULL) = 0x40006000
403 brk(0x40027000) = 0x40027000
403 brk(0x40028000) = 0x40028000
403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

And there are similar errors in other self driven operations.
I want to know if it is QEMU's problem, so I hope to get some help. 
Thank you!

** Affects: qemu
     Importance: Undecided
         Status: New

** Attachment added: "strace.txt"
   https://bugs.launchpad.net/bugs/1894071/+attachment/5407366/+files/strace.txt

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
@ 2020-09-03  9:37 ` Tony.LI
  2020-09-03  9:38 ` Tony.LI
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-03  9:37 UTC (permalink / raw)
  To: qemu-devel

** Attachment added: "modeset.c"
   https://bugs.launchpad.net/qemu/+bug/1894071/+attachment/5407367/+files/modeset.c

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
  2020-09-03  9:37 ` [Bug 1894071] " Tony.LI
@ 2020-09-03  9:38 ` Tony.LI
  2020-09-03  9:38 ` Tony.LI
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-03  9:38 UTC (permalink / raw)
  To: qemu-devel

** Attachment added: "ioctls.h"
   https://bugs.launchpad.net/qemu/+bug/1894071/+attachment/5407368/+files/ioctls.h

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
  2020-09-03  9:37 ` [Bug 1894071] " Tony.LI
  2020-09-03  9:38 ` Tony.LI
@ 2020-09-03  9:38 ` Tony.LI
  2020-09-03  9:38 ` Tony.LI
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-03  9:38 UTC (permalink / raw)
  To: qemu-devel

** Attachment added: "syscall_defs.h"
   https://bugs.launchpad.net/qemu/+bug/1894071/+attachment/5407369/+files/syscall_defs.h

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (2 preceding siblings ...)
  2020-09-03  9:38 ` Tony.LI
@ 2020-09-03  9:38 ` Tony.LI
  2020-09-03  9:42 ` Tony.LI
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-03  9:38 UTC (permalink / raw)
  To: qemu-devel

** Attachment added: "syscall_types.h"
   https://bugs.launchpad.net/qemu/+bug/1894071/+attachment/5407370/+files/syscall_types.h

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (3 preceding siblings ...)
  2020-09-03  9:38 ` Tony.LI
@ 2020-09-03  9:42 ` Tony.LI
  2020-09-03  9:47 ` Tony.LI
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-03  9:42 UTC (permalink / raw)
  To: qemu-devel

This problem has bothered me for a long time, but I'm not sure whether
it's the IOCTL () I added or the QEMU with 32 bits. I hope we can
discuss it and help our friends who have other problems.

Thank you,my friends!

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (4 preceding siblings ...)
  2020-09-03  9:42 ` Tony.LI
@ 2020-09-03  9:47 ` Tony.LI
  2020-09-03 10:00 ` Laurent Vivier
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-03  9:47 UTC (permalink / raw)
  To: qemu-devel

My environment is that:
schroot + debian(bullseye-i386)
qemu: 5.1.0-rc3

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (5 preceding siblings ...)
  2020-09-03  9:47 ` Tony.LI
@ 2020-09-03 10:00 ` Laurent Vivier
  2020-09-04  3:51 ` Tony.LI
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Laurent Vivier @ 2020-09-03 10:00 UTC (permalink / raw)
  To: qemu-devel

Please, send your patches to the QEMU devel mailing list, so we can
review them and comment.

https://wiki.qemu.org/Contribute/SubmitAPatch

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (6 preceding siblings ...)
  2020-09-03 10:00 ` Laurent Vivier
@ 2020-09-04  3:51 ` Tony.LI
  2020-09-04  9:36 ` Tony.LI
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-04  3:51 UTC (permalink / raw)
  To: qemu-devel

Hi,I found some problems, but I don't know if how to solve it better(I'm
not really familiar with the source code).

When I use ioctl() and use a structure like this:

struct drm_mode_card_res {
        __u64 fb_id_ptr;
        __u64 crtc_id_ptr;
        __u64 connector_id_ptr;
        __u64 encoder_id_ptr;
        __u32 count_fbs;
        ....
};

Look,"fb_id_ptr" is a pointer,and apply for memory allocation through malloc.But I use qemu-i386 on 64 bit ARM.As a result, my pointer has no problem in QEMU, but it is wrong when I use ioctl(bad address).This address is actually an address in QEMU, but it is not the correct address in a 64 bit machine.
Is there any better way to solve this problem?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (7 preceding siblings ...)
  2020-09-04  3:51 ` Tony.LI
@ 2020-09-04  9:36 ` Tony.LI
  2020-09-04 14:33 ` Laurent Vivier
  2020-09-05 11:07 ` Thomas Huth
  10 siblings, 0 replies; 12+ messages in thread
From: Tony.LI @ 2020-09-04  9:36 UTC (permalink / raw)
  To: qemu-devel

Hi,I found some problems, but I don't know if how to solve it better(I'm
not really familiar with the source code).

When I use ioctl() and use a structure like this:

struct drm_mode_card_res {
        __u64 fb_id_ptr;
        __u64 crtc_id_ptr;
        __u64 connector_id_ptr;
        __u64 encoder_id_ptr;
        __u32 count_fbs;
        ....
};
And in syscall_types.h
STRUCT(drm_mode_card_res,
        TYPE_PTRVOID,
        TYPE_PTRVOID,
        TYPE_PTRVOID,
        TYPE_PTRVOID,
        TYPE_INT,
        ...
        )
Some code:
        ...
	if (res.count_fbs) {
		res.fb_id_ptr = VOID2U64(drmMalloc(res.count_fbs*sizeof(uint32_t)));
		if (!res.fb_id_ptr)
			goto err_allocs;
	}
        ...

This is strace:
openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
9469 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
9469 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0x0,0x0,0x0,0x0,0,0,0,0,0,0,0,0}) = 0 ({0x0,0x0,0x0,0x0,0,2,2,2,0,16384,0,16384})
9469 brk(NULL) = 0x40006000
9469 brk(0x40027000) = 0x40027000
9469 brk(0x40028000) = 0x40028000
9469 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0x0,0x0,0x400061a0,0x0,0,2,1073832368,0,0,16384,0,16384}) = -1 errno=14 (Bad address)
9469 brk(0x40027000) = 0x40027000

Look
9469 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0x0,0x0,0x400061a0,0x0,0,2,1073832368,0,0,16384,0,16384}) = -1 errno=14 (Bad address)

Why does memory overrun occur here???
I think this is right:
{0x0,0x400061a0,1073832368(0x400061a0),0x400061c0,0,2,2,2,0,16384,0,16384}

Who can help me? Thank you!

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (8 preceding siblings ...)
  2020-09-04  9:36 ` Tony.LI
@ 2020-09-04 14:33 ` Laurent Vivier
  2020-09-05 11:07 ` Thomas Huth
  10 siblings, 0 replies; 12+ messages in thread
From: Laurent Vivier @ 2020-09-04 14:33 UTC (permalink / raw)
  To: qemu-devel

You need to use IOCTL_SPECIAL() or STRUCT_SPECIAL() macro to convert the
target address to the host address.

Again, share your patches on the qemu-devel mailing list if you want
help.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  New

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug 1894071] Re: qemu-i386-static ioctl return -14 (Bad Address)
  2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
                   ` (9 preceding siblings ...)
  2020-09-04 14:33 ` Laurent Vivier
@ 2020-09-05 11:07 ` Thomas Huth
  10 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2020-09-05 11:07 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Invalid

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1894071

Title:
  qemu-i386-static ioctl return -14 (Bad Address)

Status in QEMU:
  Invalid

Bug description:
  I use qemu-i386-static on 64 bit ARM.But I don't know how to solve some problems.
  First I added some ioctl operations.
  Then I tried to do some DRM operations like test.c.
  This is successful when I use qemu-x86_64-static,but it failed when I use qemu-i386-static.
  I can get some strace info like this:

  403 openat(AT_FDCWD,"/dev/dri/card0",O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4
  403 ioctl(4,DRM_IOCTL_GET_CAP,{1,0}) = 0 ({1,1})
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,0,0,0,0,0,0,0,0,0,0,0}) = 0 ({0,0,0,0,0,2,2,2,0,16384,0,16384})
  403 brk(NULL) = 0x40006000
  403 brk(0x40027000) = 0x40027000
  403 brk(0x40028000) = 0x40028000
  403 ioctl(4,DRM_IOCTL_MODE_GETRESOURCES,{0,1073766816,1073766832,1073766848,0,2,2,2,0,16384,0,16384}) = -1 errno=14 (Bad address)

  And there are similar errors in other self driven operations.
  I want to know if it is QEMU's problem, so I hope to get some help. 
  Thank you!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1894071/+subscriptions


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-09-05 11:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03  9:35 [Bug 1894071] [NEW] qemu-i386-static ioctl return -14 (Bad Address) Tony.LI
2020-09-03  9:37 ` [Bug 1894071] " Tony.LI
2020-09-03  9:38 ` Tony.LI
2020-09-03  9:38 ` Tony.LI
2020-09-03  9:38 ` Tony.LI
2020-09-03  9:42 ` Tony.LI
2020-09-03  9:47 ` Tony.LI
2020-09-03 10:00 ` Laurent Vivier
2020-09-04  3:51 ` Tony.LI
2020-09-04  9:36 ` Tony.LI
2020-09-04 14:33 ` Laurent Vivier
2020-09-05 11:07 ` Thomas Huth

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.