LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Marco Elver <elver@google.com>
Cc: kbuild-all@01.org, aryabinin@virtuozzo.com, dvyukov@google.com,
	glider@google.com, andreyknvl@google.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, kasan-dev@googlegroups.com,
	Marco Elver <elver@google.com>
Subject: Re: [PATCH] mm/kasan: Print frame description for stack bugs
Date: Thu, 23 May 2019 17:50:30 +0800	[thread overview]
Message-ID: <201905231720.XVaE4IT9%lkp@intel.com> (raw)
In-Reply-To: <20190517131046.164100-1-elver@google.com>

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

Hi Marco,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.2-rc1 next-20190522]
[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/Marco-Elver/mm-kasan-Print-frame-description-for-stack-bugs/20190519-040214
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=xtensa 

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/printk.h:7:0,
                    from include/linux/kernel.h:15,
                    from include/linux/kallsyms.h:10,
                    from include/linux/ftrace.h:11,
                    from mm/kasan/report.c:18:
   mm/kasan/report.c: In function 'print_decoded_frame_descr':
   include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:304:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
>> mm/kasan/report.c:233:2: note: in expansion of macro 'pr_err'
     pr_err("this frame has %zu %s:\n", num_objects,
     ^~~~~~
   mm/kasan/report.c:233:27: note: format string is defined here
     pr_err("this frame has %zu %s:\n", num_objects,
                            ~~^
                            %lu
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:15,
                    from include/linux/kallsyms.h:10,
                    from include/linux/ftrace.h:11,
                    from mm/kasan/report.c:18:
   include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:304:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
   mm/kasan/report.c:260:3: note: in expansion of macro 'pr_err'
      pr_err(" [%zu, %zu) '%s'", offset, offset + size, token);
      ^~~~~~
   mm/kasan/report.c:260:15: note: format string is defined here
      pr_err(" [%zu, %zu) '%s'", offset, offset + size, token);
                ~~^
                %lu
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:15,
                    from include/linux/kallsyms.h:10,
                    from include/linux/ftrace.h:11,
                    from mm/kasan/report.c:18:
   include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:304:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
   mm/kasan/report.c:260:3: note: in expansion of macro 'pr_err'
      pr_err(" [%zu, %zu) '%s'", offset, offset + size, token);
      ^~~~~~
   mm/kasan/report.c:260:20: note: format string is defined here
      pr_err(" [%zu, %zu) '%s'", offset, offset + size, token);
                     ~~^
                     %lu

vim +/pr_err +233 mm/kasan/report.c

   214	
   215	static void print_decoded_frame_descr(const char *frame_descr)
   216	{
   217		/*
   218		 * We need to parse the following string:
   219		 *    "n alloc_1 alloc_2 ... alloc_n"
   220		 * where alloc_i looks like
   221		 *    "offset size len name"
   222		 * or "offset size len name:line".
   223		 */
   224	
   225		char token[64];
   226		unsigned long num_objects;
   227	
   228		if (!tokenize_frame_descr(&frame_descr, token, sizeof(token),
   229					  &num_objects))
   230			return;
   231	
   232		pr_err("\n");
 > 233		pr_err("this frame has %zu %s:\n", num_objects,
   234		       num_objects == 1 ? "object" : "objects");
   235	
   236		while (num_objects--) {
   237			unsigned long offset;
   238			unsigned long size;
   239	
   240			/* access offset */
   241			if (!tokenize_frame_descr(&frame_descr, token, sizeof(token),
   242						  &offset))
   243				return;
   244			/* access size */
   245			if (!tokenize_frame_descr(&frame_descr, token, sizeof(token),
   246						  &size))
   247				return;
   248			/* name length (unused) */
   249			if (!tokenize_frame_descr(&frame_descr, NULL, 0, NULL))
   250				return;
   251			/* object name */
   252			if (!tokenize_frame_descr(&frame_descr, token, sizeof(token),
   253						  NULL))
   254				return;
   255	
   256			/* Strip line number, if it exists. */
   257			strreplace(token, ':', '\0');
   258	
   259			/* Finally, print object information. */
   260			pr_err(" [%zu, %zu) '%s'", offset, offset + size, token);
   261		}
   262	}
   263	

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

      parent reply	other threads:[~2019-05-23  9:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 13:10 Marco Elver
2019-05-18 20:48 ` kbuild test robot
2019-05-22  2:10   ` Andrew Morton
2019-05-22 10:02     ` Marco Elver
2019-05-23  9:50 ` kbuild test robot [this message]

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=201905231720.XVaE4IT9%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --subject='Re: [PATCH] mm/kasan: Print frame description for stack bugs' \
    /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

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).