diff --git a/fs/verity/enable.c b/fs/verity/enable.c index 078d2fde21e49fcb74ce29a426f342d34d990219..4412f3f1b2967b04dad427d81c6d0530a8496465 100644 --- a/fs/verity/enable.c +++ b/fs/verity/enable.c @@ -630,8 +630,9 @@ int fsverity_ioctl_enable_code_sign(struct file *filp, const void __user *uarg) if (arg.sig_size > FS_VERITY_MAX_SIGNATURE_SIZE) return -EMSGSIZE; - - if (arg.pgtypeinfo_off > arg.data_size - arg.pgtypeinfo_size) + + // when calc pgtypeinfo_size trans bit size to byte size + if (arg.pgtypeinfo_off > arg.data_size - arg.pgtypeinfo_size / 8) return -EINVAL; return check_file_and_enable_verity(filp, (struct fsverity_enable_arg *)&arg);