]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: don't dereference user memory for INSN_INTTRIG
authorIan Abbott <abbotti@mev.co.uk>
Tue, 18 Sep 2012 18:46:58 +0000 (19:46 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 17 Oct 2012 02:48:36 +0000 (03:48 +0100)
commit 5d06e3df280bd230e2eadc16372e62818c63e894 upstream.

`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.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/staging/comedi/comedi_fops.c

index 4ad2c0efc5c414b52fa9308c04825cbb8319c61c..c08c7190426a5eaf142bd90f90ff7b0c09fba450 100644 (file)
@@ -843,7 +843,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;