From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH 1/3] ieee1275: ofdisk dangling pointer
Date: Mon, 26 Oct 2015 23:03:39 +0100 [thread overview]
Message-ID: <562EA33B.4030103@gmail.com> (raw)
In-Reply-To: <1671671c705298f7d6e8c7e79805564b3b662548.1445895272.git.eric.snowberg@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]
On 26.10.2015 22:43, Eric Snowberg wrote:
> Within commit: 87ec3b7fa9061f470616ed927fc140e995831c00 -
> "Don't continue to query block-size if disk doesn't have it.”
> a dangling pointer was introduced.
>
> Fix dangling pointer issue in grub_ofdisk_open where devpath is freed
> and then used again within the call to grub_ofdisk_get_block_size. This
> solves many memory corruption issues we were seeing.
>
Committed, thanks
> Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
> ---
> grub-core/disk/ieee1275/ofdisk.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c
> index 331769b..4a5632c 100644
> --- a/grub-core/disk/ieee1275/ofdisk.c
> +++ b/grub-core/disk/ieee1275/ofdisk.c
> @@ -422,10 +422,11 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
> op = ofdisk_hash_find (devpath);
> if (!op)
> op = ofdisk_hash_add (devpath, NULL);
> - else
> - grub_free (devpath);
> if (!op)
> - return grub_errno;
> + {
> + grub_free (devpath);
> + return grub_errno;
> + }
> disk->id = (unsigned long) op;
> disk->data = op->open_path;
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
next prev parent reply other threads:[~2015-10-26 22:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 21:43 [PATCH 1/3] ieee1275: ofdisk dangling pointer Eric Snowberg
2015-10-26 21:43 ` [PATCH 2/3] ieee1275: ofdisk memory leak Eric Snowberg
2015-10-26 22:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-26 21:43 ` [PATCH 3/3] ieee1275: ofdisk - don't continue to query block-size after we have it Eric Snowberg
2015-10-26 22:02 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-11-10 8:01 ` Andrei Borzenkov
2015-11-10 17:45 ` Eric Snowberg
2015-10-26 22:03 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2015-10-29 14:48 ` [PATCH 1/3] ieee1275: ofdisk dangling pointer Daniel Kiper
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=562EA33B.4030103@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.