[Bug 1718587] Re: shim-signed apport hook crashes under certain errors

Steve Langasek 1718587 at bugs.launchpad.net
Wed Jul 21 00:23:50 UTC 2021


** Summary changed:

- shim-signed hook crashes under certain errors
+ shim-signed apport hook crashes under certain errors

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to shim-signed in Ubuntu.
https://bugs.launchpad.net/bugs/1718587

Title:
  shim-signed apport hook crashes under certain errors

Status in shim-signed package in Ubuntu:
  New

Bug description:
  In bug #1718582, a user has a corrupted ESP.  This leads to the shim-
  signed apport hook crashing with the following error:

  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport/report.py", line 197, in _run_hook
      symb['add_info'](report, ui)
    File "/usr/share/apport/package-hooks/source_shim-signed.py", line 42, in add_info
      if directory:
  UnboundLocalError: local variable 'directory' referenced before assignment

  The relevant code is:

      try:
          directory = os.stat(efiboot)
      except OSError as e:
          if e.errno == errno.ENOENT:
              report['Missing'] = '/boot/efi/EFI/ubuntu directory is missing'
              return
          if e.errno == errno.EACCES:
              directory= True
      if directory:

  If errno is anything other than ENOENT or EACCES, this crashes with
  the above traceback.

  It would probably be better to at least re-raise e if it doesn't match
  one of our expected errnos.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shim-signed/+bug/1718587/+subscriptions




More information about the foundations-bugs mailing list