[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#813995: marked as done (flashcp writes to nand without being aware of bad blocks)



Your message dated Mon, 22 Feb 2016 19:49:06 +0000
with message-id <E1aXwTi-0006ho-UP@franck.debian.org>
and subject line Bug#813995: fixed in flash-kernel 3.59
has caused the Debian Bug report #813995,
regarding flashcp writes to nand without being aware of bad blocks
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
813995: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813995
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: flash-kernel
Version: 3.35+deb8u2
Severity: critical
Justification: causes serious data loss
Control: block 806926 with -1

Hello,

when flash-kernel writes a kernel/initrd to NAND flash it uses plain
write(2) to /dev/mtdX (flash-kernel < 3.52) or flashcp
(flash-kernel >= 3.52). If the device being written to has bad blocks
these are tried to be erased and written by both approaches.

This results in a non-booting system at best. In general writing to bad
blocks can also affect other (otherwise good) blocks and so result in
loss of unrelated data. I never saw this in practise, but the
manufacturers of NAND flash say so.

I didn't check which machines are affected, but Netgear ReadyNAS 102/104
(which isn't in flash-kernel's database yet, but see below for the
obvious entry to add support for them and #806926) is affected and flash
kernel managed to break a ReadyNAS 102 already (non-permanently by good
fortune as far as I can tell up to now).
I guess there are several other machines affected though.

The right fix is to use nandwrite to write to NAND flash and only use
flashcp for NOR.

Something like

	test -f /sys/class/mtd/mtdX/oobsize

could be used to detect if the device is NAND or NOR. But there might be
more reliable ways I'm not aware of.

I will debug/test a bit more with the broken rn102 (and its owner :-) to
maybe come up with a patch, but if someone beats me that's very welcome,
too.

Best regards
Uwe

-- System Information:
Debian Release: 8.2
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: armhf (armv7l)

Kernel: Linux 3.16.0-4-armmp (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages flash-kernel depends on:
ii  debconf [debconf-2.0]  1.5.56
ii  devio                  1.2-1
ii  initramfs-tools        0.120
ii  linux-base             3.5
ii  ucf                    3.0030

Versions of packages flash-kernel recommends:
ii  u-boot-tools  2014.10+dfsg1-5

flash-kernel suggests no packages.

-- Configuration Files:
/etc/flash-kernel/db changed:
Machine: NETGEAR ReadyNAS 104
DTB-Id: armada-370-netgear-rn104.dtb
DTB-Append: yes
Mtd-Kernel: uImage
Mtd-Initrd: minirootfs
U-Boot-Kernel-Address: 0x04000000
U-Boot-Initrd-Address: 0x05000000
Required-Packages: u-boot-tools


-- debconf information:
  flash-kernel/linux_cmdline: quiet

--- End Message ---
--- Begin Message ---
Source: flash-kernel
Source-Version: 3.59

We believe that the bug you reported is fixed in the latest version of
flash-kernel, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 813995@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christian Perrier <bubulle@debian.org> (supplier of updated flash-kernel package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 22 Feb 2016 18:52:43 +0100
Source: flash-kernel
Binary: flash-kernel flash-kernel-installer
Architecture: source
Version: 3.59
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Christian Perrier <bubulle@debian.org>
Description:
 flash-kernel - utility to make certain embedded devices bootable
 flash-kernel-installer - Make the system bootable (udeb)
Closes: 807708 813995
Changes:
 flash-kernel (3.59) unstable; urgency=medium
 .
   [ Uwe Kleine-König ]
   * use nandwrite when writing to nand flash. (Closes: #813995)
 .
   [ Martin Michlmayr ]
   * Require --force when invoked by hand with a specific version which is not
     the latest. (Closes: 807708)
 .
   [ Ian Campbell ]
   * Support $LINUX_KERNEL_CMDLINE_DEFAULTS via /etc/defaults/flash-kernel. This
     will be prepended to the ${bootargs} and can therefore be overridden by the
     firmware configuration. Suggested as part of #813023.
   * Fix debug logging intended to help with #781742.
 .
   [ Vagrant Cascadian ]
   * Update db entry for Firefly-RK3288 to allow armmp-lpae.
Checksums-Sha1:
 2e064690525d63dd8ce0b38f3d57f18407c57cad 1859 flash-kernel_3.59.dsc
 8fb1cbf63ecf63b229ed9d522f73971574ecfa60 65664 flash-kernel_3.59.tar.xz
Checksums-Sha256:
 d1178363e3444a267fd12e86f4006be432517d29e2115beb3406e70a03222d56 1859 flash-kernel_3.59.dsc
 6db26f4acae5afd4ef6853b0dbd1f8fcf379832326c0bedf7a9d86003913f548 65664 flash-kernel_3.59.tar.xz
Files:
 fa838a494720eb63849a13e9790ffa88 1859 utils optional flash-kernel_3.59.dsc
 c44e3714387de4a7fa5aba54d8ed944e 65664 utils optional flash-kernel_3.59.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJWy2N5AAoJEIcvcCxNbiWoH9kQALyETjASn52+umjErlLT4doy
9WRBidaCi+1i0cMpdPXJ8TxUl8tFWuFFLbaKA4m+0Cv9cZdjb65tN9tpHLwsnkm7
e2iUeu6NWCs2F3rCI6BAgnDb6aazvHMQxaWwJgtSBsZvR23HyHSsBmBrC/+8W1wG
Pe+CvdqurksBsCUJR8QkSXBSFkTUNks5/m8pbjbvFjMPkMjZX/avV5xmpShTdIql
nYDqumVxS21tCRmvK8bekgZo66xDNAiPAvwUx3DxifFO2Ef7H7FKROtqL7tA/j9t
RysxFFoKSA4e3F/B88sHfw2cA4xWJD1QvGPscLQJr4TF4HZhUCLkntZR9wFVhZpe
GEtuH2d9IOVsVTWFDDTsBHoZEs2B0wcn1oAQjLWhyQ25BEfU2R2z7FctAgVmyYa1
23Xf/mGlGjYu9DWuJrzlb0tJvRp7L3GanCgk/3KErdAgOL5/xvrf2PwvD2qRLeqb
W/4iJG/KoiHaidq4VoB7fzKGVbqLA/7ggNzeZXaKzOF4avGWu0V1+SeyuwNdnWa3
4qQda3gjqEHf75MMQv3mF7Vtozyh5qdVBbf1DIO2obrmgWlo7BvIjF1SkFjslUks
O20x59gQ3RQFzelc9c2hUxrF80bgsIA6JPsMKb40wehIod2Zd7T8tM0wCG79DL5P
rTIk33iEfcv1IPvzcBHC
=D1Gp
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: