Skip to content

Commit

Permalink
msm: mdss: Fix potential buffer overflow
Browse files Browse the repository at this point in the history
arg_cfg has a size of MDSS_MAX_PANEL_LEN + 1, whereas panel_cfg has
a size of MDSS_MAX_PANEL_LEN, meaning there could be an oveflow.
Oddly enough, this was only detected by GCC and not Clang, making me
think Clang is doing some behind the scenes optimization but that
doesn't make it any less of a bug.

This was detected by CONFIG_FORTIFY_SOURCE.

Reported-by: Kristof Petho <kristof.petho@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: khusika <khusikadhamar@gmail.com>
  • Loading branch information
nathanchance authored and khusika committed Aug 28, 2018
1 parent 655cfae commit 209ced8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/msm/mdss/mdss_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3021,7 +3021,7 @@ static struct device_node *mdss_dsi_config_panel(struct platform_device *pdev,
int ndx)
{
struct mdss_dsi_ctrl_pdata *ctrl_pdata = platform_get_drvdata(pdev);
char panel_cfg[MDSS_MAX_PANEL_LEN];
char panel_cfg[MDSS_MAX_PANEL_LEN + 1];
struct device_node *dsi_pan_node = NULL;
int rc = 0;

Expand Down

0 comments on commit 209ced8

Please sign in to comment.