public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors
@ 2010-05-18  5:26 Mark Tomlinson
  2010-05-18  5:26 ` [U-Boot] [PATCH 1/1] flash: Check info pointer in flash_protect() Mark Tomlinson
  2010-05-18  8:20 ` [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors Stefan Roese
  0 siblings, 2 replies; 12+ messages in thread
From: Mark Tomlinson @ 2010-05-18  5:26 UTC (permalink / raw)
  To: u-boot

Our hardware has part of the flash mapped in two address ranges.
The CONFIG_SYS_MONITOR_BASE is in the upper 'boot' area, whereas
the CONFIG_SYS_FLASH_BANKS_LIST has the full flash available at
a lower address.

This all works fine until the code in cfi_flash.c:flash_init(), which
uses flash_get_info() to find the flash_info_t associated with the
monitor and environment. These are not in the probed flash range, so
flash_get_info() returns NULL. This is not checked and is passed
directly to flash_protect(). Since flash_protect() was not checking
for this NULL pointer either, random memory would be clobbered
causing the device to lock up.

This patch changes flash_protect() to check for the NULL, and the
error goes unreported.

Mark Tomlinson (1):
  flash: Check info pointer in flash_protect().

 common/flash.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


NOTICE: This message contains privileged and confidential
information intended only for the use of the addressee
named above. If you are not the intended recipient of
this message you are hereby notified that you must not
disseminate, copy or take any action in reliance on it.
If you have received this message in error please
notify Allied Telesis Labs Ltd immediately.
Any views expressed in this message are those of the
individual sender, except where the sender has the
authority to issue and specifically states them to
be the views of Allied Telesis Labs.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-05-20 18:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18  5:26 [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors Mark Tomlinson
2010-05-18  5:26 ` [U-Boot] [PATCH 1/1] flash: Check info pointer in flash_protect() Mark Tomlinson
2010-05-19 22:22   ` Mike Frysinger
2010-05-20  8:38   ` Wolfgang Denk
2010-05-18  8:20 ` [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors Stefan Roese
2010-05-18 20:10   ` mark tomlinson
2010-05-19  9:44     ` Stefan Roese
2010-05-19 21:09       ` mark tomlinson
2010-05-19 21:59         ` Wolfgang Denk
2010-05-19 23:08           ` Chris Packham
2010-05-20  8:35             ` Wolfgang Denk
2010-05-20 18:59               ` Chris Packham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox