From bea5382317161a3faa9829d86d4eed251c61d327 Mon Sep 17 00:00:00 2001 From: wangkerong Date: Tue, 8 Jun 2021 14:21:25 +0800 Subject: [PATCH] round community patches --- ...finite-loop-on-allocation-failure-in.patch | 69 +++++++++++++++++++ ipxe.spec | 10 ++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 backport-avoid-infinite-loop-on-allocation-failure-in.patch diff --git a/backport-avoid-infinite-loop-on-allocation-failure-in.patch b/backport-avoid-infinite-loop-on-allocation-failure-in.patch new file mode 100644 index 0000000..8dffce5 --- /dev/null +++ b/backport-avoid-infinite-loop-on-allocation-failure-in.patch @@ -0,0 +1,69 @@ +From 614d99eba149d0fafc64dfdddc7ef04970e0d86c Mon Sep 17 00:00:00 2001 +From: Michael Brown +Date: Tue, 20 Apr 2021 13:28:57 +0100 +Subject: [PATCH] [xen] Avoid infinite loop on allocation failure in + xenstore_response() +Signed-off-by: Michael Brown +Conflict:NA +Reference:https://github.com/ipxe/ipxe/commit/614d99eba149d0fafc64dfdddc7ef04970e0d86c +--- + src/interface/xen/xenstore.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) +diff --git a/src/interface/xen/xenstore.c b/src/interface/xen/xenstore.c +index a14881f..c2da532 100644 +--- a/src/interface/xen/xenstore.c ++++ b/src/interface/xen/xenstore.c +@@ -68,14 +68,14 @@ static void xenstore_send ( struct xen_hypervisor *xen, const void *data, + XENSTORE_RING_IDX cons; + XENSTORE_RING_IDX idx; + const char *bytes = data; +- size_t offset = 0; ++ size_t offset; + size_t fill; + + DBGCP ( intf, "XENSTORE raw request:\n" ); + DBGCP_HDA ( intf, MASK_XENSTORE_IDX ( prod ), data, len ); + + /* Write one byte at a time */ +- while ( offset < len ) { ++ for ( offset =0 ; offset < len ; offset++ ) { + + /* Wait for space to become available */ + while ( 1 ) { +@@ -90,7 +90,7 @@ static void xenstore_send ( struct xen_hypervisor *xen, const void *data, + + /* Write byte */ + idx = MASK_XENSTORE_IDX ( prod++ ); +- writeb ( bytes[offset++], &intf->req[idx] ); ++ writeb ( bytes[offset], &intf->req[idx] ); + } + + /* Update producer counter */ +@@ -125,13 +125,13 @@ static void xenstore_recv ( struct xen_hypervisor *xen, void *data, + XENSTORE_RING_IDX prod; + XENSTORE_RING_IDX idx; + char *bytes = data; +- size_t offset = 0; ++ size_t offset; + size_t fill; + + DBGCP ( intf, "XENSTORE raw response:\n" ); + + /* Read one byte at a time */ +- while ( offset < len ) { ++ for ( offset = 0 ; offset < len ; offset++ ) { + + /* Wait for data to be ready */ + while ( 1 ) { +@@ -147,7 +147,7 @@ static void xenstore_recv ( struct xen_hypervisor *xen, void *data, + /* Read byte */ + idx = MASK_XENSTORE_IDX ( cons++ ); + if ( data ) +- bytes[offset++] = readb ( &intf->rsp[idx] ); ++ bytes[offset] = readb ( &intf->rsp[idx] ); + } + if ( data ) + DBGCP_HDA ( intf, MASK_XENSTORE_IDX ( cons - len ), data, len ); +-- +2.23.0 + diff --git a/ipxe.spec b/ipxe.spec index bfb2e2d..2de3693 100644 --- a/ipxe.spec +++ b/ipxe.spec @@ -6,7 +6,7 @@ Name: ipxe Version: 1.21.1 -Release: 1 +Release: 2 Summary: A network boot loader Epoch: 1 License: GPLv2 with additional permissions and BSD @@ -15,6 +15,8 @@ Source0: https://github.com/ipxe/ipxe/archive/v%{version}.tar.gz Patch0001: 0001-build-customize-configuration.patch Patch0002: 0002-Use-spec-compliant-timeouts.patch +Patch6000: backport-avoid-infinite-loop-on-allocation-failure-in.patch + %ifarch %{buildarches} BuildRequires: perl-interpreter perl-Getopt-Long syslinux mtools genisoimage edk2-devel BuildRequires: xz-devel gcc binutils-devel @@ -172,6 +174,12 @@ done %endif %changelog +* Tue Jun 08 2021 wangkerong - 1.21.1-2 +- Type:BugFix +- Id:NA +- SUG:NA +- DESC: round community patches fix Avoid infinite loop on allocation failure + * Wed Feb 03 2021 gaihuiying - 1.21.1-1 - Type:requirement - Id:NA -- Gitee