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] [day] [month] [year] [list]
Date:	Sun, 2 Nov 2014 12:13:37 +0100
From:	Borislav Petkov <bp@...en8.de>
To:	Steven Honeyman <stevenhoneyman@...il.com>
Cc:	Joe Perches <joe@...ches.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, Jiri Kosina <trivial@...nel.org>,
	x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86, cpu: trivial printk formatting fixes

On Sun, Nov 02, 2014 at 04:03:52AM +0000, Steven Honeyman wrote:
> Hmm - the difference is to do with the source of the kernel ring
> buffer. The old output format be obtained using the latest dmesg by
> adding "-S", which uses syslog(2) rather than /dev/kmsg.
> (added in commit 7af230601ab)
> 
> The klogctl version interprets the \n and adds the timestamp
> afterwards, but /dev/kmsg changes the '\n' to "\x0a" resulting in:
> 4,355,10557,-;ENERGY_PERF_BIAS: Set to 'normal', was
> 'performance'\x0aENERGY_P...
> 
> It looks as though it's just a matter of opinion/preference whether
> control characters are printed (rfc5424)

Right, I see what you mean. There's this in the /dev/kmsg code

---
 * /dev/kmsg exports the structured data in the following line format:
 *   "level,sequnum,timestamp;<message text>\n"
 *
 * The optional key/value pairs are attached as continuation lines starting
 * with a space character and terminated by a newline. All possible
 * non-prinatable characters are escaped in the "\xff" notation.
 *
 * Users of the export format should ignore possible additional values
 * separated by ',', and find the message after the ';' character.
 */
--

and also

---
        /* escape non-printable characters */
        for (i = 0; i < msg->text_len; i++) {
                unsigned char c = log_text(msg)[i];

                if (c < ' ' || c >= 127 || c == '\\')
                        len += sprintf(user->buf + len, "\\x%02x", c);
                else
                        user->buf[len++] = c;
        }
--

in devkmsg_read().

Hmm, so this all looks like an agreed upon thing or whatever. Oh, and
btw, if you don't enable printk timestamping, you won't see the issue.

I'd say the simplest solution - and this is only me and I like practical
- is to accept your patch after all and stop wasting time with this :-)

Only after you fix it, though, to *not* change log levels for the other
printk message. FWIW, your change even improves the readability a bit of
those printks.

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ