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]
Message-ID: <CAFqH_53UadupCtjFe-9h4Qr=JQuzM1Wa=octA0=ap8RBbS6zPQ@mail.gmail.com>
Date:   Wed, 23 Jan 2019 12:33:22 +0100
From:   Enric Balletbo Serra <eballetbo@...il.com>
To:     Moritz Fischer <mdf@...nel.org>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Benson Leung <bleung@...omium.org>,
        Guenter Roeck <groeck@...omium.org>,
        Lee Jones <lee.jones@...aro.org>,
        Moritz Fischer <moritz@...us.com>
Subject: Re: [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for
 I2C/SPI based ECs

Missatge de Moritz Fischer <mdf@...nel.org> del dia dt., 22 de gen.
2019 a les 22:09:
>
> Hi Enrico,
>
> On Mon, Jan 21, 2019 at 11:19:34PM +0100, Enric Balletbo Serra wrote:
> > I tried with a Samsung Chromebook Plus (arm64 Chromebook)
> >
> > > What was the ioctl you ran?
> > >
> >
> > The code that I ran is this: https://hastebin.com/cupecuvowi.py
> > No guarantee :) I'll try to look deeper tomorrow.
>
> I fixed it up to run with python3, but on my device I got either a
> protocol error if len is > 120:
>
> root@...n3xx-313ABDC:~# python3 foo
> Testing EC_DEV_IOCRDMEM cmd
> I/O error(71): Protocol error
>
> or it worked for lengths <= 120:
>
> root@...n3xx-313ABDC:~# python3 foo
> Testing EC_DEV_IOCRDMEM cmd
> 6b 6f ff ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f f0 0f ff ff ff ff
> ff ff ff ff ff ff ff ff 45 43 01 02 00 01 01 00 00 00 00 00 00 00 00 00
> 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> [...]
>
> Did you try smaller reads? If that works maybe we'll have to filter in
> the kernel to prevent large reads from crashing the EC?
>

So looks like I can read up to 161 bytes, if I read 162 to 169 bytes
the EC fails to respond and if I read more than 169 bytes it simply
resets the machine. I didn't look the code yet.

root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 160
Testing EC_DEV_IOCRDMEM cmd (size 160)
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 45 43 01 00 01 01 01 00 00 00 00 00 00 00
00 00
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9f 21 00 00 0e 01 00
00 59 13 00 00 0b 00 00 00 14 14 00 00 b0 1d 00 00 9a 13 00 00 35 01
00 00
53 44 49 00 00 00 00 00 34 33 35 32 44 35 31 00 30 46 38 32 00 00 00
00 4c 49 4f 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 161
Testing EC_DEV_IOCRDMEM cmd (size 161)
[  425.053205] cros-ec-spi spi2.0: cannot read mapped reg: -71/14
I/O error(71): Protocol error
root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 162
Testing EC_DEV_IOCRDMEM cmd (size 162)
[  427.208065] cros-ec-spi spi2.0: cannot read mapped reg: -71/14
I/O error(71): Protocol error

root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 163
Testing EC_DEV_IOCRDMEM cmd (size 163)
[  429.845069] cros-ec-spi spi2.0: cannot read mapped reg: -71/14
I/O error(71): Protocol error
root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 164
Testing EC_DEV_IOCRDMEM cmd (size 164)[  431.968014] cros-ec-spi
spi2.0: cannot read mapped reg: -71/14

I/O error(71): Protocol error

root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 165
Testing EC_DEV_IOCRDMEM cmd (size 165)
[  440.289340] cros-ec-spi spi2.0: EC failed to respond in time
[  440.296271] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  440.302732] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 166
Testing EC_DEV_IOCRDMEM cmd (size 166)
[  443.953212] cros-ec-spi spi2.0: EC failed to respond in time
[  443.960095] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  443.966554] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@...ian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 167
Testing EC_DEV_IOCRDMEM cmd (size 167)
[  446.585416] cros-ec-spi spi2.0: EC failed to respond in time
[  446.592335] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  446.598798] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@...ian:~# python /home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 168
Testing EC_DEV_IOCRDMEM cmd (size 168)
[  449.337255] cros-ec-spi spi2.0: EC failed to respond in time
[  449.344140] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  449.350588] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@...ian:~# python /home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 169
Testing EC_DEV_IOCRDMEM cmd (size 169)
l%(NAPEK@       @%vZ__|+~/g?sڬ}mj}u??UwWo;_ۻI6go{]uw]{m}w.ͼ�ߵ

And the machine reboots ...


> Thanks,
>
> Moritz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ