From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 429EBC433EF for ; Mon, 24 Jan 2022 08:19:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232758AbiAXITF (ORCPT ); Mon, 24 Jan 2022 03:19:05 -0500 Received: from mail-ua1-f50.google.com ([209.85.222.50]:44756 "EHLO mail-ua1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbiAXITF (ORCPT ); Mon, 24 Jan 2022 03:19:05 -0500 Received: by mail-ua1-f50.google.com with SMTP id f24so29319425uab.11 for ; Mon, 24 Jan 2022 00:19:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b/c+3F2pmQ34Zp5zM0VZln6fe/9uq04UqlvKTdCwGTM=; b=fK92bjuWgOr+TnuCQj2kCGuXNSkezhrT76CpD2unY0KrvvqQ+DvDafJGYH5UAszWbf JzfygdlSSqbiCizdh3MnThVMm0v23fU3S285YPK5LmPsNedjWZY7NSlyTqRhOAezC/mY VBnNv4XWjyms0yaR9ZchvCoQ3euC1215ptCBk2OYD5a0d5iWSQrnvaQ3fE3krY6oMkg8 IV3zYi8Ra6GV4o0UxRYN5NdNVyJbF6SFgZHml4Xv00HrHbGzAnU6dgqQksvkBZKgk83J jRcVFmDhm6UczpgBTDC1RrNaEZa/kN0b4IsW8ipOHBr8GkoTa0xQTq3gQ6xmP97fTJtj zMZQ== X-Gm-Message-State: AOAM530vYS/jVDqLC4tSWgh5LpwFtdYfv2qRCVzzg36ZvqFTib9BQT4R Ghr7yYu1qcnP4bMIrUq4y6Nk7xUAg5OhMA== X-Google-Smtp-Source: ABdhPJwsbeASC/9TitGssBy1258CIs5t7bDcC/KkDa/c5SibSHk1xIJIHHM+iWPtsC/84eMgYUEdHA== X-Received: by 2002:a67:a409:: with SMTP id n9mr4879196vse.74.1643012344721; Mon, 24 Jan 2022 00:19:04 -0800 (PST) Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com. [209.85.222.42]) by smtp.gmail.com with ESMTPSA id u12sm3144846vku.9.2022.01.24.00.19.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jan 2022 00:19:04 -0800 (PST) Received: by mail-ua1-f42.google.com with SMTP id l1so27546987uap.8 for ; Mon, 24 Jan 2022 00:19:03 -0800 (PST) X-Received: by 2002:a05:6102:a04:: with SMTP id t4mr143613vsa.77.1643012343460; Mon, 24 Jan 2022 00:19:03 -0800 (PST) MIME-Version: 1.0 References: <20220112174612.10773-1-biju.das.jz@bp.renesas.com> <20220112174612.10773-11-biju.das.jz@bp.renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 24 Jan 2022 09:18:52 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 10/28] drm: rcar-du: of: Increase buff size for compatible variable To: Laurent Pinchart Cc: Biju Das , David Airlie , Daniel Vetter , Kieran Bingham , DRI Development , Linux-Renesas , Geert Uytterhoeven , Chris Paterson , Biju Das , Prabhakar Mahadev Lad Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Hi Laurent, On Sun, Jan 23, 2022 at 2:52 PM Laurent Pinchart wrote: > On Fri, Jan 14, 2022 at 11:17:19AM +0100, Geert Uytterhoeven wrote: > > On Wed, Jan 12, 2022 at 6:46 PM Biju Das wrote: > > > Increase buff size for compatible variable to avoid stack corruption > > > with RZ/G2L SoC's(renesas,du-r9a07g044l) which requires a buff size > > > more than the current allocated size. > > > > > > Signed-off-by: Biju Das > > > > Thanks for your patch! > > > > > --- a/drivers/gpu/drm/rcar-du/rcar_du_of.c > > > +++ b/drivers/gpu/drm/rcar-du/rcar_du_of.c > > > @@ -200,7 +200,7 @@ static void __init rcar_du_of_lvds_patch(const struct of_device_id *of_ids) > > > struct device_node *lvds_node; > > > struct device_node *soc_node; > > > struct device_node *du_node; > > > - char compatible[22]; > > > + char compatible[24]; > > > const char *soc_name; > > > unsigned int i; > > > int ret; > > > > What about changing the code to use kasprintf() instead, to prevent > > this from ever happening again? > > Or maybe it's time to drop this backward compatibility code altogether ? The last R-Car Gen2 DTS was converted in commit edb0c3affe5214a2 ("ARM: dts: r8a7793: Convert to new LVDS DT bindings") in v4.17. The last RZ/G1 DTS was converted in commit 6a6a797625b5fe85 ("ARM: dts: r8a7743: Convert to new LVDS DT bindings") in v5.0. Both are older than commit 58256143cff7c2e0 ("clk: renesas: Remove R-Car Gen2 legacy DT clock support") in v5.5, so I'd say let's get rid of it. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A974C433F5 for ; Mon, 24 Jan 2022 08:19:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FB0E10E160; Mon, 24 Jan 2022 08:19:07 +0000 (UTC) Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 587CD10E160 for ; Mon, 24 Jan 2022 08:19:05 +0000 (UTC) Received: by mail-ua1-f49.google.com with SMTP id 2so29433619uax.10 for ; Mon, 24 Jan 2022 00:19:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b/c+3F2pmQ34Zp5zM0VZln6fe/9uq04UqlvKTdCwGTM=; b=lfYwjT1ZShlUyf597379glADwaFTi/TWSlLMu9uO1IWxNA99HX8aDTB4oasV1CpTDU glxAUx2qqyHA6NjijYJ79upciSayGoA3I7OHMNZHVsf0FNjr5EuUkIi1c1kP73okjk5f SSpkCrt/4EZMpfGZdH5vWvkPojY7CrpTxyjih6IJ5ntElPRQMMk2qEvLeFUO6G45DqnW +yrlj2hIusMAfanai/o/OGNd+uZXjqjVN6ACcDDGdyy9UwZngKHqxGpUZr5V54flZiwF B78I16n5aVv9ppkG22agS5TpzKf/LaHvuPDoiHzxxs5yaZa+GRMjlRoS++BSJyUrqHEU ZqMg== X-Gm-Message-State: AOAM532r6bniAjCYs4w81DVgkapOPr3aXYs114FbVtCHQp3rMij0PZCQ gdnnLRmFJwtwoAZT2WsrwFvMHmCyqcB4Dg== X-Google-Smtp-Source: ABdhPJzysj5D1/8b2h63/DoAWeZ+XqqmVb5m7aVF+30p5gU7CWes64Je0nm0R0IYPxLimf9bEzV7SA== X-Received: by 2002:a67:cd86:: with SMTP id r6mr4952357vsl.19.1643012344284; Mon, 24 Jan 2022 00:19:04 -0800 (PST) Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com. [209.85.222.42]) by smtp.gmail.com with ESMTPSA id q4sm1001038vke.15.2022.01.24.00.19.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jan 2022 00:19:03 -0800 (PST) Received: by mail-ua1-f42.google.com with SMTP id y4so29449728uad.1 for ; Mon, 24 Jan 2022 00:19:03 -0800 (PST) X-Received: by 2002:a05:6102:a04:: with SMTP id t4mr143613vsa.77.1643012343460; Mon, 24 Jan 2022 00:19:03 -0800 (PST) MIME-Version: 1.0 References: <20220112174612.10773-1-biju.das.jz@bp.renesas.com> <20220112174612.10773-11-biju.das.jz@bp.renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 24 Jan 2022 09:18:52 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 10/28] drm: rcar-du: of: Increase buff size for compatible variable To: Laurent Pinchart Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Paterson , Geert Uytterhoeven , David Airlie , Prabhakar Mahadev Lad , DRI Development , Biju Das , Linux-Renesas , Kieran Bingham , Biju Das Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Laurent, On Sun, Jan 23, 2022 at 2:52 PM Laurent Pinchart wrote: > On Fri, Jan 14, 2022 at 11:17:19AM +0100, Geert Uytterhoeven wrote: > > On Wed, Jan 12, 2022 at 6:46 PM Biju Das wrote: > > > Increase buff size for compatible variable to avoid stack corruption > > > with RZ/G2L SoC's(renesas,du-r9a07g044l) which requires a buff size > > > more than the current allocated size. > > > > > > Signed-off-by: Biju Das > > > > Thanks for your patch! > > > > > --- a/drivers/gpu/drm/rcar-du/rcar_du_of.c > > > +++ b/drivers/gpu/drm/rcar-du/rcar_du_of.c > > > @@ -200,7 +200,7 @@ static void __init rcar_du_of_lvds_patch(const struct of_device_id *of_ids) > > > struct device_node *lvds_node; > > > struct device_node *soc_node; > > > struct device_node *du_node; > > > - char compatible[22]; > > > + char compatible[24]; > > > const char *soc_name; > > > unsigned int i; > > > int ret; > > > > What about changing the code to use kasprintf() instead, to prevent > > this from ever happening again? > > Or maybe it's time to drop this backward compatibility code altogether ? The last R-Car Gen2 DTS was converted in commit edb0c3affe5214a2 ("ARM: dts: r8a7793: Convert to new LVDS DT bindings") in v4.17. The last RZ/G1 DTS was converted in commit 6a6a797625b5fe85 ("ARM: dts: r8a7743: Convert to new LVDS DT bindings") in v5.0. Both are older than commit 58256143cff7c2e0 ("clk: renesas: Remove R-Car Gen2 legacy DT clock support") in v5.5, so I'd say let's get rid of it. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds