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 5FF6EC433EF for ; Fri, 14 Jan 2022 10:17:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239524AbiANKRc (ORCPT ); Fri, 14 Jan 2022 05:17:32 -0500 Received: from mail-ua1-f54.google.com ([209.85.222.54]:38456 "EHLO mail-ua1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236985AbiANKRb (ORCPT ); Fri, 14 Jan 2022 05:17:31 -0500 Received: by mail-ua1-f54.google.com with SMTP id h11so16109508uar.5 for ; Fri, 14 Jan 2022 02:17:31 -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=n/k7QX5xJRfyMxEBsWvg+WGjqrbJJEYkdAPVqldbfhI=; b=QVlSqg2389mRN9aqxUlwruawkfj9jRUcpX0qFg9XY96VYOy2AUwGBag7vyDz5hTRUl yymrSXBB0ZpRe6Em7cmRtB9PP3+wlONR/uSVwgf7lUqeMPxwKvEuI5+ArXmkSiM3afRq cRCLYbTuxSl54+VGrkl5kmi4vTZc/+IXjidok1reOACU/SBbBus9gVhqrK6zcPHD3CTG KrCjPExrMhtDt7V0px+9naigAF3mMZM+f7m+Wt5VZAPE8U5uyHZPvBMxfR8xeCeuivj5 5a4Y5t5tPi+esIanibAx+PKm3OuPDs3H5O7hKC/OPcyOMUN35xYBzpV05eITpwr3ppYv htYw== X-Gm-Message-State: AOAM533MVR1MMNJCzkIc3W0nieF9lg1ZpVxM2DMOp14lCEPApsMetiM7 Ztlixhj62CJ3k5pHmkqW5WIr92WX5dogcn3N X-Google-Smtp-Source: ABdhPJzdDO6OWQ8qJQFKPe1trMjfbLaRGjUjYrVTnyo+l2pUJkCobgwz+cZF9vwwoL0Oh09JWsfF3A== X-Received: by 2002:a9f:244f:: with SMTP id 73mr3990812uaq.10.1642155450930; Fri, 14 Jan 2022 02:17:30 -0800 (PST) Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com. [209.85.222.46]) by smtp.gmail.com with ESMTPSA id s32sm2226684uas.3.2022.01.14.02.17.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Jan 2022 02:17:30 -0800 (PST) Received: by mail-ua1-f46.google.com with SMTP id l15so16020752uai.11 for ; Fri, 14 Jan 2022 02:17:30 -0800 (PST) X-Received: by 2002:a67:e905:: with SMTP id c5mr3785219vso.68.1642155450169; Fri, 14 Jan 2022 02:17:30 -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: <20220112174612.10773-11-biju.das.jz@bp.renesas.com> From: Geert Uytterhoeven Date: Fri, 14 Jan 2022 11:17:19 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 10/28] drm: rcar-du: of: Increase buff size for compatible variable To: Biju Das Cc: David Airlie , Daniel Vetter , Laurent Pinchart , 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 Biju, 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? 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 1DAEAC433F5 for ; Fri, 14 Jan 2022 10:17:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4141A10E398; Fri, 14 Jan 2022 10:17:33 +0000 (UTC) Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id 816DD10E398 for ; Fri, 14 Jan 2022 10:17:32 +0000 (UTC) Received: by mail-vk1-f176.google.com with SMTP id g5so5588310vkg.0 for ; Fri, 14 Jan 2022 02:17:32 -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=n/k7QX5xJRfyMxEBsWvg+WGjqrbJJEYkdAPVqldbfhI=; b=GdJEfrBYu32BC1bOzB1VoZ+U5+BPDRSLMq7amXn5PhGh7+HvKrFv3Po+6MjUwdBDKy U/updqlp/tiawuMidOzZ4JSTBkzkWBEp/sXlSKsex53kBw/tLrClqunkCbqoP8cLkhwM S3NtbTf8Eg9QKZub1BQWNwY32pta27jm1LeGkTYPIMPU1FUcv6K+FVulgW1NV2Ant1Fq 3/lGA7Xj25rZFNup6x4JSU8En+EELiZsJpDNYHC+t3C+uQWYF+1+EO9ZGaiHECfztnXe euPC2s8kd3t2DGcE+OEYKlu72VLXTEVHg/7g0QGNYK5miRDlLCNLg4BAodECRmMx0Ex7 SNPA== X-Gm-Message-State: AOAM530QcTiZxrfV+xi82mrhXUF42dKlIEnE+j934/zJ0Njn4NVAppBM 0ULpWabgeVXkKQCzJ/capeb8U/ikYZ6c4h4/ X-Google-Smtp-Source: ABdhPJwTbjnqahMUFjyVsd+mV0om+rNsVh/hJLqNNiPyiTYyRG6Sspn4L68kwm9K28MC57rSUne3mw== X-Received: by 2002:a1f:2e4b:: with SMTP id u72mr4043026vku.4.1642155451374; Fri, 14 Jan 2022 02:17:31 -0800 (PST) Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com. [209.85.222.46]) by smtp.gmail.com with ESMTPSA id g43sm2096728uae.2.2022.01.14.02.17.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Jan 2022 02:17:30 -0800 (PST) Received: by mail-ua1-f46.google.com with SMTP id c36so15996919uae.13 for ; Fri, 14 Jan 2022 02:17:30 -0800 (PST) X-Received: by 2002:a67:e905:: with SMTP id c5mr3785219vso.68.1642155450169; Fri, 14 Jan 2022 02:17:30 -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: <20220112174612.10773-11-biju.das.jz@bp.renesas.com> From: Geert Uytterhoeven Date: Fri, 14 Jan 2022 11:17:19 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 10/28] drm: rcar-du: of: Increase buff size for compatible variable To: Biju Das 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 , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Biju, 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? 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