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]
Message-ID: <df5d7450de9f4382b1cb43791f69e25c@BL2FFO11FD013.protection.gbl>
Date:	Fri, 16 Jan 2015 11:37:01 +0100
From:	Michal Simek <michal.simek@...inx.com>
To:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Michal Simek <michal.simek@...inx.com>,
	<linux-kernel@...r.kernel.org>, <monstr@...str.eu>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	<linux-serial@...r.kernel.org>, Jiri Slaby <jslaby@...e.cz>,
	Peter Hurley <peter@...leysoftware.com>,
	Alan Cox <alan@...ux.intel.com>,
	Tony Lindgren <tony@...mide.com>,
	Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>,
	Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 2/2] tty: serial: 8250_core: Check that port->line is
 >=0

Hi,

On 01/16/2015 10:00 AM, Sebastian Andrzej Siewior wrote:
> On 01/15/2015 03:55 PM, Michal Simek wrote:
>> This patch should be the part of:
>> "tty: serial: 8250_core: use the ->line argument as a hint in
>> serial8250_find_match_or_unused()"
>> (sha1: 59b3e898ddfc81a65975043b5eb44103cc29ff6e)
>>
>> port->line can be setup by DT driver to -1 which needs to
>> be also checked.
> 
> This is what I have in 8250_omap to make sure it does not get < 0:
> 
>          if (pdev->dev.of_node) {
>                  ret = of_alias_get_id(pdev->dev.of_node, "serial");
> 
>                  of_property_read_u32(pdev->dev.of_node, "clock-frequency",
>                                       &up.port.uartclk);
>                  priv->wakeirq = irq_of_parse_and_map(pdev->dev.of_node, 1);
>          } else {
>                  ret = pdev->id;
>          }
>          if (ret < 0) {
>                  dev_err(&pdev->dev, "failed to get alias/pdev id\n");
>                  return ret;
>          }
>          up.port.line = ret;
> 
> but I didn't think of that others might pass < 0 since it wasn't used
> before.
> Does the original patch (you noted) break anything as of now? Because
> then this patch should go stable.

Origin patch looks good to me but this checking will be good to add.
Are you using of_serial.c because I didn't find any of_alias_get_id call
for 8250?

Your logic here is a little bit different than I have in my tree.
(Some sort of pl011 solution). You don't need to failed if you port.line is
below 0 but if you are not able to read aliases port enumeration
may be unpredictable.

Thanks,
Michal




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