public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ser, Simon" <simon.ser@intel.com>
To: "Latvala, Petri" <petri.latvala@intel.com>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t v3] tests/testdisplay: fix heap overflow
Date: Thu, 21 Mar 2019 10:32:24 +0000	[thread overview]
Message-ID: <1396f41a1412e33798632cfc9a81ea87684c4496.camel@intel.com> (raw)
In-Reply-To: <20190320121749.GS4038@platvala-desk.ger.corp.intel.com>

On Wed, 2019-03-20 at 14:17 +0200, Petri Latvala wrote:
> On Wed, Mar 20, 2019 at 12:00:13PM +0000, Chris Wilson wrote:
> > Quoting Simon Ser (2019-03-20 11:48:57)
> > > +       argv0 = strdup(argv[0]);
> > > +       igt_assert(argv0);
> > > +       exec_path = dirname(argv0);
> > >         ret = chdir(exec_path);
> > >         igt_assert_eq(ret, 0);
> > 
> > One should ask Petri if igt_assert_eq() is even legal inside the
> > helper
> > (i.e. outside of igt_main and igt_subtest).
> 
> *opens testdisplay.c*
> 
> *finds main()*
> 
> *runs away screaming*
> 
> 
> Short answer: It's not legal there
> 
> Long answer:
> It would be legal there if appropriate steps are taken to ensure IGT
> core knows it's a test without subtests. testdisplay, being a
> dinosaur
> that hasn't realized it's pushing up the daisies, doesn't use
> igt_simple_main, or call igt_simple_init_parse_opts, or otherwise do
> the common things any recently written test is doing.
> 
> It's also calling igt_skip_on_simulation in just about the only
> possible context where it's not legal.
> 
> Note to self: Hurry up with removing all custom main functions.

Hmm. So would you prefer to add an error return value to this function,
or to just continue to use these even if they don't work and fix
everything in a later commit?
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-03-21 10:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 11:48 [igt-dev] [PATCH i-g-t v3] tests/testdisplay: fix heap overflow Simon Ser
2019-03-20 12:00 ` Chris Wilson
2019-03-20 12:17   ` Petri Latvala
2019-03-21 10:32     ` Ser, Simon [this message]
2019-03-21 10:42       ` Petri Latvala
2019-03-25 11:17         ` Petri Latvala
2019-03-20 13:57 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/testdisplay: fix heap overflow (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396f41a1412e33798632cfc9a81ea87684c4496.camel@intel.com \
    --to=simon.ser@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox