Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
From: Arvind Sankar <nivedita@alum.mit.edu>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>,
	Ard Biesheuvel <ardb@kernel.org>,
	linux-efi <linux-efi@vger.kernel.org>
Subject: Re: [PATCH 2/2] efi/gop: Fix memory leak in __gop_query32/64
Date: Wed, 4 Dec 2019 10:44:16 -0500
Message-ID: <20191204154415.GC626282@rani.riverdale.lan> (raw)
In-Reply-To: <CAKv+Gu9ZCvoLn+yoWFq=Q1n2hBz+=BLwSQbgAnjfgSq6hDM6bg@mail.gmail.com>

On Wed, Dec 04, 2019 at 03:30:22PM +0000, Ard Biesheuvel wrote:
> On Wed, 4 Dec 2019 at 15:27, Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >
> > On Wed, Dec 04, 2019 at 03:11:09PM +0000, Ard Biesheuvel wrote:
> > > On Tue, 3 Dec 2019 at 21:47, Arvind Sankar <nivedita@alum.mit.edu> wrote:
> > > >
> > > > gop->query_mode returns info in callee-allocated memory which must be
> > > > freed by the caller.
> > > >
> > > > We don't actually need to call it in order to obtain the info for the
> > > > current graphics mode, which is already there in gop->mode->info, so
> > > > just access it directly.
> > > >
> > > > Also nothing uses the size of the info structure, so remove the
> > > > argument.
> > > >
> > > > Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
> > >
> > > Thanks Arvind
> > >
> > > I agree with this patch in principle, but I'd prefer it if we could
> > > get rid of the __gop_queryXX routines altogether, or if we need a
> > > helper, to at least merge them into on, taking gopXX->mode as an input
> > > argument.
> > >
> >
> > I can do that. I'm also planning a few patches later to merge the 32-bit
> > and 64-bit versions together if there are no objections, but that needs
> > a little more work. Right now the query code can't be merged together
> > because mode's layout is different between 32-bit and 64-bit versions,
> > but it can certainly be folded into the main setup routines.
> >
> 
> Fair enough.
> 
> Are you building/testing this on x86 hardware only? That's perfectly
> fine, but it would be good to know.
> 

Yes, I only have 64-bit x86 hardware.

  reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 21:47 [PATCH 1/2] efi/gop: Fix return value of setup_gop32/64 Arvind Sankar
2019-12-03 21:47 ` [PATCH 2/2] efi/gop: Fix memory leak in __gop_query32/64 Arvind Sankar
2019-12-04 15:11   ` Ard Biesheuvel
2019-12-04 15:27     ` Arvind Sankar
2019-12-04 15:30       ` Ard Biesheuvel
2019-12-04 15:44         ` Arvind Sankar [this message]
2019-12-04 15:03 ` [PATCH 1/2] efi/gop: Fix return value of setup_gop32/64 Ard Biesheuvel
2019-12-04 15:23   ` Arvind Sankar
2019-12-04 15:28     ` Ard Biesheuvel
2019-12-04 15:45       ` Arvind Sankar
2019-12-04 18:17 ` [PATCH v2 0/3] Fix a couple of bugs in efi/gop.c Arvind Sankar
2019-12-05 12:06   ` Ard Biesheuvel
2019-12-04 18:17 ` [PATCH v2 1/3] efi/gop: Return EFI_NOT_FOUND if there are no usable GOP's Arvind Sankar
2019-12-04 18:17 ` [PATCH v2 2/3] efi/gop: Return EFI_SUCCESS if a usable GOP was found Arvind Sankar
2019-12-04 18:17 ` [PATCH v2 3/3] efi/gop: Fix memory leak from __gop_query32/64 Arvind Sankar

Reply instructions:

You may reply publically 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=20191204154415.GC626282@rani.riverdale.lan \
    --to=nivedita@alum.mit.edu \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    /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

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org
	public-inbox-index linux-efi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git