Bug 213196

Summary: Upgrading Amazon EC2 instance from 10.3 to 11.0 results in hang at boot
Product: Base System Reporter: Allan Jude <allanjude>
Component: kernAssignee: Allan Jude <allanjude>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: ---    
Version: 11.0-RC1   
Hardware: Any   
OS: Any   

Description Allan Jude freebsd_committer freebsd_triage 2016-10-04 16:29:09 UTC
Peter Ankerstål on the -stable mailing list reports a failure to boot after using freebsd-update to upgrade from 10.3-RELEASE to 11.0-RELEASE

https://lists.freebsd.org/pipermail/freebsd-stable/2016-October/085799.html

The issue is caused by EC2 hanging on an attempt to read past the end of the disk


The issue was introduced in r297629 (6 months ago), but was not caught because most installs are 4k aligned by the installer, and on most hardware, a read past the end of the disk returns and error, which is silently ignored and booting continues normally. For EC2, newer snapshots and images use a newer disk layout that is 4k aligned, so avoided this issue. Only older instances being upgraded to 11.0 encountered the problem.
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-10-04 16:33:18 UTC
A commit references this bug:

Author: allanjude
Date: Tue Oct  4 16:33:03 UTC 2016
New revision: 306677
URL: https://svnweb.freebsd.org/changeset/base/306677

Log:
  GELIBoot may attempt to read past the end of the disk

  Usually there is some slack after the last partition due to 4k alignment
  In the 10.3 EC2 images, there was not. EC2 seems to hang if you try to
  read past the end of the disk in the loader, resulting in an unbootable
  instance after upgrading to 11.0

  PR:		213196
  Reported by:	Peter Ankerstal <peter@pean.org>
  Tested by:	cperciva
  Reviewed by:	tsoome
  MFC after:	3 days
  Sponsored by:	ScaleEngine Inc.
  Differential Revision:	https://reviews.freebsd.org/D8144

Changes:
  head/sys/boot/geli/geliboot.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-10-08 00:02:00 UTC
A commit references this bug:

Author: allanjude
Date: Sat Oct  8 00:01:07 UTC 2016
New revision: 306834
URL: https://svnweb.freebsd.org/changeset/base/306834

Log:
  MFC: r306677

  GELIBoot may attempt to read past the end of the disk

  PR:		213196
  Relnotes:	yes
  Sponsored by:	ScaleEngine Inc.

Changes:
_U  stable/11/
  stable/11/sys/boot/geli/geliboot.c
Comment 3 Allan Jude freebsd_committer freebsd_triage 2016-11-04 23:08:45 UTC
The Errata Notice for this bug has been published:
https://www.freebsd.org/security/advisories/FreeBSD-EN-16:18.loader.asc

It is now safe to upgrade with freebsd-update