It's not enough to check that arg < num_online_cpus() because cpu mask may be not contiguous. Thanks to AK for pointing out.
https://jira.sw.ru/browse/PSBM-60210 Signed-off-by: Maxim Patlasov <[email protected]> --- fs/fuse/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 8dd5154..216093d 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2273,7 +2273,7 @@ static long fuse_dev_ioctl(struct file *file, unsigned int cmd, } } } else if (cmd == FUSE_DEV_IOC_SETAFF) { - if (arg >= num_online_cpus()) { + if (arg >= NR_CPUS || !cpu_possible(arg)) { err = -EINVAL; } else { struct fuse_dev *fud = fuse_get_dev(file); _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
