Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

uio_hv_generic: Align ring size to system page

Following the ring header, the ring data should align to system page
boundary. Adjust the size if necessary.

Cc: stable@vger.kernel.org
Fixes: 95096f2fbd10 ("uio-hv-generic: new userspace i/o driver for VMBus")
Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/1746492997-4599-4-git-send-email-longli@linuxonhyperv.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1746492997-4599-4-git-send-email-longli@linuxonhyperv.com>

authored by

Long Li and committed by
Wei Liu
0315fef2 c951ab8f

+3
+3
drivers/uio/uio_hv_generic.c
··· 243 243 if (!ring_size) 244 244 ring_size = SZ_2M; 245 245 246 + /* Adjust ring size if necessary to have it page aligned */ 247 + ring_size = VMBUS_RING_SIZE(ring_size); 248 + 246 249 pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL); 247 250 if (!pdata) 248 251 return -ENOMEM;