Re: fs/hugetlbfs/inode.c:1467 hugetlb_file_setup() error: potentially dereferencing uninitialized 'ucounts'.

From: Mike Kravetz
Date: Fri Nov 05 2021 - 12:47:59 EST


On 11/5/21 6:27 AM, Dan Carpenter wrote:
> tree: https://github.com/0day-ci/linux/commits/UPDATE-20211101-211012/zhangyiru/mm-hugetlb-remove-mlock-ulimit-for-SHM_HUGETLB/20211009-094538
> head: 52edddc18d9541ad72912b32edd74baacc94d504
> commit: 52edddc18d9541ad72912b32edd74baacc94d504 mm,hugetlb: remove mlock ulimit for SHM_HUGETLB
> config: i386-randconfig-m021-20211101 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> New smatch warnings:
> fs/hugetlbfs/inode.c:1467 hugetlb_file_setup() error: potentially dereferencing uninitialized 'ucounts'.
>
> Old smatch warnings:
> fs/hugetlbfs/inode.c:1498 hugetlb_file_setup() error: potentially dereferencing uninitialized 'ucounts'.
>
> vim +/ucounts +1467 fs/hugetlbfs/inode.c

Thanks Dan,

There is an updated version of this patch in Andrew's tree that should
address this issue.
--
Mike Kravetz