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:	Thu, 09 Sep 2010 00:23:55 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	"H. Peter Anvin" <hpa@...or.com>
CC:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	Torsten Kaiser <just.for.lkml@...glemail.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] x86, setup: fix earlyprintk=serial,0x3f8,115200

On 09/08/2010 02:28 PM, H. Peter Anvin wrote:
> On 08/29/2010 06:13 PM, Yinghai Lu wrote:
>>
>> earlyprintk could take io port.
>>
>> So we need to handle this case in setup code too, otherwise 0x3f8
>> will be treated as baud rate.
>>
> 
> What about a non-hexadecimal port?  It seems more logical to me to move
> the strncmp() up and test that before using simple_strtoull().

non-hex is not supported...

in arch/x86/kernel/early_printk.c
static __init void early_serial_init(char *s)
{
        unsigned char c;
        unsigned divisor;
        unsigned baud = DEFAULT_BAUD;
        char *e;

        if (*s == ',')
                ++s;

        if (*s) {
                unsigned port;
                if (!strncmp(s, "0x", 2)) {
                        early_serial_base = simple_strtoul(s, &e, 16);
                } else {
                        static const int __initconst bases[] = { 0x3f8, 0x2f8 };

                        if (!strncmp(s, "ttyS", 4))
                                s += 4;
                        port = simple_strtoul(s, &e, 10);
                        if (port > 1 || s == e)
                                port = 0;
                        early_serial_base = bases[port];
                }
                s += strcspn(s, ",");
                if (*s == ',')
                        s++;
        }

so it check 0x too.


Yinghai
--
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