OSDN Git Service

fbdev: msm: Avoid UAF in mdss_dsi_cmd_write
authorNirmal Abraham <nabrah@codeaurora.org>
Fri, 16 Aug 2019 11:09:17 +0000 (16:39 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 16 Oct 2019 05:42:19 +0000 (22:42 -0700)
commit6dec23e2d32dd103cb6ece90a831f3bb224a8f4f
tree6ceeae4bff69f964639446b567caa24cb6a9d418
parentc65b9585249986588b205fbed6eda20924423e72
fbdev: msm: Avoid UAF in mdss_dsi_cmd_write

In mdss_dsi_cmd_write, a failure in copying the cmds to
'string_buf' can cause an early return. In this case,
the 'pcmds->string_buf' won't be pointing to a valid
buffer. This can lead to use-after-free and memory leak.
To avoid this, assign the newly allocated buffer to
'pcmds->string_buf' after returning from krealloc call.

Change-Id: I286f12c86078d1989cb09453c8a395a4ad94b324
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
drivers/video/fbdev/msm/mdss_dsi.c