All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: kernel-janitors@vger.kernel.org
Subject: [next:akpm 18/86] kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast
Date: Fri, 12 Oct 2012 16:56:55 +0000	[thread overview]
Message-ID: <20121012165655.GB20312@localhost> (raw)

Hi Kees,

FYI, there are new compile warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
head:   04b956faad392f46c9a234962a9990196b8e48fc
commit: b8763455880e371a81b07599bc66ae94f96dc6d6 [18/86] kernel/sys.c: fix stack memory content leak via UNAME26
config: mn10300-asb2364_defconfig # make ARCH=mn10300 asb2364_defconfig

All warnings:

kernel/sys.c: In function 'override_release':
kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]

vim +1287 kernel/sys.c

be27425d Andi Kleen     2011-08-19  1271  
be27425d Andi Kleen     2011-08-19  1272  	if (current->personality & UNAME26) {
b8763455 Kees Cook      2012-10-12  1273  		const char *rest = UTS_RELEASE;
b8763455 Kees Cook      2012-10-12  1274  		char buf[65] = { 0 };
be27425d Andi Kleen     2011-08-19  1275  		int ndots = 0;
be27425d Andi Kleen     2011-08-19  1276  		unsigned v;
b8763455 Kees Cook      2012-10-12  1277  		size_t copy;
be27425d Andi Kleen     2011-08-19  1278  
be27425d Andi Kleen     2011-08-19  1279  		while (*rest) {
be27425d Andi Kleen     2011-08-19  1280  			if (*rest = '.' && ++ndots >= 3)
be27425d Andi Kleen     2011-08-19  1281  				break;
be27425d Andi Kleen     2011-08-19  1282  			if (!isdigit(*rest) && *rest != '.')
be27425d Andi Kleen     2011-08-19  1283  				break;
be27425d Andi Kleen     2011-08-19  1284  			rest++;
be27425d Andi Kleen     2011-08-19  1285  		}
be27425d Andi Kleen     2011-08-19  1286  		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
b8763455 Kees Cook      2012-10-12 @1287  		copy = min(sizeof(buf), max_t(size_t, 1, len));
b8763455 Kees Cook      2012-10-12  1288  		copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
b8763455 Kees Cook      2012-10-12  1289  		ret = copy_to_user(release, buf, copy + 1);
be27425d Andi Kleen     2011-08-19  1290  	}
be27425d Andi Kleen     2011-08-19  1291  	return ret;
be27425d Andi Kleen     2011-08-19  1292  }
be27425d Andi Kleen     2011-08-19  1293  
e48fbb69 Heiko Carstens 2009-01-14  1294  SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
^1da177e Linus Torvalds 2005-04-16  1295  {

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation

             reply	other threads:[~2012-10-12 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 16:56 Fengguang Wu [this message]
2012-10-12 17:46 ` [next:akpm 18/86] kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a ca Kees Cook
2012-10-12 18:29 ` Fengguang Wu

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=20121012165655.GB20312@localhost \
    --to=fengguang.wu@intel.com \
    --cc=kernel-janitors@vger.kernel.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 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.