git: aeda536e7172 - stable/13 - cuse(3): Fix an off-by-one.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Jul 2022 09:36:45 UTC
The branch stable/13 has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=aeda536e71727cfdf87f7a18dc1d5d148d2e09ff
commit aeda536e71727cfdf87f7a18dc1d5d148d2e09ff
Author: Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-07-13 13:53:49 +0000
Commit: Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-07-27 09:33:47 +0000
cuse(3): Fix an off-by-one.
The page allocation limit is inclusive and not exclusive.
Sponsored by: NVIDIA Networking
(cherry picked from commit 0996dd7df688921bd41b255e4cdcc155fda8461a)
---
sys/fs/cuse/cuse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c
index 7c7d8ec20493..5a0d0263738e 100644
--- a/sys/fs/cuse/cuse.c
+++ b/sys/fs/cuse/cuse.c
@@ -1159,7 +1159,7 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd,
error = ENOMEM;
break;
}
- if (pai->page_count >= CUSE_ALLOC_PAGES_MAX) {
+ if (pai->page_count > CUSE_ALLOC_PAGES_MAX) {
error = ENOMEM;
break;
}