]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen/privcmd: allow fetching resource sizes
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 12 Jan 2021 11:53:58 +0000 (12:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jan 2021 14:57:55 +0000 (15:57 +0100)
commitac29c052654f5ccb92e83a06b36811e1afaa72ff
tree9ff7fc555c4a5287c49a5793e9842d68109c83ed
parentdd113b79ee7e837563321f626302a0ba7ee6c683
xen/privcmd: allow fetching resource sizes

commit ef3a575baf53571dc405ee4028e26f50856898e7 upstream.

Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and
addr = 0 in order to fetch the size of a specific resource.

Add a shortcut to the default map resource path, since fetching the
size requires no address to be passed in, and thus no VMA to setup.

This is missing from the initial implementation, and causes issues
when mapping resources that don't have fixed or known sizes.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: stable@vger.kernel.org # >= 4.18
Link: https://lore.kernel.org/r/20210112115358.23346-1-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/privcmd.c