summaryrefslogtreecommitdiff
path: root/include/memory
diff options
context:
space:
mode:
authorMuchun Song <smuchun@gmail.com>2018-11-01 21:12:50 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-12 19:46:57 +0100
commit3555de57dca4e8881a4d791b2508709ed37e27ad (patch)
treef1f48b20f1cd190bc2193b637a6ff90cb17bc995 /include/memory
parent9e4b0f77173524543b57140d416706625282641e (diff)
gpiolib: Fix possible use after free on label
[ Upstream commit 18534df419041e6c1f4b41af56ee7d41f757815c ] gpiod_request_commit() copies the pointer to the label passed as an argument only to be used later. But there's a chance the caller could immediately free the passed string(e.g., local variable). This could trigger a use after free when we use gpio label(e.g., gpiochip_unlock_as_irq(), gpiochip_is_requested()). To be on the safe side: duplicate the string with kstrdup_const() so that if an unaware user passes an address to a stack-allocated buffer, we won't get the arbitrary label. Also fix gpiod_set_consumer_name(). Signed-off-by: Muchun Song <smuchun@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/memory')
0 files changed, 0 insertions, 0 deletions