{"action":"created","issue":{"url":"https://api.github.com/repos/rhinstaller/shim/issues/55","repository_url":"https://api.github.com/repos/rhinstaller/shim","labels_url":"https://api.github.com/repos/rhinstaller/shim/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/rhinstaller/shim/issues/55/comments","events_url":"https://api.github.com/repos/rhinstaller/shim/issues/55/events","html_url":"https://github.com/rhinstaller/shim/issues/55","id":164662984,"number":55,"title":"\"Failed to set variable: (2) Invalid Parameter\" when enrolling MOK","user":{"login":"adempewolff","id":17548750,"avatar_url":"https://avatars.githubusercontent.com/u/17548750?v=3","gravatar_id":"","url":"https://api.github.com/users/adempewolff","html_url":"https://github.com/adempewolff","followers_url":"https://api.github.com/users/adempewolff/followers","following_url":"https://api.github.com/users/adempewolff/following{/other_user}","gists_url":"https://api.github.com/users/adempewolff/gists{/gist_id}","starred_url":"https://api.github.com/users/adempewolff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adempewolff/subscriptions","organizations_url":"https://api.github.com/users/adempewolff/orgs","repos_url":"https://api.github.com/users/adempewolff/repos","events_url":"https://api.github.com/users/adempewolff/events{/privacy}","received_events_url":"https://api.github.com/users/adempewolff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-07-09T11:24:57Z","updated_at":"2016-07-20T02:44:19Z","closed_at":null,"body":"I'm unsure if this is a bug in shim, mokutil, or user error.  I also filed a bug against mokutil here: https://bugs.launchpad.net/ubuntu/+source/mokutil/+bug/1600452\r\n\r\nFeel free to close the issue if you can determine that it's not related to Shim (although any hints on what might be causing it would be appreciated!)\r\n\r\n## Testing Environment:\r\nLenovo Thinkpad P50, fresh install of Ubuntu 16.04 64bit\r\n\r\n```\r\n$ apt-cache policy mokutil\r\nmokutil:\r\n  Installed: 0.3.0-0ubuntu3\r\n  Candidate: 0.3.0-0ubuntu3\r\n  Version table:\r\n *** 0.3.0-0ubuntu3 500\r\n        500 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 Packages\r\n        100 /var/lib/dpkg/status\r\n$ apt-cache policy shim\r\nshim:\r\n  Installed: 0.8-0ubuntu2\r\n  Candidate: 0.8-0ubuntu2\r\n  Version table:\r\n *** 0.8-0ubuntu2 500\r\n        500 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 Packages\r\n        100 /var/lib/dpkg/status\r\n```\r\n\r\n## Steps to reproduce:\r\n(1) do not disable SecureBoot as suggested during the install.\r\n\r\n(2) install virtualbox-5.0 from the virtualbox ppa (deb http://download.virtualbox.org/virtualbox/debian xenial contrib)\r\n\r\n(3) Follow instructions here to manually sign the vboxdrv kernel module (https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur/768310#768310)\r\n\r\n```\r\n$ openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj \"/CN=Descriptive name/\"\r\n$ sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv)\r\n$ sudo mokutil --import MOK.der\r\n```\r\n\r\n(enter password)\r\n\r\n(4) reboot, click \"enroll mok\", \"continue\", \"yes\", enter password, (screenshots here: https://sourceware.org/systemtap/wiki/SecureBoot)\r\n\r\n## Expected behavior:\r\n\r\nnew mok will be enrolled and I will be asked to reboot (several users from the original askubuntu answer indicated that these exact steps worked for them.\r\n\r\n## Actual behaviour:\r\n\r\n\"Error: Failed to set variable: (2) Invalid Parameter\"\r\n\r\n## Troubleshooting steps taken:\r\n- tried different passwords, and was able to eliminate that being the cause.\r\n- found relevant lines of code producing the error: lines 919-931 in https://github.com/rhinstaller/shim/blob/master/MokManager.c\r\n\r\n\r\n```\r\n  efi_status = uefi_call_wrapper(RT->SetVariable, 5, db_name,\r\n            &shim_lock_guid,\r\n            EFI_VARIABLE_NON_VOLATILE\r\n            | EFI_VARIABLE_BOOTSERVICE_ACCESS\r\n            | EFI_VARIABLE_APPEND_WRITE,\r\n            MokNewSize, MokNew);\r\n }\r\n\r\n if (efi_status != EFI_SUCCESS) {\r\n  console_error(L\"Failed to set variable\", efi_status);\r\n  return efi_status;\r\n}\r\n```\r\n\r\n- unable to find where uefi_call_wrapper() is defined\r\n\r\nProblemType: Bug\r\nDistroRelease: Ubuntu 16.04\r\nPackage: mokutil 0.3.0-0ubuntu3\r\nProcVersionSignature: Ubuntu 4.4.0-28.47-generic 4.4.13\r\nUname: Linux 4.4.0-28-generic x86_64\r\nApportVersion: 2.20.1-0ubuntu2.1\r\nArchitecture: amd64\r\nCurrentDesktop: Unity\r\nDate: Sat Jul 9 18:56:59 2016\r\nInstallationDate: Installed on 2016-07-08 (0 days ago)\r\nInstallationMedia: Ubuntu 16.04 LTS \"Xenial Xerus\" - Release amd64 (20160420.1)\r\nSourcePackage: mokutil\r\nUpgradeStatus: No upgrade log present (probably fresh install)"},"comment":{"url":"https://api.github.com/repos/rhinstaller/shim/issues/comments/233823952","html_url":"https://github.com/rhinstaller/shim/issues/55#issuecomment-233823952","issue_url":"https://api.github.com/repos/rhinstaller/shim/issues/55","id":233823952,"user":{"login":"lcp","id":98220,"avatar_url":"https://avatars.githubusercontent.com/u/98220?v=3","gravatar_id":"","url":"https://api.github.com/users/lcp","html_url":"https://github.com/lcp","followers_url":"https://api.github.com/users/lcp/followers","following_url":"https://api.github.com/users/lcp/following{/other_user}","gists_url":"https://api.github.com/users/lcp/gists{/gist_id}","starred_url":"https://api.github.com/users/lcp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcp/subscriptions","organizations_url":"https://api.github.com/users/lcp/orgs","repos_url":"https://api.github.com/users/lcp/repos","events_url":"https://api.github.com/users/lcp/events{/privacy}","received_events_url":"https://api.github.com/users/lcp/received_events","type":"User","site_admin":false},"created_at":"2016-07-20T02:44:19Z","updated_at":"2016-07-20T02:44:19Z","body":"Here is the code:\r\nhttps://github.com/lcp/uefi-fun/tree/master/WriteAppend\r\nYou will need at least make, gcc, and gnu-efi to compile the code. If crt0-efi-x86_64.o is not in /usr/lib64, you can specify the EFI_PATH to change the path. For example, type \"make EFI_PATH=/usr/lib64/gnuefi\" if crt0-efi-x86_64.o is in /usr/lib64/gnuefi."}}
{"actor":{"display_login":"lcp"}}