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-next>] [day] [month] [year] [list]
Date:   Thu, 30 Apr 2020 10:38:02 +1000
From:   Daniil Lunev <dlunev@...omium.org>
To:     Enric Balletbo i Serra <enric.balletbo@...labora.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Prashant Malani <pmalani@...omium.org>,
        Benson Leung <bleung@...omium.org>,
        Guenter Roeck <groeck@...omium.org>
Subject: Re: [PATCH] platform/chrome: cros_ec_typec: Handle NULL EC pointer
 during probe.

[to make it appear on the mailing list as I didn't realize I was in
hypertext sending mode]

On Thu, Apr 30, 2020 at 10:11 AM Daniil Lunev <dlunev@...omium.org> wrote:
>
> Hi Enric.
> I encountered the issue on a Hatch device when trying running 5.4 kernel on that. After talking to Prashant it seems that any device with coreboot built before a certain point (a particular fix for device hierarchy in ACPI tables of Chrome devices which happened in mid-April) will not be able to correctly initialize the driver and will get a kernel panic trying to do so.
> Thanks,
> Daniil
>
> On Thu, Apr 30, 2020 at 7:58 AM Enric Balletbo i Serra <enric.balletbo@...labora.com> wrote:
>>
>> Hi Daniil,
>>
>> Thank you for the patch.
>>
>> On 28/4/20 3:02, Daniil Lunev wrote:
>> > Missing EC in device hierarchy causes NULL pointer to be returned to the
>> > probe function which leads to NULL pointer dereference when trying to
>> > send a command to the EC. This can be the case if the device is missing
>> > or incorrectly configured in the firmware blob. Even if the situation
>>
>> There is any production device with a buggy firmware outside? Or this is just
>> for defensive programming while developing the firmware? Which device is
>> affected for this issue?
>>
>> Thanks,
>>  Enric
>>
>> > occures, the driver shall not cause a kernel panic as the condition is
>> > not critical for the system functions.
>> >
>> > Signed-off-by: Daniil Lunev <dlunev@...omium.org>
>> > ---
>> >
>> >  drivers/platform/chrome/cros_ec_typec.c | 5 +++++
>> >  1 file changed, 5 insertions(+)
>> >
>> > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
>> > index 874269c07073..30d99c930445 100644
>> > --- a/drivers/platform/chrome/cros_ec_typec.c
>> > +++ b/drivers/platform/chrome/cros_ec_typec.c
>> > @@ -301,6 +301,11 @@ static int cros_typec_probe(struct platform_device *pdev)
>> >
>> >       typec->dev = dev;
>> >       typec->ec = dev_get_drvdata(pdev->dev.parent);
>> > +     if (!typec->ec) {
>> > +             dev_err(dev, "Failed to get Cros EC data\n");
>> > +             return -EINVAL;
>> > +     }
>> > +
>> >       platform_set_drvdata(pdev, typec);
>> >
>> >       ret = cros_typec_get_cmd_version(typec);
>> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ