SHA256
1
0
forked from pool/tboot

Accepting request 500929 from home:msmeissn:branches:security

- tboot-gcc7.patch: fix some gcc7 warnings that lead to errors. (bsc#1041264)

- fixes a boot issue on Skylake (bsc#964408)

OBS-URL: https://build.opensuse.org/request/show/500929
OBS-URL: https://build.opensuse.org/package/show/security/tboot?expand=0&rev=62
This commit is contained in:
Marcus Meissner 2017-06-04 08:58:02 +00:00 committed by Git OBS Bridge
parent ef00ee049f
commit b3b59d9789
3 changed files with 94 additions and 1 deletions

86
tboot-gcc7.patch Normal file
View File

@ -0,0 +1,86 @@
Index: tboot-1.9.5/tboot/common/tboot.c
===================================================================
--- tboot-1.9.5.orig/tboot/common/tboot.c
+++ tboot-1.9.5/tboot/common/tboot.c
@@ -501,11 +501,13 @@ static void shutdown_system(uint32_t shu
/* write our S3 resume vector to ACPI resume addr */
set_s3_resume_vector(&_tboot_shared.acpi_sinfo, TBOOT_S3_WAKEUP_ADDR);
/* fall through for rest of Sx handling */
+ /* FALLTHROUGH */
case TB_SHUTDOWN_S4:
case TB_SHUTDOWN_S5:
machine_sleep(&_tboot_shared.acpi_sinfo);
/* if machine_sleep() fails, fall through to reset */
+ /* FALLTHROUGH */
case TB_SHUTDOWN_REBOOT:
if ( txt_is_powercycle_required() ) {
/* powercycle by writing 0x0a+0x0e to port 0xcf9 */
@@ -524,6 +526,7 @@ static void shutdown_system(uint32_t shu
outb(0xcf9, 0x06);
}
+ /* FALLTHROUGH */
case TB_SHUTDOWN_HALT:
default:
while ( true )
Index: tboot-1.9.5/tboot/common/vsprintf.c
===================================================================
--- tboot-1.9.5.orig/tboot/common/vsprintf.c
+++ tboot-1.9.5/tboot/common/vsprintf.c
@@ -404,6 +404,7 @@ handle_width:
case 'p':
mods.flag |= PREFIX; /* print prefix 0x for %p */
mods.flag_long = LONG;
+ /* FALLTHROUGH */
case 'x':
mods.base = 16;
buf_pos = write_number_to_buffer(buf, size, buf_pos, mods);
Index: tboot-1.9.5/tboot/common/tpm.c
===================================================================
--- tboot-1.9.5.orig/tboot/common/tpm.c
+++ tboot-1.9.5/tboot/common/tpm.c
@@ -117,14 +117,14 @@ static bool tpm_send_cmd_ready_status_cr
#endif
if ( reg_ctrl_sts.tpmidle== 1) {
- reg_ctrl_request._raw[0] = 0;
+ memset(&reg_ctrl_request,0,sizeof(reg_ctrl_request));
reg_ctrl_request.cmdReady = 1;
write_tpm_reg(locality, TPM_CRB_CTRL_REQ, &reg_ctrl_request);
return true;
}
- reg_ctrl_request._raw[0] = 0;
+ memset(&reg_ctrl_request,0,sizeof(reg_ctrl_request));
reg_ctrl_request.goIdle = 1;
write_tpm_reg(locality, TPM_CRB_CTRL_REQ, &reg_ctrl_request);
@@ -158,7 +158,7 @@ static bool tpm_send_cmd_ready_status_cr
printk(TBOOT_INFO"2. reg_ctrl_sts.tpmsts: 0x%x\n", reg_ctrl_sts.tpmsts);
#endif
- reg_ctrl_request._raw[0] = 0;
+ memset(&reg_ctrl_request,0,sizeof(reg_ctrl_request));
reg_ctrl_request.cmdReady = 1;
write_tpm_reg(locality, TPM_CRB_CTRL_REQ, &reg_ctrl_request);
@@ -724,7 +724,7 @@ bool tpm_relinquish_locality_crb(uint32_
if ( reg_loc_state.loc_assigned == 0 ) return true;
/* make inactive by writing a 1 */
- reg_loc_ctrl._raw[0] = 0;
+ memset(&reg_loc_ctrl,0,sizeof(reg_loc_ctrl));
reg_loc_ctrl.relinquish = 1;
write_tpm_reg(locality, TPM_REG_LOC_CTRL, &reg_loc_ctrl);
@@ -778,7 +778,7 @@ bool tpm_request_locality_crb(uint32_t l
tpm_reg_loc_state_t reg_loc_state;
tpm_reg_loc_ctrl_t reg_loc_ctrl;
/* request access to the TPM from locality N */
- reg_loc_ctrl._raw[0] = 0;
+ memset(&reg_loc_ctrl,0,sizeof(reg_loc_ctrl));
reg_loc_ctrl.requestAccess = 1;
write_tpm_reg(locality, TPM_REG_LOC_CTRL, &reg_loc_ctrl);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Jun 4 08:43:14 UTC 2017 - meissner@suse.com
- tboot-gcc7.patch: fix some gcc7 warnings that lead to errors. (bsc#1041264)
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Apr 30 05:29:57 UTC 2017 - bwiedemann@suse.com Sun Apr 30 05:29:57 UTC 2017 - bwiedemann@suse.com
@ -82,7 +87,7 @@ Fri May 8 12:08:52 UTC 2015 - meissner@suse.com
* Fixed bug for wrong assumption on the way how GRUB2 load modules * Fixed bug for wrong assumption on the way how GRUB2 load modules
* Fixed MB2 tags mess issue caused by moving shorter module cmdline to head * Fixed MB2 tags mess issue caused by moving shorter module cmdline to head
* Fixed compile issue when debug=y * Fixed compile issue when debug=y
- fixes a boot issue on Skylake (bsc#964408)
- refreshed tboot-grub2-fix-xen-submenu-name.patch - refreshed tboot-grub2-fix-xen-submenu-name.patch
------------------------------------------------------------------- -------------------------------------------------------------------

View File

@ -30,6 +30,7 @@ Patch3: tboot-grub2-fix-menu-in-xen-host-server.patch
Patch4: tboot-grub2-fix-xen-submenu-name.patch Patch4: tboot-grub2-fix-xen-submenu-name.patch
# PATCH-FIX-UPSTREAM -- https://sourceforge.net/p/tboot/code/merge-requests/1/ # PATCH-FIX-UPSTREAM -- https://sourceforge.net/p/tboot/code/merge-requests/1/
Patch5: reproducible.patch Patch5: reproducible.patch
Patch6: tboot-gcc7.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: trousers-devel BuildRequires: trousers-devel
@ -46,6 +47,7 @@ verified launch of an OS kernel/VMM.
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch5 -p1 %patch5 -p1
%patch6 -p1
%build %build
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"