[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANLsYkwgo0pQFAvdO+dbPxYUqqj0xWoa_i_RkX2bWJYv-UOvHg@mail.gmail.com>
Date: Wed, 23 Dec 2015 09:33:11 -0700
From: Mathieu Poirier <mathieu.poirier@...aro.org>
To: Rabin Vincent <rabin@....in>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Chunyan Zhang <zhang.chunyan@...aro.org>,
Mike Leach <mike.leach@....com>,
"Jeremiassen, Tor" <tor@...com>, Al Grant <al.grant@....com>,
fainelli@...adcom.com,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, linux-doc@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V7 17/24] coresight: etb10: implementing AUX space API
On 19 December 2015 at 10:23, Rabin Vincent <rabin@....in> wrote:
> On Fri, Dec 18, 2015 at 01:59:13PM -0700, Mathieu Poirier wrote:
>> +static void etb_update_buffer(struct coresight_device *csdev,
>> + struct perf_output_handle *handle,
>> + void *sink_config)
>> +{
>> + int i, cur;
>> + u32 *buf_ptr;
>
> ...
>
>> + for (i = 0; i < to_read; i += 4) {
>> + buf_ptr = buf->data_pages[cur] + offset;
>> + read_data = readl_relaxed(drvdata->base +
>> + ETB_RAM_READ_DATA_REG);
>> + *buf_ptr++ = read_data >> 0;
>> + *buf_ptr++ = read_data >> 8;
>> + *buf_ptr++ = read_data >> 16;
>> + *buf_ptr++ = read_data >> 24;
>
> buf_ptr should either be changed to a u8* or just the first write should
> be present. Otherwise this overwrites lots of memory.
Good catch!
>
>> +
>> + offset += 4;
>> + if (offset >= PAGE_SIZE) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists