All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android-4.14-q 3/3] fs/overlayfs/namei.c:88:2: note: in expansion of macro 'pr_warn_ratelimited'
@ 2019-11-06  7:24 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-11-06  7:24 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://android.googlesource.com/kernel/common android-4.14-q
head:   ca76d7591354498239b77dd5f07ba33750b4a23f
commit: ca76d7591354498239b77dd5f07ba33750b4a23f [3/3] ANDROID: overlayfs: internal getxattr operations without sepolicy checking
config: x86_64-randconfig-f003-201944 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        git checkout ca76d7591354498239b77dd5f07ba33750b4a23f
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:14:0,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from fs/overlayfs/namei.c:10:
   fs/overlayfs/namei.c: In function 'ovl_check_redirect':
>> include/linux/kern_levels.h:5:18: warning: format '%i' expects argument of type 'int', but argument 2 has type 'ssize_t {aka long int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/printk.h:427:10: note: in definition of macro 'printk_ratelimited'
      printk(fmt, ##__VA_ARGS__);    \
             ^~~
   include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
    #define KERN_WARNING KERN_SOH "4" /* warning conditions */
                         ^~~~~~~~
   include/linux/printk.h:443:21: note: in expansion of macro 'KERN_WARNING'
     printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                        ^~~~~~~~~~~~
>> fs/overlayfs/namei.c:88:2: note: in expansion of macro 'pr_warn_ratelimited'
     pr_warn_ratelimited("overlayfs: failed to get redirect (%i)\n", res);
     ^~~~~~~~~~~~~~~~~~~
   fs/overlayfs/namei.c:88:59: note: format string is defined here
     pr_warn_ratelimited("overlayfs: failed to get redirect (%i)\n", res);
                                                             ~^
                                                             %li
--
   In file included from include/linux/kernel.h:14:0,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from fs/overlayfs/inode.c:10:
   fs/overlayfs/inode.c: In function 'ovl_get_nlink':
   include/linux/kern_levels.h:5:18: warning: format '%i' expects argument of type 'int', but argument 3 has type 'ssize_t {aka long int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/printk.h:427:10: note: in definition of macro 'printk_ratelimited'
      printk(fmt, ##__VA_ARGS__);    \
             ^~~
   include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
    #define KERN_WARNING KERN_SOH "4" /* warning conditions */
                         ^~~~~~~~
   include/linux/printk.h:443:21: note: in expansion of macro 'KERN_WARNING'
     printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                        ^~~~~~~~~~~~
>> fs/overlayfs/inode.c:570:2: note: in expansion of macro 'pr_warn_ratelimited'
     pr_warn_ratelimited("overlayfs: failed to get index nlink (%pd2, err=%i)\n",
     ^~~~~~~~~~~~~~~~~~~
   fs/overlayfs/inode.c:570:72: note: format string is defined here
     pr_warn_ratelimited("overlayfs: failed to get index nlink (%pd2, err=%i)\n",
                                                                          ~^
                                                                          %li
--
   In file included from include/linux/kernel.h:14:0,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from fs//overlayfs/namei.c:10:
   fs//overlayfs/namei.c: In function 'ovl_check_redirect':
>> include/linux/kern_levels.h:5:18: warning: format '%i' expects argument of type 'int', but argument 2 has type 'ssize_t {aka long int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/printk.h:427:10: note: in definition of macro 'printk_ratelimited'
      printk(fmt, ##__VA_ARGS__);    \
             ^~~
   include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
    #define KERN_WARNING KERN_SOH "4" /* warning conditions */
                         ^~~~~~~~
   include/linux/printk.h:443:21: note: in expansion of macro 'KERN_WARNING'
     printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                        ^~~~~~~~~~~~
   fs//overlayfs/namei.c:88:2: note: in expansion of macro 'pr_warn_ratelimited'
     pr_warn_ratelimited("overlayfs: failed to get redirect (%i)\n", res);
     ^~~~~~~~~~~~~~~~~~~
   fs//overlayfs/namei.c:88:59: note: format string is defined here
     pr_warn_ratelimited("overlayfs: failed to get redirect (%i)\n", res);
                                                             ~^
                                                             %li

vim +/pr_warn_ratelimited +88 fs/overlayfs/namei.c

bbb1e54dd53cf8 Miklos Szeredi 2016-12-16  28  
02b69b284cd781 Miklos Szeredi 2016-12-16  29  static int ovl_check_redirect(struct dentry *dentry, struct ovl_lookup_data *d,
02b69b284cd781 Miklos Szeredi 2016-12-16  30  			      size_t prelen, const char *post)
02b69b284cd781 Miklos Szeredi 2016-12-16  31  {
ca76d759135449 Mark Salyzyn   2019-07-23  32  	ssize_t res;
02b69b284cd781 Miklos Szeredi 2016-12-16  33  	char *s, *next, *buf = NULL;
02b69b284cd781 Miklos Szeredi 2016-12-16  34  
ca76d759135449 Mark Salyzyn   2019-07-23  35  	res = ovl_vfs_getxattr(dentry, OVL_XATTR_REDIRECT, NULL, 0);
02b69b284cd781 Miklos Szeredi 2016-12-16  36  	if (res < 0) {
02b69b284cd781 Miklos Szeredi 2016-12-16  37  		if (res == -ENODATA || res == -EOPNOTSUPP)
02b69b284cd781 Miklos Szeredi 2016-12-16  38  			return 0;
02b69b284cd781 Miklos Szeredi 2016-12-16  39  		goto fail;
02b69b284cd781 Miklos Szeredi 2016-12-16  40  	}
0ee931c4e31a5e Michal Hocko   2017-09-13  41  	buf = kzalloc(prelen + res + strlen(post) + 1, GFP_KERNEL);
02b69b284cd781 Miklos Szeredi 2016-12-16  42  	if (!buf)
02b69b284cd781 Miklos Szeredi 2016-12-16  43  		return -ENOMEM;
02b69b284cd781 Miklos Szeredi 2016-12-16  44  
02b69b284cd781 Miklos Szeredi 2016-12-16  45  	if (res == 0)
02b69b284cd781 Miklos Szeredi 2016-12-16  46  		goto invalid;
02b69b284cd781 Miklos Szeredi 2016-12-16  47  
ca76d759135449 Mark Salyzyn   2019-07-23  48  	res = ovl_vfs_getxattr(dentry, OVL_XATTR_REDIRECT, buf, res);
02b69b284cd781 Miklos Szeredi 2016-12-16  49  	if (res < 0)
02b69b284cd781 Miklos Szeredi 2016-12-16  50  		goto fail;
02b69b284cd781 Miklos Szeredi 2016-12-16  51  	if (res == 0)
02b69b284cd781 Miklos Szeredi 2016-12-16  52  		goto invalid;
02b69b284cd781 Miklos Szeredi 2016-12-16  53  	if (buf[0] == '/') {
02b69b284cd781 Miklos Szeredi 2016-12-16  54  		for (s = buf; *s++ == '/'; s = next) {
02b69b284cd781 Miklos Szeredi 2016-12-16  55  			next = strchrnul(s, '/');
02b69b284cd781 Miklos Szeredi 2016-12-16  56  			if (s == next)
02b69b284cd781 Miklos Szeredi 2016-12-16  57  				goto invalid;
02b69b284cd781 Miklos Szeredi 2016-12-16  58  		}
80f509d4919d55 Amir Goldstein 2018-03-12  59  		/*
80f509d4919d55 Amir Goldstein 2018-03-12  60  		 * One of the ancestor path elements in an absolute path
80f509d4919d55 Amir Goldstein 2018-03-12  61  		 * lookup in ovl_lookup_layer() could have been opaque and
80f509d4919d55 Amir Goldstein 2018-03-12  62  		 * that will stop further lookup in lower layers (d->stop=true)
80f509d4919d55 Amir Goldstein 2018-03-12  63  		 * But we have found an absolute redirect in decendant path
80f509d4919d55 Amir Goldstein 2018-03-12  64  		 * element and that should force continue lookup in lower
80f509d4919d55 Amir Goldstein 2018-03-12  65  		 * layers (reset d->stop).
80f509d4919d55 Amir Goldstein 2018-03-12  66  		 */
80f509d4919d55 Amir Goldstein 2018-03-12  67  		d->stop = false;
02b69b284cd781 Miklos Szeredi 2016-12-16  68  	} else {
02b69b284cd781 Miklos Szeredi 2016-12-16  69  		if (strchr(buf, '/') != NULL)
02b69b284cd781 Miklos Szeredi 2016-12-16  70  			goto invalid;
02b69b284cd781 Miklos Szeredi 2016-12-16  71  
02b69b284cd781 Miklos Szeredi 2016-12-16  72  		memmove(buf + prelen, buf, res);
02b69b284cd781 Miklos Szeredi 2016-12-16  73  		memcpy(buf, d->name.name, prelen);
02b69b284cd781 Miklos Szeredi 2016-12-16  74  	}
02b69b284cd781 Miklos Szeredi 2016-12-16  75  
02b69b284cd781 Miklos Szeredi 2016-12-16  76  	strcat(buf, post);
02b69b284cd781 Miklos Szeredi 2016-12-16  77  	kfree(d->redirect);
02b69b284cd781 Miklos Szeredi 2016-12-16  78  	d->redirect = buf;
02b69b284cd781 Miklos Szeredi 2016-12-16  79  	d->name.name = d->redirect;
02b69b284cd781 Miklos Szeredi 2016-12-16  80  	d->name.len = strlen(d->redirect);
02b69b284cd781 Miklos Szeredi 2016-12-16  81  
02b69b284cd781 Miklos Szeredi 2016-12-16  82  	return 0;
02b69b284cd781 Miklos Szeredi 2016-12-16  83  
02b69b284cd781 Miklos Szeredi 2016-12-16  84  err_free:
02b69b284cd781 Miklos Szeredi 2016-12-16  85  	kfree(buf);
02b69b284cd781 Miklos Szeredi 2016-12-16  86  	return 0;
02b69b284cd781 Miklos Szeredi 2016-12-16  87  fail:
02b69b284cd781 Miklos Szeredi 2016-12-16 @88  	pr_warn_ratelimited("overlayfs: failed to get redirect (%i)\n", res);
02b69b284cd781 Miklos Szeredi 2016-12-16  89  	goto err_free;
02b69b284cd781 Miklos Szeredi 2016-12-16  90  invalid:
02b69b284cd781 Miklos Szeredi 2016-12-16  91  	pr_warn_ratelimited("overlayfs: invalid redirect (%s)\n", buf);
02b69b284cd781 Miklos Szeredi 2016-12-16  92  	goto err_free;
02b69b284cd781 Miklos Szeredi 2016-12-16  93  }
02b69b284cd781 Miklos Szeredi 2016-12-16  94  

:::::: The code at line 88 was first introduced by commit
:::::: 02b69b284cd7815239fabfe895bfef9a9eb5a3ce ovl: lookup redirects

:::::: TO: Miklos Szeredi <mszeredi@redhat.com>
:::::: CC: Miklos Szeredi <mszeredi@redhat.com>

---
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: 28257 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-06  7:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06  7:24 [android-common:android-4.14-q 3/3] fs/overlayfs/namei.c:88:2: note: in expansion of macro 'pr_warn_ratelimited' kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.