mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Gabor Janak (g.janak@agilion.de)" <g.janak@agilion.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: Is this a barebox bootm memory release Bug ?
Date: Wed, 18 Mar 2015 19:55:12 +0100	[thread overview]
Message-ID: <20150318185512.GQ4927@pengutronix.de> (raw)
In-Reply-To: <DB3PR03MB0826E47A0EE5FF439BDD67B698000@DB3PR03MB0826.eurprd03.prod.outlook.com>

Hi Gabor,

On Wed, Mar 18, 2015 at 04:28:26PM +0000, Gabor Janak (g.janak@agilion.de) wrote:
> Hi,
> 
> I have one little question.
> In [barebox.git] / common / bootm.c Line 201
> 
> 196        if (data->verify) {
> 197                 ret = uimage_verify(data->os);
> 198                 if (ret) {
> 199                         printf("Checking data crc failed with %s\n",
> 200                                         strerror(-ret));
> 201                         uimage_close(data->os);
> 202                         return ret;
> 203                 }
> 204         }
> 
> The uimage is closed but data->os is not set to NULL.
> 
> If this function is called from  bootm_boot in
> 472                 ret = handler->bootm(data);
> 
> and
> 482         if (data->os)
> 483                 uimage_close(data->os);
> 
> will crash free something ....
> Will end in a possible
> unable to handle paging request at address 0xfe148f0e
> 
> Is this a correct analyze ?
> If yes, it's enough to add an data->os=NULL after uimage_close ?

Yes, this seems to be a bug. Alternatively we could just skip the
uimage_close in the bootm_open_os_uimage error paths.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2015-03-18 18:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18 16:28 Gabor Janak (g.janak@agilion.de)
2015-03-18 18:55 ` Sascha Hauer [this message]

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=20150318185512.GQ4927@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=g.janak@agilion.de \
    /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