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>] [day] [month] [year] [list]
Date:   Mon, 10 Jul 2023 12:02:28 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     lilinke99@...il.com
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hugetlbfs: Fix integer overflow check in
  hugetlbfs_file_mmap()

> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -157,7 +157,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
>  	vma_len = (loff_t)(vma->vm_end - vma->vm_start);
>  	len = vma_len + ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
>  	/* check for overflow */
> -	if (len < vma_len)
> +	if (vma_len > LLONG_MAX - ((loff_t)vma->vm_pgoff << PAGE_SHIFT))
>  		return -EINVAL;

Proper fix is to make everything unsigned probably.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ