Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1253097imm; Fri, 29 Jun 2018 14:26:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIRaOLSxfX+lWOeage/pMrXRPl6PPohR3Y4dhh9LMWCwKNGWus1UAwyjt1IsPj6ooufBT3c X-Received: by 2002:a65:448c:: with SMTP id l12-v6mr13553567pgq.277.1530307578978; Fri, 29 Jun 2018 14:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530307578; cv=none; d=google.com; s=arc-20160816; b=yt1qBcgZOwpx0BcfWAL2xO7YYVJEXPeEzKsfK5tDEthGKS2Qy1Vta2Z+KxmjqlzMpY moMnzvoKvWIjIZ1B2h8WwZNbPvXG1ZT6Ky8f/DrP6TjukjpD9s3YUbbce3s6inoxzsfb bTiJrpGPQbzF5MLK92Fbo+Y3nRrmkyRaWZqb2sbAEDLbZy10saBPcv02aCcoPcjjRqQT QYDVwvgf+JN0vsQmiD91P8N9sze47832seP1RKpWPcFRNN22irUJVS+0UaZJfCFdX64Q lubWBoLa1bRp+pC1kDAatrL3pFxnc/14wE7SSebyMmM7IOlrM6IWFVr/Ba1/YbJjTj3c K5oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=9u8OmTXckovepNhBwV8VYNcNxsh6sg2XB96k6XP0ljw=; b=ryl3x1v719ZpsBcWauPQGbJY1NE+ElBdKarBkKOrm6i2VPgTplY9ZCFalLE2MSh3NS K5ClNV5wDc2J1uorLttRseHb5qlwD9kHBgP1DGmdwYqK3qLeO8WV6T6XQI3DSL1cR3r5 GQ+YYvLrvgytmKn0Qq02bferPK8JGSpqDKhRoMtMUhFPOBuhxlr37U2HojJEr1EzYrbp e14kOqR2zIKXjprdnzZy5gFnD+xXkoqdOhrt8PtJ2Fjxq2DN9eN47PlWFHyVKcy37yeE j0/vKb+vXqxG4AKulusnRu9ePZjygVsv21lwbm8H/TDgeTcGjORWGbL59U6++r/2f2IU ERjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SuDLjSD7; dkim=pass header.i=@codeaurora.org header.s=default header.b=TX8KX6OD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si8813224pgc.522.2018.06.29.14.26.04; Fri, 29 Jun 2018 14:26:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SuDLjSD7; dkim=pass header.i=@codeaurora.org header.s=default header.b=TX8KX6OD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936161AbeF2VTl (ORCPT + 99 others); Fri, 29 Jun 2018 17:19:41 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52052 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932708AbeF2VTj (ORCPT ); Fri, 29 Jun 2018 17:19:39 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 27BA460452; Fri, 29 Jun 2018 21:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530307179; bh=YMjL9Fg/cw9cvnuXQGBGm2QzHTsC1Qt/iJGYMGYk8qM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SuDLjSD76MF7rSlnus4LxKGDHBoHAet226CRRQ3rOHX8FQztL5G5gywwTHY8g6sqF uvnsLsNLswpRoCRd0/Y+I5ZEjbvb6qp2Li9KLeQf2oxsxagxn4rzDjUNczXKnz/uvI pHqxrrriVgOtZ15RI5qFEtrDaiC2yPERQfnNk2Rc= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C67EE606DD; Fri, 29 Jun 2018 21:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530307178; bh=YMjL9Fg/cw9cvnuXQGBGm2QzHTsC1Qt/iJGYMGYk8qM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TX8KX6ODpS6tInGRoNTfbomo2tu9hpTNB4Ucspx9yF7UgsegaoAU9oCEohqCV4RYw fOv4ecm+ODldUdIZYxgi/4920CXCPTD+u9QRk8ZPZoZwU6BpnZDBuT05i+crJGwHWq R72HOXt8b7JgT6rFvmHmsohgsjFG0+BToNqlw+yk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C67EE606DD Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org Date: Fri, 29 Jun 2018 15:19:35 -0600 From: Jordan Crouse To: Arnd Bergmann Cc: Kees Cook , Rob Clark , David Airlie , linux-arm-msm@vger.kernel.org, dri-devel , freedreno@lists.freedesktop.org, Linux Kernel Mailing List Subject: Re: [PATCH] drm/msm/adreno: Remove VLA usage Message-ID: <20180629211935.GG24526@jcrouse-lnx.qualcomm.com> Mail-Followup-To: Arnd Bergmann , Kees Cook , Rob Clark , David Airlie , linux-arm-msm@vger.kernel.org, dri-devel , freedreno@lists.freedesktop.org, Linux Kernel Mailing List References: <20180629184818.GA37439@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 10:47:31PM +0200, Arnd Bergmann wrote: > On Fri, Jun 29, 2018 at 8:48 PM, Kees Cook wrote: > > In the quest to remove all stack VLA usage from the kernel[1], this > > switches to using a kasprintf()ed buffer. Return paths are updated > > to free the allocation. > > > > [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com > > > > Signed-off-by: Kees Cook > > --- > > drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 7 +++++-- > > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 28 +++++++++++++++++-------- > > 2 files changed, 24 insertions(+), 11 deletions(-) > > This seems fine, though using a fixed-length string is probably just > as well here, > given that the 'fwname' variable is always set to the constant string > "a530_zap.mdt" > at the moment, which is not very long. We could make it fixed but since this code is only called once this feels safer. Jordan -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project