OSDN Git Service

greybus: es1/2: fix use-after-free in completion callback
authorJohan Hovold <johan@hovoldconsulting.com>
Sat, 26 Sep 2015 21:37:59 +0000 (14:37 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 29 Sep 2015 17:09:06 +0000 (19:09 +0200)
commit58c85123d9a1801af2558a0c925d90fe1599c27f
tree6584a1ad3f76b2da1d57f33929e7dbf8ad943c7d
parent336dfeaba1f6dd3b07571e0010707f716a1c6ee8
greybus: es1/2: fix use-after-free in completion callback

Reset the hcpriv field before returning the message to greybus core in
the OUT-URB completion callback.

This fixes a use-after-free bug when sending responses to incoming
requests as the final reference is then dropped when the message is
returned.

Reported-by: Michael Scott <michael.scott@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/es1.c
drivers/staging/greybus/es2.c