Skip to content

Commit

Permalink
staging: comedi: don't dereference user memory for INSN_INTTRIG
Browse files Browse the repository at this point in the history
`parse_insn()` is dereferencing the user-space pointer `insn->data`
directly when handling the `INSN_INTTRIG` comedi instruction.  It
shouldn't be using `insn->data` at all; it should be using the separate
`data` pointer passed to the function.  Fix it.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ian-abbott authored and gregkh committed Sep 19, 2012
1 parent 9f82e95 commit 5d06e3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn,
ret = -EAGAIN;
break;
}
ret = s->async->inttrig(dev, s, insn->data[0]);
ret = s->async->inttrig(dev, s, data[0]);
if (ret >= 0)
ret = 1;
break;
Expand Down

0 comments on commit 5d06e3d

Please sign in to comment.