david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

5682 Commits

Author SHA1 Message Date
Michael Brown c24f772349 [travis] Integrate with Coverity Scan
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-23 10:51:25 +02:00
Michael Brown 9ecad204fc [travis] Build and run the unit test suite
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 22:22:25 +02:00
Michael Brown aa1f7b0f7f [travis] Add minimal .travis.yml file
Allow for automated builds via Travis CI (https://travis-ci.org).

Note that the bin-i386-linux build platform is deliberately omitted
since the required linux-libc-dev:i386 package is not on the allowed
packages list for the Travis 14.04 ("trusty") container environment.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 22:09:26 +02:00
Michael Brown c90b4d82b7 [malloc] Track maximum heap usage
Track the current and maximum heap usage, and display the maximum
during shutdown when DEBUG=malloc is enabled.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 20:01:25 +02:00
Michael Brown 65a3518013 [coverity] Add Coverity user model
Add a trivial model file to prevent Coverity from making various
incorrect assumptions about functions where the iPXE behaviour
diverges from POSIX or Linux norms.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 16:46:03 +02:00
Michael Brown f032556b15 [mucurses] Ensure SLK labels are always terminated
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 16:35:29 +02:00
Michael Brown 3870a7bde2 [sis190] Avoid NULL pointer dereference
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 16:12:56 +02:00
Michael Brown 99e1207a4d [w89c840] Avoid potential array overrun
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:59:27 +02:00
Michael Brown ad725fa7d9 [tlan] Guard against failure to identify chip
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:28:58 +02:00
Michael Brown dea5b74475 [hermon] Assert that mapping length is non-zero
An (impossible) mapping length of zero produces a negative bit shift,
which is technically undefined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:20:14 +02:00
Michael Brown 0ced99e97c [arbel] Assert that mapping length is non-zero
An (impossible) mapping length of zero produces a negative bit shift,
which is technically undefined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:18:54 +02:00
Michael Brown 7495813792 [video_subr] Use memmove() for overlapping memory copy
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:13:06 +02:00
Michael Brown 75bb948008 [tcp] Use correct length for memset()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:11:05 +02:00
Michael Brown 01496a5028 [xen] Use standard calling pattern for asprintf()
Our asprintf() implementation guarantees that strp will be NULL on
allocation failure, but this is not standard behaviour.  Detect errors
by checking for a negative return value instead of a NULL pointer.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 14:41:01 +02:00
Michael Brown 21d8624da8 [usb] Use correct length for memcpy()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 14:14:57 +02:00
Michael Brown 966a960a83 [pixbuf] Avoid potential division by zero
Avoid potential division by zero when performing the check against
multiplication overflow.  (Note that if the width is zero then there
can be no overflow anyway, so it is then safe to bypass the check.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 14:11:19 +02:00
Michael Brown 45f2265bfc [ath] Add missing break statements
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 11:52:09 +02:00
Michael Brown e846bd22c3 [block] Quell spurious Coverity size mismatch warning
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 11:45:28 +02:00
Michael Brown c26c1fd07c [infiniband] Return status code from ib_create_mi()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 11:18:23 +02:00
Michael Brown 39ef530088 [infiniband] Return status code from ib_create_cq() and ib_create_qp()
Any underlying errors arising during ib_create_cq() or ib_create_qp()
are lost since the functions simply return NULL on error.  This makes
debugging harder, since a debug-enabled build is required to discover
the root cause of the error.

Fix by returning a status code from these functions, thereby allowing
any underlying errors to be propagated.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 11:18:02 +02:00
Michael Brown e88e2a2965 [build] Avoid confusing sparse in single-argument DBG() macros
For visual consistency with surrounding lines, the definitions of
DBG_MORE(), DBG_PAUSE(), etc include an unnecessary ##__VA_ARGS__
argument which is always elided.  This confuses sparse, which
complains about DBG_MORE_IF() being called with more than one
argument.

Work around this problem by adding an unused variable argument list to
the single-argument macros DBG_MORE_IF() and DBG_PAUSE_IF().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 08:25:04 +02:00
Michael Brown 6124c0ebfa [xhci] Avoid accessing beyond end of endpoint context array
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 16:22:42 +02:00
Michael Brown 501fa53b25 [mucurses] Attempt to fix use of uninitialised buffer with strcat()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 15:30:05 +02:00
Michael Brown f17cf0ecd0 [http] Add missing check for memory allocation failure
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 15:20:59 +02:00
Michael Brown 1ec2a60614 [eoib] Avoid passing a NULL I/O buffer to netdev_tx_complete_err()
Report errors in eoib_duplicate() via netdev_tx_err() rather than
netdev_tx_complete_err(), since netdev_tx_complete_err() accepts only
valid I/O buffers that are currently in the network device's transmit
queue.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 15:07:10 +02:00
Michael Brown 64de7dc7fd [slam] Avoid NULL pointer dereference in slam_pull_value()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:57:36 +02:00
Michael Brown 60561d0f3d [slam] Fix resource leak on error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:53:13 +02:00
Michael Brown 8963193cda [hyperv] Fix resource leaks on error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:51:03 +02:00
Michael Brown 2ae759219b [mucurses] Attempt to fix resource leaks
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:46:19 +02:00
Michael Brown 583d258b89 [mucurses] Attempt to fix keypress processing logic
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:42:02 +02:00
Michael Brown d29e2d551c [mucurses] Attempt to fix test for empty string
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:37:53 +02:00
Michael Brown 7b113bc744 [usb] Use correct length for memcpy()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:21:54 +02:00
Michael Brown d25e7daf47 [librm] Fail gracefully if asked to ioremap() a zero length
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:17:18 +02:00
Michael Brown 36cffe054d [crypto] Free correct pointer on the error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:07:40 +02:00
Michael Brown 9b581158b5 [802.11] Remove redundant NULL pointer check after dereference
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:01:08 +02:00
Michael Brown eb6acabc8f [sis900] Remove extraneous memset() with incorrect length
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 13:55:04 +02:00
Michael Brown ae915aa5cc [qib7322] Use correct length for memset()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 13:51:56 +02:00
Michael Brown 6ee15cbac3 [linda] Use correct length for memset()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 13:50:51 +02:00
Michael Brown e500e5dd07 [nfs] Fix double free bug on error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 13:46:26 +02:00
Michael Brown 91372d6dab [xfer] Ensure va_end() is called on failure path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 13:38:39 +02:00
Michael Brown a5affc832e [arbel] Avoid potential integer overflow when calculating memory mappings
When the area to be mapped straddles the 2GB boundary, the expression
(high+size) will overflow on the first loop iteration.  Fix by using
(end-size), which cannot underflow.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 12:01:55 +02:00
Michael Brown 6ee62eb242 [hermon] Avoid potential integer overflow when calculating memory mappings
When the area to be mapped straddles the 2GB boundary, the expression
(high+size) will overflow on the first loop iteration.  Fix by using
(end-size), which cannot underflow.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 12:01:51 +02:00
Michael Brown de2c6fa240 [dhcp] Allow vendor class to be changed in DHCP requests
Allow the DHCPv4 vendor class to be specified via the "vendor-class"
setting.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-20 13:58:59 +02:00
Michael Brown 7692a8ff02 [undi] Move PXE API caller back into UNDI driver
As of commit 10d19bd ("[pxe] Always retrieve cached DHCPACK and apply
to relevant network device"), the UNDI driver has been the only user
of pxeparent_call().  Remove the unnecessary layer of abstraction by
refactoring this code back into undinet.c, and fix the ability of
undiisr.S to fall back to chaining to the original handler if we were
unable to unhook our own ISR.

This effectively reverts commit 337e1ed ("[pxe] Separate parent PXE
API caller from UNDINET driver").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-19 15:57:24 +00:00
Michael Brown 6324227dca [efi] Skip cable detection at initialisation where possible
We currently request cable detection in PXE_OPCODE_INITIALIZE to work
around buggy Emulex drivers (see commit c0b61ba ("[efi] Work around
bugs in Emulex NII driver")).

This causes problems with some other NII drivers (e.g. Mellanox),
which may time out if the underlying link is intrinsically slow to
come up.

Attempt to work around both problems simultaneously by requesting
cable detection only if the underlying NII driver does not support
link status reporting via PXE_OPCODE_GET_STATUS.  (This is based on a
potentially incorrect assumption that the buggy Emulex drivers do not
claim to report link status via PXE_OPCODE_GET_STATUS.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-19 13:30:27 +00:00
Michael Brown fdcdc5203b [efi] Provide ACPI table description for SAN devices
Provide a basic proof of concept ACPI table description (e.g. iBFT for
iSCSI) for SAN devices in a UEFI environment, using a control flow
that is functionally identical to that used in a BIOS environment.

Originally-implemented-by: Vishvananda Ishaya Abrams <vish.ishaya@oracle.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-13 12:18:46 +00:00
Michael Brown 553f485734 [efi] Add EFI_ACPI_TABLE_PROTOCOL header and GUID definition
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-10 21:58:05 +00:00
Michael Brown 0463ec32c7 [efi] Update to current EDK2 headers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-10 21:18:03 +00:00
Michael Brown afdebdc163 [build] Provide common ARRAY_SIZE() definition
Several files define the ARRAY_SIZE() macro as used in Linux.  Provide
a common definition for this in include/compiler.h.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-10 15:44:11 +00:00
Vishvananda Ishaya Abrams 4524cc11bf [iscsi] Don't close when receiving NOP-In
Some iSCSI targets send NOP-In.  Rather than closing the connection
when we receive one, it is more user friendly to log a debug message
and keep the connection open.  Eventually, it would be nice if iPXE
supported replying to NOP-Ins, but we might as well keep the
connection open until the target disconnects us.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-09 14:23:22 +00:00