lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201109171756.GA2063125@dell>
Date:   Mon, 9 Nov 2020 17:17:56 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Ville Syrjälä <ville.syrjala@...ux.intel.com>
Cc:     David Airlie <airlied@...ux.ie>,
        David Francis <David.Francis@....com>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 14/19] gpu: drm: selftests: test-drm_dp_mst_helper: Place
 'struct drm_dp_sideband_msg_req_body' onto the heap

On Mon, 09 Nov 2020, Ville Syrjälä wrote:

> On Mon, Nov 09, 2020 at 04:40:04PM +0000, Lee Jones wrote:
> > On Mon, 09 Nov 2020, Ville Syrjälä wrote:
> > 
> > > On Mon, Nov 09, 2020 at 04:12:58PM +0000, Lee Jones wrote:
> > > > On Mon, 09 Nov 2020, Ville Syrjälä wrote:
> > > > 
> > > > > On Thu, Nov 05, 2020 at 02:45:12PM +0000, Lee Jones wrote:
> > > > > > The stack is too full.
> > > > > > 
> > > > > > Fixes the following W=1 kernel build warning(s):
> > > > > > 
> > > > > >  drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c: In function ‘sideband_msg_req_encode_decode’:
> > > > > >  drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c:161:1: warning: the frame size of 1176 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> > > > > > 
> > > > > > Cc: David Airlie <airlied@...ux.ie>
> > > > > > Cc: Daniel Vetter <daniel@...ll.ch>
> > > > > > Cc: Lyude Paul <lyude@...hat.com>
> > > > > > Cc: David Francis <David.Francis@....com>
> > > > > > Cc: dri-devel@...ts.freedesktop.org
> > > > > > Signed-off-by: Lee Jones <lee.jones@...aro.org>
> > > > > > ---
> > > > > >  .../drm/selftests/test-drm_dp_mst_helper.c    | 29 ++++++++++++-------
> > > > > >  1 file changed, 18 insertions(+), 11 deletions(-)
> > > > > > 
> > > > > > diff --git a/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c b/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c
> > > > > > index 1d696ec001cff..0a539456f6864 100644
> > > > > > --- a/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c
> > > > > > +++ b/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c
> > > > > > @@ -120,44 +120,51 @@ sideband_msg_req_equal(const struct drm_dp_sideband_msg_req_body *in,
> > > > > >  static bool
> > > > > >  sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in)
> > > > > >  {
> > > > > > -	struct drm_dp_sideband_msg_req_body out = {0};
> > > > > > +	struct drm_dp_sideband_msg_req_body *out;
> > > > > 
> > > > > How big is it? And why is it that big?
> > > > 
> > > > It's a struct of a union of structs.
> > > > 
> > > > And it's all allocated on the stack.  Bad news!
> > > 
> > > That doesn't answer my questions.
> > 
> > It answers the second question.
> 
> Not really. A combination of structs and unions could be
> pretty much any size.
> 
> > 
> > The answer to the first question you can `grep` for yourself. ;)
> 
> I would rather run pahole on it. But why would you require
> reviewers to jump through such extra hoops when you could
> just put that information into the commit message? With that
> anyone could review this without having to do a lot of extra
> work.

Because the exact numbers aren't all that relevant.

Before the patch is applied, the local variables take the frame size
over the accepted threshold.  The patch brings the size back down to
an accepted level.

I'm not actually aware of the exact numbers, but you can see by taking
a quick look that 'struct drm_dp_sideband_msg_req_body' is large
enough to make a significant improvement once shifted onto the heap.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ