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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212022048.7bUCw6kJ-lkp@intel.com>
Date:   Fri, 2 Dec 2022 20:33:08 +0800
From:   kernel test robot <lkp@...el.com>
To:     jeffxu@...omium.org, skhan@...uxfoundation.org,
        keescook@...omium.org
Cc:     oe-kbuild-all@...ts.linux.dev, akpm@...ux-foundation.org,
        dmitry.torokhov@...il.com, dverkamp@...omium.org, hughd@...gle.com,
        jeffxu@...gle.com, jorgelo@...omium.org,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-mm@...ck.org, mnissler@...omium.org, jannh@...gle.com,
        linux-hardening@...r.kernel.org, Jeff Xu <jeffxu@...omium.org>
Subject: Re: [PATCH v3] mm/memfd: security hook for memfd_create

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/jeffxu-chromium-org/mm-memfd-security-hook-for-memfd_create/20221202-094044
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20221202013404.163143-6-jeffxu%40google.com
patch subject: [PATCH v3] mm/memfd: security hook for memfd_create
config: i386-randconfig-a001
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/63daa2490ad1a865f02ff504c8c3fcd6fd72c0c3
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review jeffxu-chromium-org/mm-memfd-security-hook-for-memfd_create/20221202-094044
        git checkout 63daa2490ad1a865f02ff504c8c3fcd6fd72c0c3
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   ld: mm/memfd.o: in function `__do_sys_memfd_create':
>> mm/memfd.c:316: undefined reference to `security_memfd_create'


vim +316 mm/memfd.c

   265	
   266	SYSCALL_DEFINE2(memfd_create,
   267			const char __user *, uname,
   268			unsigned int, flags)
   269	{
   270		unsigned int *file_seals;
   271		struct file *file;
   272		int fd, error;
   273		char *name;
   274		long len;
   275	
   276		if (!(flags & MFD_HUGETLB)) {
   277			if (flags & ~(unsigned int)MFD_ALL_FLAGS)
   278				return -EINVAL;
   279		} else {
   280			/* Allow huge page size encoding in flags. */
   281			if (flags & ~(unsigned int)(MFD_ALL_FLAGS |
   282					(MFD_HUGE_MASK << MFD_HUGE_SHIFT)))
   283				return -EINVAL;
   284		}
   285	
   286		/* length includes terminating zero */
   287		len = strnlen_user(uname, MFD_NAME_MAX_LEN + 1);
   288		if (len <= 0)
   289			return -EFAULT;
   290		if (len > MFD_NAME_MAX_LEN + 1)
   291			return -EINVAL;
   292	
   293		name = kmalloc(len + MFD_NAME_PREFIX_LEN, GFP_KERNEL);
   294		if (!name)
   295			return -ENOMEM;
   296	
   297		strcpy(name, MFD_NAME_PREFIX);
   298		if (copy_from_user(&name[MFD_NAME_PREFIX_LEN], uname, len)) {
   299			error = -EFAULT;
   300			goto err_name;
   301		}
   302	
   303		/* terminating-zero may have changed after strnlen_user() returned */
   304		if (name[len + MFD_NAME_PREFIX_LEN - 1]) {
   305			error = -EFAULT;
   306			goto err_name;
   307		}
   308	
   309		fd = get_unused_fd_flags((flags & MFD_CLOEXEC) ? O_CLOEXEC : 0);
   310		if (fd < 0) {
   311			error = fd;
   312			goto err_name;
   313		}
   314	
   315		/* security hook for memfd_create */
 > 316		error = security_memfd_create(name, flags);

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (153047 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ