round community patche

This commit is contained in:
wangkerong 2021-06-09 10:02:49 +08:00
parent 11f766fad5
commit 898717184a
2 changed files with 78 additions and 1 deletions

View File

@ -0,0 +1,69 @@
From 614d99eba149d0fafc64dfdddc7ef04970e0d86c Mon Sep 17 00:00:00 2001
From: Michael Brown <mcb30@ipxe.org>
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 <mcb30@ipxe.org>
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

View File

@ -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
* Wed Jun 09 2021 wangkerong <wangkerong@huawei.com> - 1.21.1-2
- Type:bugfix
- Id:NA
- SUG:NA
- DESC: round commmunity patch fix Avoid infinite loop on allocation failure
* Wed Feb 03 2021 gaihuiying <gaihuiying1@huawei.com> - 1.21.1-1
- Type:requirement
- Id:NA