lkml.org 
[lkml]   [2015]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/6] staging: vme_user: provide DMA functionality
On Fri, May 22, 2015 at 01:12:19AM +0300, Dmitry Kalinkin wrote:
> On Tue, May 19, 2015 at 12:18 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Mon, May 18, 2015 at 09:56:33PM +0300, Dmitry Kalinkin wrote:
> >>
> >> + for_each_sg(sgt->sgl, sg, sg_count, i) {
> >> + struct vme_dma_attr *pci_attr, *vme_attr, *dest, *src;
> >> + dma_addr_t hw_address = sg_dma_address(sg);
> >> + unsigned int hw_len = sg_dma_len(sg);
> >> +
> >> + vme_attr = vme_dma_vme_attribute(dma_op->vme_addr + pos,
> > ^^^^^^^^^^^^^^^^^^^^^^
> >
> > ->vme_addr comes from the user and we don't seem to have done any
> > validation that it's correct. This addition can overflow. How is this
> > safe? (This is not a rhetorical question, I am a newbie in this).
> >
> This expression calculates address on the VME bus, where we already have
> full access. There shouldn't have security implications. Such transfer will
> most likely wrap or cause DMA transfer error (gives EIO).

Ahh... Thanks. Again I was just asking because I'm a bit of a newbie
here so there wasn't really a need to add the other check just to make
me happy. But I do like the new check as well.

regards,
dan carpenter



\
 
 \ /
  Last update: 2015-05-22 10:41    [W:0.055 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site