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:	Sat, 16 Jul 2016 02:31:41 +0800
From:	kbuild test robot <lkp@...el.com>
To:	Petr Mladek <pmladek@...e.com>
Cc:	kbuild-all@...org, Andrew Morton <akpm@...ux-foundation.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
	Jiri Kosina <jkosina@...e.com>, Jan Kara <jack@...e.com>,
	Tejun Heo <tj@...nel.org>,
	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
	Byungchul Park <byungchul.park@....com>,
	linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.com>
Subject: Re: [PATCH POC 2/4] printk: Do not block cont buffer by partially
 flushed lines

Hi,

[auto build test ERROR on v4.7-rc7]
[cannot apply to next-20160715]
[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/Petr-Mladek/printk-Several-fixes-of-cont-buffer-and-console-handling/20160716-012724
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   kernel/printk/printk.c: In function 'console_cont_flush':
   kernel/printk/printk.c:2150:11: error: 'struct cont' has no member named 'msg'
     if (!cont.msg->text_len)
              ^
>> kernel/printk/printk.c:2160:24: error: passing argument 1 of 'cont_print_text' from incompatible pointer type [-Werror=incompatible-pointer-types]
     len = cont_print_text(&cont, text, size);
                           ^
   kernel/printk/printk.c:1873:15: note: expected 'char *' but argument is of type 'struct cont *'
    static size_t cont_print_text(char *text, size_t size) { return 0; }
                  ^~~~~~~~~~~~~~~
>> kernel/printk/printk.c:2160:31: warning: passing argument 2 of 'cont_print_text' makes integer from pointer without a cast [-Wint-conversion]
     len = cont_print_text(&cont, text, size);
                                  ^~~~
   kernel/printk/printk.c:1873:15: note: expected 'size_t {aka unsigned int}' but argument is of type 'char *'
    static size_t cont_print_text(char *text, size_t size) { return 0; }
                  ^~~~~~~~~~~~~~~
>> kernel/printk/printk.c:2160:8: error: too many arguments to function 'cont_print_text'
     len = cont_print_text(&cont, text, size);
           ^~~~~~~~~~~~~~~
   kernel/printk/printk.c:1873:15: note: declared here
    static size_t cont_print_text(char *text, size_t size) { return 0; }
                  ^~~~~~~~~~~~~~~
   kernel/printk/printk.c:2163:27: error: 'struct cont' has no member named 'msg'
     call_console_drivers(cont.msg->level, NULL, 0, text, len);
                              ^
   kernel/printk/printk.c: In function 'console_unlock':
   kernel/printk/printk.c:2262:7: error: 'cont_console_len' undeclared (first use in this function)
      if (cont_console_len && cont_console_seq == console_seq) {
          ^~~~~~~~~~~~~~~~
   kernel/printk/printk.c:2262:7: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/printk/printk.c:2262:27: error: 'cont_console_seq' undeclared (first use in this function)
      if (cont_console_len && cont_console_seq == console_seq) {
                              ^~~~~~~~~~~~~~~~
>> kernel/printk/printk.c:2265:13: error: 'struct cont' has no member named 'owner'
       fake_cont.owner = NULL;
                ^
   kernel/printk/printk.c:2266:13: error: 'struct cont' has no member named 'msg'
       fake_cont.msg = msg;
                ^
>> kernel/printk/printk.c:2267:13: error: 'struct cont' has no member named 'buf'
       fake_cont.buf = log_text(msg);
                ^
   kernel/printk/printk.c:2269:27: error: passing argument 1 of 'cont_print_text' from incompatible pointer type [-Werror=incompatible-pointer-types]
       len += cont_print_text(&fake_cont, text + len, sizeof(text) - len);
                              ^
   kernel/printk/printk.c:1873:15: note: expected 'char *' but argument is of type 'struct cont *'
    static size_t cont_print_text(char *text, size_t size) { return 0; }
                  ^~~~~~~~~~~~~~~
   kernel/printk/printk.c:2269:39: warning: passing argument 2 of 'cont_print_text' makes integer from pointer without a cast [-Wint-conversion]
       len += cont_print_text(&fake_cont, text + len, sizeof(text) - len);
                                          ^~~~
   kernel/printk/printk.c:1873:15: note: expected 'size_t {aka unsigned int}' but argument is of type 'char *'
    static size_t cont_print_text(char *text, size_t size) { return 0; }
                  ^~~~~~~~~~~~~~~
   kernel/printk/printk.c:2269:11: error: too many arguments to function 'cont_print_text'
       len += cont_print_text(&fake_cont, text + len, sizeof(text) - len);
              ^~~~~~~~~~~~~~~
   kernel/printk/printk.c:1873:15: note: declared here
    static size_t cont_print_text(char *text, size_t size) { return 0; }
                  ^~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/cont_print_text +2160 kernel/printk/printk.c

  2144	{
  2145		unsigned long flags;
  2146		size_t len;
  2147	
  2148		raw_spin_lock_irqsave(&logbuf_lock, flags);
  2149	
> 2150		if (!cont.msg->text_len)
  2151			goto out;
  2152	
  2153		/*
  2154		 * If the partially printed line is already stored in
  2155		 * the ring buffer, it will be handled with the other lines.
  2156		 */
  2157		if (console_seq < log_next_seq)
  2158			goto out;
  2159	
> 2160		len = cont_print_text(&cont, text, size);
  2161		raw_spin_unlock(&logbuf_lock);
  2162		stop_critical_timings();
> 2163		call_console_drivers(cont.msg->level, NULL, 0, text, len);
  2164		start_critical_timings();
  2165		local_irq_restore(flags);
  2166		return;
  2167	out:
  2168		raw_spin_unlock_irqrestore(&logbuf_lock, flags);
  2169	}
  2170	
  2171	/**
  2172	 * console_unlock - unlock the console system
  2173	 *
  2174	 * Releases the console_lock which the caller holds on the console system
  2175	 * and the console driver list.
  2176	 *
  2177	 * While the console_lock was held, console output may have been buffered
  2178	 * by printk().  If this is the case, console_unlock(); emits
  2179	 * the output prior to releasing the lock.
  2180	 *
  2181	 * If there is output waiting, we wake /dev/kmsg and syslog() users.
  2182	 *
  2183	 * console_unlock(); may be called from any context.
  2184	 */
  2185	void console_unlock(void)
  2186	{
  2187		static char ext_text[CONSOLE_EXT_LOG_MAX];
  2188		static char text[LOG_LINE_MAX + PREFIX_MAX];
  2189		static u64 seen_seq;
  2190		unsigned long flags;
  2191		bool wake_klogd = false;
  2192		bool do_cond_resched, retry;
  2193	
  2194		if (console_suspended) {
  2195			up_console_sem();
  2196			return;
  2197		}
  2198	
  2199		/*
  2200		 * Console drivers are called under logbuf_lock, so
  2201		 * @console_may_schedule should be cleared before; however, we may
  2202		 * end up dumping a lot of lines, for example, if called from
  2203		 * console registration path, and should invoke cond_resched()
  2204		 * between lines if allowable.  Not doing so can cause a very long
  2205		 * scheduling stall on a slow console leading to RCU stall and
  2206		 * softlockup warnings which exacerbate the issue with more
  2207		 * messages practically incapacitating the system.
  2208		 */
  2209		do_cond_resched = console_may_schedule;
  2210		console_may_schedule = 0;
  2211	
  2212	again:
  2213		/*
  2214		 * We released the console_sem lock, so we need to recheck if
  2215		 * cpu is online and (if not) is there at least one CON_ANYTIME
  2216		 * console.
  2217		 */
  2218		if (!can_use_console()) {
  2219			console_locked = 0;
  2220			up_console_sem();
  2221			return;
  2222		}
  2223	
  2224		/* flush buffered message fragment immediately to console */
  2225		console_cont_flush(text, sizeof(text));
  2226	
  2227		for (;;) {
  2228			struct printk_log *msg;
  2229			size_t ext_len = 0;
  2230			size_t len;
  2231			int level;
  2232	
  2233			raw_spin_lock_irqsave(&logbuf_lock, flags);
  2234			if (seen_seq != log_next_seq) {
  2235				wake_klogd = true;
  2236				seen_seq = log_next_seq;
  2237			}
  2238	
  2239			if (console_seq < log_first_seq) {
  2240				len = sprintf(text, "** %u printk messages dropped ** ",
  2241					      (unsigned)(log_first_seq - console_seq));
  2242	
  2243				/* messages are gone, move to first one */
  2244				console_seq = log_first_seq;
  2245				console_idx = log_first_idx;
  2246				console_prev = 0;
  2247			} else {
  2248				len = 0;
  2249			}
  2250	
  2251			if (console_seq == log_next_seq)
  2252				break;
  2253	
  2254			msg = log_from_idx(console_idx);
  2255			level = msg->level;
  2256	
  2257			/*
  2258			 * The line might be already partially printed from the cont
  2259			 * buffer. In this case, flush the rest using a fake
  2260			 * cont buffer.
  2261			 */
> 2262			if (cont_console_len && cont_console_seq == console_seq) {
  2263				struct cont fake_cont;
  2264	
> 2265				fake_cont.owner = NULL;
  2266				fake_cont.msg = msg;
> 2267				fake_cont.buf = log_text(msg);
  2268	
  2269				len += cont_print_text(&fake_cont, text + len, sizeof(text) - len);
  2270	

---
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/octet-stream" (6334 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ