linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Dima Krasner <dima@dimakrasner.com>
Cc: kbuild-all@01.org, dima@dimakrasner.com, linux-mm@kvack.org,
	Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH] mm: do not grant +x by default in memfd_create()
Date: Sun, 5 May 2019 07:37:13 +0800	[thread overview]
Message-ID: <201905050757.M2Q7kM1M%lkp@intel.com> (raw)
In-Reply-To: <20190504114140.32082-1-dima@dimakrasner.com>

[-- Attachment #1: Type: text/plain, Size: 5300 bytes --]

Hi Dima,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.1-rc7 next-20190503]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Dima-Krasner/mm-do-not-grant-x-by-default-in-memfd_create/20190505-060301
config: i386-randconfig-x070-201918 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   mm/memfd.c: In function '__do_sys_memfd_create':
>> mm/memfd.c:300:10: error: too many arguments to function 'hugetlb_file_setup'
      file = hugetlb_file_setup(name, 0, VM_NORESERVE, &user,
             ^~~~~~~~~~~~~~~~~~
   In file included from mm/memfd.c:18:0:
   include/linux/hugetlb.h:326:1: note: declared here
    hugetlb_file_setup(const char *name, size_t size, vm_flags_t acctflag,
    ^~~~~~~~~~~~~~~~~~
--
   ipc/shm.c: In function 'newseg':
>> ipc/shm.c:652:10: error: too many arguments to function 'hugetlb_file_setup'
      file = hugetlb_file_setup(name, hugesize, acctflag,
             ^~~~~~~~~~~~~~~~~~
   In file included from ipc/shm.c:30:0:
   include/linux/hugetlb.h:326:1: note: declared here
    hugetlb_file_setup(const char *name, size_t size, vm_flags_t acctflag,
    ^~~~~~~~~~~~~~~~~~

vim +/hugetlb_file_setup +300 mm/memfd.c

5d752600 Mike Kravetz 2018-06-07  247  
5d752600 Mike Kravetz 2018-06-07  248  SYSCALL_DEFINE2(memfd_create,
5d752600 Mike Kravetz 2018-06-07  249  		const char __user *, uname,
5d752600 Mike Kravetz 2018-06-07  250  		unsigned int, flags)
5d752600 Mike Kravetz 2018-06-07  251  {
5d752600 Mike Kravetz 2018-06-07  252  	unsigned int *file_seals;
5d752600 Mike Kravetz 2018-06-07  253  	struct file *file;
5d752600 Mike Kravetz 2018-06-07  254  	int fd, error;
5d752600 Mike Kravetz 2018-06-07  255  	char *name;
5d752600 Mike Kravetz 2018-06-07  256  	long len;
5d752600 Mike Kravetz 2018-06-07  257  
5d752600 Mike Kravetz 2018-06-07  258  	if (!(flags & MFD_HUGETLB)) {
5d752600 Mike Kravetz 2018-06-07  259  		if (flags & ~(unsigned int)MFD_ALL_FLAGS)
5d752600 Mike Kravetz 2018-06-07  260  			return -EINVAL;
5d752600 Mike Kravetz 2018-06-07  261  	} else {
5d752600 Mike Kravetz 2018-06-07  262  		/* Allow huge page size encoding in flags. */
5d752600 Mike Kravetz 2018-06-07  263  		if (flags & ~(unsigned int)(MFD_ALL_FLAGS |
5d752600 Mike Kravetz 2018-06-07  264  				(MFD_HUGE_MASK << MFD_HUGE_SHIFT)))
5d752600 Mike Kravetz 2018-06-07  265  			return -EINVAL;
5d752600 Mike Kravetz 2018-06-07  266  	}
5d752600 Mike Kravetz 2018-06-07  267  
5d752600 Mike Kravetz 2018-06-07  268  	/* length includes terminating zero */
5d752600 Mike Kravetz 2018-06-07  269  	len = strnlen_user(uname, MFD_NAME_MAX_LEN + 1);
5d752600 Mike Kravetz 2018-06-07  270  	if (len <= 0)
5d752600 Mike Kravetz 2018-06-07  271  		return -EFAULT;
5d752600 Mike Kravetz 2018-06-07  272  	if (len > MFD_NAME_MAX_LEN + 1)
5d752600 Mike Kravetz 2018-06-07  273  		return -EINVAL;
5d752600 Mike Kravetz 2018-06-07  274  
5d752600 Mike Kravetz 2018-06-07  275  	name = kmalloc(len + MFD_NAME_PREFIX_LEN, GFP_KERNEL);
5d752600 Mike Kravetz 2018-06-07  276  	if (!name)
5d752600 Mike Kravetz 2018-06-07  277  		return -ENOMEM;
5d752600 Mike Kravetz 2018-06-07  278  
5d752600 Mike Kravetz 2018-06-07  279  	strcpy(name, MFD_NAME_PREFIX);
5d752600 Mike Kravetz 2018-06-07  280  	if (copy_from_user(&name[MFD_NAME_PREFIX_LEN], uname, len)) {
5d752600 Mike Kravetz 2018-06-07  281  		error = -EFAULT;
5d752600 Mike Kravetz 2018-06-07  282  		goto err_name;
5d752600 Mike Kravetz 2018-06-07  283  	}
5d752600 Mike Kravetz 2018-06-07  284  
5d752600 Mike Kravetz 2018-06-07  285  	/* terminating-zero may have changed after strnlen_user() returned */
5d752600 Mike Kravetz 2018-06-07  286  	if (name[len + MFD_NAME_PREFIX_LEN - 1]) {
5d752600 Mike Kravetz 2018-06-07  287  		error = -EFAULT;
5d752600 Mike Kravetz 2018-06-07  288  		goto err_name;
5d752600 Mike Kravetz 2018-06-07  289  	}
5d752600 Mike Kravetz 2018-06-07  290  
5d752600 Mike Kravetz 2018-06-07  291  	fd = get_unused_fd_flags((flags & MFD_CLOEXEC) ? O_CLOEXEC : 0);
5d752600 Mike Kravetz 2018-06-07  292  	if (fd < 0) {
5d752600 Mike Kravetz 2018-06-07  293  		error = fd;
5d752600 Mike Kravetz 2018-06-07  294  		goto err_name;
5d752600 Mike Kravetz 2018-06-07  295  	}
5d752600 Mike Kravetz 2018-06-07  296  
5d752600 Mike Kravetz 2018-06-07  297  	if (flags & MFD_HUGETLB) {
5d752600 Mike Kravetz 2018-06-07  298  		struct user_struct *user = NULL;
5d752600 Mike Kravetz 2018-06-07  299  
5d752600 Mike Kravetz 2018-06-07 @300  		file = hugetlb_file_setup(name, 0, VM_NORESERVE, &user,

:::::: The code at line 300 was first introduced by commit
:::::: 5d752600a8c373382264392f5b573b2fc9c0e8ea mm: restructure memfd code

:::::: TO: Mike Kravetz <mike.kravetz@oracle.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29505 bytes --]

  reply	other threads:[~2019-05-04 23:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 11:41 [PATCH] mm: do not grant +x by default in memfd_create() Dima Krasner
2019-05-04 23:37 ` kbuild test robot [this message]
2019-05-05  4:59   ` [PATCH v2] " Dima Krasner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201905050757.M2Q7kM1M%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dima@dimakrasner.com \
    --cc=hughd@google.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).