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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Feb 2019 19:25:55 +0100
From:   Hugo Lefeuvre <hle@....eu.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Jiri Slaby <jslaby@...e.com>, linux-kernel@...r.kernel.org,
        Paul Hardwick <p.hardwick@...ion.com>
Subject: Re: [PATCH] tty/nozomi: use pci_iomap instead of ioremap_nocache

(cc-ing Paul Hardwick, mentioned as maintainer of the driver)

Hi,

> > there's still something unclear to me about dc->card_type being used as
> > size argument to ioremap_nocache().
> > 
> > dc->base_addr is the sum of all six io region lengths, not the size of
> > region 0 which we are trying to map here. Why not using the size of region
> > 0 instead ?
> 
> No idea, that might just be how the card is layed out.
> 
> > If the goal is to map all six regions "at once", I'm not sure how this is
> > supposed to work. Is there any kind of guarantee that all six regions will
> > be adjacent?
> 
> For some reason, it must happen that way, otherwise the driver would not
> work very well :)
> 
> > If this is a bug then this patch "somehow" already adresses it since
> > pci_iomap calls pci_resource_len itself. Otherwise this patch is broken.
> 
> Let's apply it and see if anyone screams...

Hum, it looks very much like the intention here was to map all bars at
once.

The offsets corresponding to the downlink, uplink, etc. regions are
retrieved as part of the config table by nozomi_read_config_table().

Unfortunately I don't own test devices, so I will not be able to verify it
myself. This is easy to test, though: if I am right, this patch breaks the
driver.

I guess the right way to map all bars in a single buffer would look like
what the hifn_795x driver does[0].

I will provide a patch if somebody is available to test it.

regards,
 Hugo

[0] https://elixir.bootlin.com/linux/latest/source/drivers/crypto/hifn_795x.c#L2504

-- 
                Hugo Lefeuvre (hle)    |    www.owl.eu.com
RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD
ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ