lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Nov 2017 08:50:02 +0800
From:   kbuild test robot <lkp@...el.com>
To:     "Tobin C. Harding" <me@...in.cc>
Cc:     kbuild-all@...org, kernel-hardening@...ts.openwall.com,
        "Tobin C. Harding" <me@...in.cc>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Theodore Ts'o <tytso@....edu>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Kees Cook <keescook@...omium.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Tycho Andersen <tycho@...ker.com>,
        "Roberts, William C" <william.c.roberts@...el.com>,
        Tejun Heo <tj@...nel.org>,
        Jordan Glover <Golden_Miller83@...tonmail.ch>,
        Greg KH <gregkh@...uxfoundation.org>,
        Petr Mladek <pmladek@...e.com>, Joe Perches <joe@...ches.com>,
        Ian Campbell <ijc@...lion.org.uk>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <wilal.deacon@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Chris Fries <cfries@...gle.com>,
        Dave Weinstein <olorin@...gle.com>,
        Daniel Micay <danielmicay@...il.com>,
        Djalal Harouni <tixxdz@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V9] printk: hash addresses printed with %p

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

Download attachment ".config.gz" of type "application/gzip" (6685 bytes)

Powered by blists - more mailing lists