OSDN Git Service

leds: qpnp-flash: Fix Use-after-free(UAF) for debugfs
authorAnkit Sharma <ansharma@codeaurora.org>
Sat, 28 Oct 2017 08:59:02 +0000 (14:29 +0530)
committerAnirudh Ghayal <aghayal@codeaurora.org>
Sat, 28 Oct 2017 08:59:50 +0000 (14:29 +0530)
commitd851b06217392b0d56133aca2df010e9703c1b3f
treec43ecab0eec2c487e748d42a58236adf3a97c916
parent31c9729a258a6495a344e2ec692e43fab9a0db87
leds: qpnp-flash: Fix Use-after-free(UAF) for debugfs

Fix UAF where two threads can open and close the same file. Second
open will cause the private data for the first file to be overwritten.
When the first file is closed and the private data is freed, this makes
the now-shared private data OOB for the second thread.

CRs-Fixed: 1109763
Change-Id: I1c4618d5be99e140abf0f3ea0d7f485897db5ab2
Signed-off-by: Ankit Sharma <ansharma@codeaurora.org>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
drivers/leds/leds-qpnp-flash.c