Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1329256

Re: [PATCH] spi: Fix incomplete handling of SPI_MASTER_MUST_RX/_MUST_TX

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] spi: Fix incomplete handling of SPI_MASTER_MUST_RX/_MUST_TX
Date 2016-02-08 17:20 +0100
Message-ID <qZWHE-7Fq-17@gated-at.bofh.it> (permalink)
References <qXviy-17S-15@gated-at.bofh.it> <qXvVg-1G5-31@gated-at.bofh.it> <qYGOC-4b1-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Fri, Feb 05, 2016 at 10:30:24AM +0530, Purna Chandra Mandal wrote:

Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns.  Doing this makes your messages much
easier to read and reply to.

> Idea is good, but not sufficient.
> Dummy buffers are _reallocated_ to accommodate larger size of transfer. In this if
> [originally NULL] .rx_buf/.tx_buf is not reset back to NULL after the transfer
> is over spi-core will find those .rx/tx_buf non-NULL in next _transfer() call and
> will pass the stale rx/tx_buf to spi controller driver which will definitely
> corrupt the memory and crash the system.

This needs to be clear to readers; a fairly obvious way of dealing with
this would be to rellocate down to a page rather than freeing.

> Above all the whole design depends on trust that core will not play with any data-structure
> which will break object-oriented/layered approach. So better to undo the modification
> (when needed to facilitate some functionality) unless core wants those information to be passed
> back to caller/client for reporting success or error or else.

That's really not the case, we already make a range of other
modifications to complete partially filled transfers in order to
simplify driver code.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] spi: Fix incomplete handling of SPI_MASTER_MUST_RX/_MUST_TX Joshua Henderson <joshua.henderson@microchip.com> - 2016-02-01 23:40 +0100
  Re: [PATCH] spi: Fix incomplete handling of  SPI_MASTER_MUST_RX/_MUST_TX Mark Brown <broonie@kernel.org> - 2016-02-02 00:20 +0100
    Re: [PATCH] spi: Fix incomplete handling of  SPI_MASTER_MUST_RX/_MUST_TX Purna Chandra Mandal <purna.mandal@microchip.com> - 2016-02-05 06:10 +0100
      Re: [PATCH] spi: Fix incomplete handling of  SPI_MASTER_MUST_RX/_MUST_TX Mark Brown <broonie@kernel.org> - 2016-02-08 17:20 +0100

csiph-web