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: <c51610f4-2bae-d5d0-1084-5d7079ed0b82@gmail.com>
Date:   Wed, 19 Dec 2018 17:20:33 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Marek Vasut <marex@...x.de>, netdev@...r.kernel.org
Cc:     andrew@...n.ch, Tristram Ha <Tristram.Ha@...rochip.com>,
        Woojung Huh <Woojung.Huh@...rochip.com>
Subject: Re: [RFT][PATCH 4/7] net: dsa: microchip: Remove dev->txbuf

On 12/19/18 5:06 PM, Marek Vasut wrote:
> Previous patches unconver that ksz_spi_write() is always ever called
> with len = 1, 2 or 4. We can thus drop the if (len > SPI_TX_BUF_LEN)
> check and we can also drop the allocation of the txbuf which is part
> of the driver data. This wastes 256 bytes for no reason and can be
> replaced with 8-byte stack allocated buffer, which is what this patch
> does. This is an intermediate step though, which will go away after
> regmap conversion.

dev is a kmalloc'd buffer, so dev->txbuf is a DMA-able buffer, that
could be presumably why it was used in the first place, DMA from the
stack is not something safe, but I did not check the core SPI layer or
the SPI bus master driver to see whether they do take care of that already.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ