[PATCH 2/4] ivi-controller: wait clients before freeing ivilayer

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Tue Mar 29 09:37:01 EDT 2016


We have to wait before freeing ivilayer that all clients destroy
their proxies. Otherwise, a client could send an event to the ivilayer
just after we destroyed it. This would cause a race condition and
potentially SEGV.

Furthermore, the layout_layer pointer of ivilayer set to NULL after
ivilayer freed in the old implementation. Therefore, old implementation
writes 4 bytes to invalid location. This implementation also solves the
invalid write problem by moving the free code.

Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
---
 weston-ivi-shell/src/ivi-controller-impl.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Best regards

Emre Ucan

Advanced Driver Information Technology GmbH
Software Group I (ADITG/SW1)
Robert-Bosch-Str. 200
31139 Hildesheim
Germany

Tel. +49 5121 49 6937
Fax +49 5121 49 6999
eucan at de.adit-jv.com

ADIT is a joint venture company of Robert Bosch GmbH/Robert Bosch Car Multimedia GmbH and DENSO Corporation
Sitz: Hildesheim, Registergericht: Amtsgericht Hildesheim HRB 3438
Geschaeftsfuehrung: Wilhelm Grabow, Ken Yaguchi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ivi-controller-wait-clients-before-freeing-ivilayer.patch
Type: application/octet-stream
Size: 1643 bytes
Desc: 0002-ivi-controller-wait-clients-before-freeing-ivilayer.patch
URL: <http://lists.genivi.org/pipermail/genivi-ivi-layer-management_lists.genivi.org/attachments/20160329/b6226e4a/attachment.patch>


More information about the genivi-ivi-layer-management mailing list