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: <202405072249.fLkavX40-lkp@intel.com>
Date: Tue, 7 May 2024 23:11:33 +0800
From: kernel test robot <lkp@...el.com>
To: Allen Pais <apais@...ux.microsoft.com>, linux-fsdevel@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, viro@...iv.linux.org.uk, brauner@...nel.org,
	jack@...e.cz, ebiederm@...ssion.com, keescook@...omium.org,
	mcgrof@...nel.org, j.granados@...sung.com, allen.lkml@...il.com
Subject: Re: [PATCH v4] fs/coredump: Enable dynamic configuration of max file
 note size

Hi Allen,

kernel test robot noticed the following build errors:

[auto build test ERROR on kees/for-next/execve]
[also build test ERROR on brauner-vfs/vfs.all linus/master v6.9-rc7 next-20240507]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Allen-Pais/fs-coredump-Enable-dynamic-configuration-of-max-file-note-size/20240507-033907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
patch link:    https://lore.kernel.org/r/20240506193700.7884-1-apais%40linux.microsoft.com
patch subject: [PATCH v4] fs/coredump: Enable dynamic configuration of max file note size
config: loongarch-randconfig-001-20240507 (https://download.01.org/0day-ci/archive/20240507/202405072249.fLkavX40-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240507/202405072249.fLkavX40-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405072249.fLkavX40-lkp@intel.com/

All errors (new ones prefixed by >>):

   fs/binfmt_elf.c: In function 'fill_files_note':
>> fs/binfmt_elf.c:1598:21: error: 'core_file_note_size_min' undeclared (first use in this function)
    1598 |         if (size >= core_file_note_size_min) {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~
   fs/binfmt_elf.c:1598:21: note: each undeclared identifier is reported only once for each function it appears in


vim +/core_file_note_size_min +1598 fs/binfmt_elf.c

  1569	
  1570	/*
  1571	 * Format of NT_FILE note:
  1572	 *
  1573	 * long count     -- how many files are mapped
  1574	 * long page_size -- units for file_ofs
  1575	 * array of [COUNT] elements of
  1576	 *   long start
  1577	 *   long end
  1578	 *   long file_ofs
  1579	 * followed by COUNT filenames in ASCII: "FILE1" NUL "FILE2" NUL...
  1580	 */
  1581	static int fill_files_note(struct memelfnote *note, struct coredump_params *cprm)
  1582	{
  1583		unsigned count, size, names_ofs, remaining, n;
  1584		user_long_t *data;
  1585		user_long_t *start_end_ofs;
  1586		char *name_base, *name_curpos;
  1587		int i;
  1588	
  1589		/* *Estimated* file count and total data size needed */
  1590		count = cprm->vma_count;
  1591		if (count > UINT_MAX / 64)
  1592			return -EINVAL;
  1593		size = count * 64;
  1594	
  1595		names_ofs = (2 + 3 * count) * sizeof(data[0]);
  1596	 alloc:
  1597		/* paranoia check */
> 1598		if (size >= core_file_note_size_min) {
  1599			pr_warn_once("coredump Note size too large: %u (does kernel.core_file_note_size_min sysctl need adjustment?\n",
  1600				      size);
  1601			return -EINVAL;
  1602		}
  1603		size = round_up(size, PAGE_SIZE);
  1604		/*
  1605		 * "size" can be 0 here legitimately.
  1606		 * Let it ENOMEM and omit NT_FILE section which will be empty anyway.
  1607		 */
  1608		data = kvmalloc(size, GFP_KERNEL);
  1609		if (ZERO_OR_NULL_PTR(data))
  1610			return -ENOMEM;
  1611	
  1612		start_end_ofs = data + 2;
  1613		name_base = name_curpos = ((char *)data) + names_ofs;
  1614		remaining = size - names_ofs;
  1615		count = 0;
  1616		for (i = 0; i < cprm->vma_count; i++) {
  1617			struct core_vma_metadata *m = &cprm->vma_meta[i];
  1618			struct file *file;
  1619			const char *filename;
  1620	
  1621			file = m->file;
  1622			if (!file)
  1623				continue;
  1624			filename = file_path(file, name_curpos, remaining);
  1625			if (IS_ERR(filename)) {
  1626				if (PTR_ERR(filename) == -ENAMETOOLONG) {
  1627					kvfree(data);
  1628					size = size * 5 / 4;
  1629					goto alloc;
  1630				}
  1631				continue;
  1632			}
  1633	
  1634			/* file_path() fills at the end, move name down */
  1635			/* n = strlen(filename) + 1: */
  1636			n = (name_curpos + remaining) - filename;
  1637			remaining = filename - name_curpos;
  1638			memmove(name_curpos, filename, n);
  1639			name_curpos += n;
  1640	
  1641			*start_end_ofs++ = m->start;
  1642			*start_end_ofs++ = m->end;
  1643			*start_end_ofs++ = m->pgoff;
  1644			count++;
  1645		}
  1646	
  1647		/* Now we know exact count of files, can store it */
  1648		data[0] = count;
  1649		data[1] = PAGE_SIZE;
  1650		/*
  1651		 * Count usually is less than mm->map_count,
  1652		 * we need to move filenames down.
  1653		 */
  1654		n = cprm->vma_count - count;
  1655		if (n != 0) {
  1656			unsigned shift_bytes = n * 3 * sizeof(data[0]);
  1657			memmove(name_base - shift_bytes, name_base,
  1658				name_curpos - name_base);
  1659			name_curpos -= shift_bytes;
  1660		}
  1661	
  1662		size = name_curpos - (char *)data;
  1663		fill_note(note, "CORE", NT_FILE, size, data);
  1664		return 0;
  1665	}
  1666	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ