lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <BN7PR02MB414865017BF8B21B20908559D4BA2@BN7PR02MB4148.namprd02.prod.outlook.com>
Date: Wed, 23 Apr 2025 20:07:05 +0000
From: Michael Kelley <mhklinux@...look.com>
To: Long Li <longli@...rosoft.com>, "longli@...uxonhyperv.com"
	<longli@...uxonhyperv.com>, KY Srinivasan <kys@...rosoft.com>, Haiyang Zhang
	<haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, Dexuan Cui
	<decui@...rosoft.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH 2/2] uio_hv_generic: Use correct size for interrupt and
 monitor pages

From: Long Li <longli@...rosoft.com> Sent: Wednesday, April 23, 2025 11:49 AM
> > >
> > > Interrupt and monitor pages should be in Hyper-V page size (4k bytes).
> > > This can be different to the system page size.
> >
> > I'm curious about this change. Since Patch 1 of the series changes the allocations
> > to be the full PAGE_SIZE, what does it mean to set the mapping size to less than a
> > full page (in the case PAGE_SIZE > HV_HYP_PAGE_SIZE)? mmap can only map full
> > PAGE_SIZE pages, so uio_mmap() rounds up the INT_PAGE_MAP and
> > MON_PAGE_MAP sizes to PAGE_SIZE when checking the validity of the mmap
> > parameters.
> >
> > The changes in this patch do ensure that the INT_PAGE_MAP and
> > MON_PAGE_MAP "maps" entries in sysfs always show the size as
> > 4096 even if the full PAGE_SIZE is actually mapped, but I'm not sure if that
> > difference is good or bad.
> 
> Kernel needs to tell the user-mode the correct length of the map. In this case, 4096
> bytes are usable data regardless of what is actual mapped as long as it's >4096.
> 
> The DPDK vmbus driver uses this length to setup checks for accessing the page.

OK, so the "maps" entry needs to show a size of 4096 so the DPDK VMBus
driver does the right thing.

At a minimum, mention in the commit message that the reason for the change
is to always show 4096 as the size of the "maps" entries, even if PAGE_SIZE
and the actual mapped area is larger. Perhaps also mention that the DPDK
VMBus driver is one known consumer of that detail.

Michael

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ