Skip to content

Commit 37cee48

Browse files
azeemshaikh38robertfoss
authored andcommitted
drm/bridge: dw-hdmi: Replace all non-returning strlcpy with strscpy
strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No return values were used, so direct replacement is safe. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] KSPP#89 Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Robert Foss <rfoss@kernel.org> Signed-off-by: Robert Foss <rfoss@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230522155210.2336690-1-azeemshaikh38@gmail.com
1 parent 1464e48 commit 37cee48

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static struct i2c_adapter *dw_hdmi_i2c_adapter(struct dw_hdmi *hdmi)
533533
adap->owner = THIS_MODULE;
534534
adap->dev.parent = hdmi->dev;
535535
adap->algo = &dw_hdmi_algorithm;
536-
strlcpy(adap->name, "DesignWare HDMI", sizeof(adap->name));
536+
strscpy(adap->name, "DesignWare HDMI", sizeof(adap->name));
537537
i2c_set_adapdata(adap, hdmi);
538538

539539
ret = i2c_add_adapter(adap);

0 commit comments

Comments
 (0)