From: kbuild test robot <lkp@intel.com>
To: "Tobin C. Harding" <me@tobin.cc>
Cc: kbuild-all@01.org, kernel-hardening@lists.openwall.com,
"Tobin C. Harding" <me@tobin.cc>,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
"Theodore Ts'o" <tytso@mit.edu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Kees Cook <keescook@chromium.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Tycho Andersen <tycho@docker.com>,
"Roberts, William C" <william.c.roberts@intel.com>,
Tejun Heo <tj@kernel.org>,
Jordan Glover <Golden_Miller83@protonmail.ch>,
Greg KH <gregkh@linuxfoundation.org>,
Petr Mladek <pmladek@suse.com>, Joe Perches <joe@perches.com>,
Ian Campbell <ijc@hellion.org.uk>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <wilal.deacon@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Chris Fries <cfries@google.com>,
Dave Weinstein <olorin@google.com>,
Daniel Micay <danielmicay@gmail.com>,
Djalal Harouni <tixxdz@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V9] printk: hash addresses printed with %p
Date: Wed, 1 Nov 2017 08:50:02 +0800 [thread overview]
Message-ID: <201711010836.4ZY112Qv%fengguang.wu@intel.com> (raw)
In-Reply-To: <1509317956-28041-1-git-send-email-me@tobin.cc>
[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]
Hi Tobin,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.14-rc7 next-20171018]
[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/Tobin-C-Harding/printk-hash-addresses-printed-with-p/20171101-080718
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
lib/vsprintf.c: In function 'kernel_pointer':
>> lib/vsprintf.c:1359:10: error: 'kptr_restrict' undeclared (first use in this function)
switch (kptr_restrict) {
^~~~~~~~~~~~~
lib/vsprintf.c:1359:10: note: each undeclared identifier is reported only once for each function it appears in
vim +/kptr_restrict +1359 lib/vsprintf.c
1347
1348 static noinline_for_stack
1349 char *kernel_pointer(char *buf, char *end, const void *ptr,
1350 struct printf_spec spec)
1351 {
1352 spec.base = 16;
1353 spec.flags |= SMALL;
1354 if (spec.field_width == -1) {
1355 spec.field_width = 2 * sizeof(void *);
1356 spec.flags |= ZEROPAD;
1357 }
1358
> 1359 switch (kptr_restrict) {
1360 case 0:
1361 /* Always print %pK values */
1362 break;
1363 case 1: {
1364 const struct cred *cred;
1365
1366 /*
1367 * kptr_restrict==1 cannot be used in IRQ context
1368 * because its test for CAP_SYSLOG would be meaningless.
1369 */
1370 if (in_irq() || in_serving_softirq() || in_nmi())
1371 return string(buf, end, "pK-error", spec);
1372
1373 /*
1374 * Only print the real pointer value if the current
1375 * process has CAP_SYSLOG and is running with the
1376 * same credentials it started with. This is because
1377 * access to files is checked at open() time, but %pK
1378 * checks permission at read() time. We don't want to
1379 * leak pointer values if a binary opens a file using
1380 * %pK and then elevates privileges before reading it.
1381 */
1382 cred = current_cred();
1383 if (!has_capability_noaudit(current, CAP_SYSLOG) ||
1384 !uid_eq(cred->euid, cred->uid) ||
1385 !gid_eq(cred->egid, cred->gid))
1386 ptr = NULL;
1387 break;
1388 }
1389 case 2:
1390 default:
1391 /* Always print 0's for %pK */
1392 ptr = NULL;
1393 break;
1394 }
1395
1396 return number(buf, end, (unsigned long)ptr, spec);
1397 }
1398
---
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: 6685 bytes --]
prev parent reply other threads:[~2017-11-01 0:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-29 22:59 Tobin C. Harding
2017-10-30 22:31 ` Kees Cook
2017-10-30 22:45 ` Tobin C. Harding
2017-10-31 15:39 ` Petr Mladek
2017-10-31 23:53 ` Tobin C. Harding
2017-11-01 12:43 ` Petr Mladek
2017-11-01 0: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=201711010836.4ZY112Qv%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=Golden_Miller83@protonmail.ch \
--cc=Jason@zx2c4.com \
--cc=catalin.marinas@arm.com \
--cc=cfries@google.com \
--cc=danielmicay@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=ijc@hellion.org.uk \
--cc=joe@perches.com \
--cc=kbuild-all@01.org \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
--cc=olorin@google.com \
--cc=pbonzini@redhat.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=tixxdz@gmail.com \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tycho@docker.com \
--cc=tytso@mit.edu \
--cc=wilal.deacon@arm.com \
--cc=william.c.roberts@intel.com \
/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
all inboxes | Powered by JetHome®