669 Commits

Author SHA1 Message Date
Sebastian Huber
e37f03e47a Make sure CALLOUT_PROCESSED is not used
This flag is only used in combination with the callout expire list,
which we do not use in libbsd.
2018-07-26 14:35:56 +02:00
Sebastian Huber
6d9d7b1956 Critical bug fix for callouts
FreeBSD has two callout executors, one in software and one in hardware
interrupt context.  In libbsd, all callouts are executed by the timer
server.  Entirely remove the different execution contexts for libbsd.
Previously, this was not properly done which could result an invalid
callout_drain() sequence leading to system memory corruption.
2018-07-26 14:12:46 +02:00
Sebastian Huber
6fb003f588 Fix sporadic test failures via uma_timeout() 2018-07-26 12:03:45 +02:00
Sebastian Huber
94b5368388 Avoid malloc() in getsockaddr()
The getsockaddr() function is used to allocate a struct sockaddr of the
right length and initialize it with userspace provided data.  It is used
for the connect(), bind() and sendit() family functions.  In particular,
the sendit() function is used by the UDP send functions.  This means
each UDP send needs a malloc() and free() invocation.  This is a
performance problem in RTEMS (first-fit heap) and may lead to heap
fragmentation.  Replace the malloc() allocation with a stack allocation.
This requires SOCK_MAXADDRLEN (= 255) of additional stack space for
libbsd.

A further optimization would be to get rid of the stack copy of the
socket address.  However, this would require to check each consumer of
the address to ensure that it is not modified.
2018-07-04 07:20:37 +02:00
Nicolas Tsiogkas
e6f6b5e619 BPF(9): Pass flags to bpfopen() 2018-07-04 07:20:37 +02:00
Christian Mauderer
a779a3b870 pfctl: Undef INET6 to avoid warning. 2018-05-03 07:09:46 +02:00
Christian Mauderer
338f3005fc buildset: Add minimal and everything config.
This adds two new buildset configurations: One that leaves out as much
features as possible and one that enables all features. For the default
configuration WiFi support is now disabled.

To disable IPv6 for the minimal configuration, all -DINET6 are
eliminated in libbsd.py. They are now replaced by a #ifdef that checks
for RTEMS_BSD_MODULE_NETINET6 instead.

Close #3351.
2018-05-03 07:09:46 +02:00
Christian Mauderer
4eb250246d tcpdump: Remove unused file. 2018-05-03 07:09:46 +02:00
Sebastian Huber
443a058db4 Use network services from RTEMS
Close #3419.
2018-04-30 13:42:18 +02:00
Sebastian Huber
ef5d536f84 at91_mci: Simplify XDMA usage 2018-04-27 10:14:44 +02:00
Sebastian Huber
d45899bce8 at91_mci: Get rid of bounce buffer 2018-04-27 09:05:37 +02:00
Sebastian Huber
3fac9e9cd4 at91_mci: Use real interrupt
Execute at91_mci_intr() in interrupt context.  Synchronize MMC requests
via RTEMS interrupt lock.
2018-04-26 15:23:08 +02:00
Sebastian Huber
c7e162abd8 mmc: Optimize mmc_wait_for_req()
Use a self-contained RTEMS binary semaphore instead of msleep() and
wakeup().  This is itself more efficient and in addition allows the use
of mmc_wakeup() in interrupt context.
2018-04-26 15:19:42 +02:00
Sebastian Huber
4b1426368b at91_mci: Fix use of BOARD_MCK 2018-04-26 11:14:39 +02:00
Sebastian Huber
f092186c84 at91_mci: Fix use of pre-processor defines 2018-04-26 11:14:10 +02:00
Sebastian Huber
8189ea825a CRYPTO(4): Port to RTEMS 2018-03-28 07:59:12 +02:00
Sebastian Huber
6600368589 CRYPTO(4): Import from FreeBSD 2018-03-27 14:42:46 +02:00
Sebastian Huber
b8f7836e44 DEVFS(5): Fix warning 2018-03-27 14:42:46 +02:00
Sebastian Huber
2275776d21 dwc_otg: Default to USB host mode
In case no "dr_mode" property is present in the device tree, then
default to USB host mode.  This is necessary to support the Cyclone V
SoC Development Kit.
2018-02-06 09:56:35 +01:00
Sebastian Huber
b79c025a12 dwc_otg: Add compatibility string, constify
Support device tree of  Cyclone V SoC Development Kit.
2018-02-06 09:56:35 +01:00
Sebastian Huber
c30fa94277 Add device tree support for Altera/Intel Cyclone V
Close #3290.
2018-02-06 09:55:31 +01:00
Sebastian Huber
a0633c51db SLEEPQUEUE(9): Update due to API changes
Update #3264.
2018-02-05 10:56:39 +01:00
Sebastian Huber
ea121a0c59 ZONE(9): Avoid function call overhead 2018-01-19 14:51:51 +01:00
Sebastian Huber
4e17f143de DEVICE(9): Fix __BUS_ACCESSOR() 2018-01-08 14:01:02 +01:00
Sebastian Huber
4e3a5d3f03 openssl: Remove superfluous file 2018-01-08 14:00:59 +01:00
Christian Mauderer
9569b39515 at91_mci: Fix for 32k buffer. 2017-11-17 14:28:56 +01:00
Sebastian Huber
c360b1a2dc Revert "RWLOCK(9): Add reader/writer lock implementation"
This was accidentally committed.

This reverts commit 97a98f6cd767b3a68279890488c7b451788f84f4.
2017-11-17 10:49:59 +01:00
Sebastian Huber
b5822c2a0a Revert "SX(9): Implement with reader/writer lock"
This was accidentally committed.

This reverts commit cc7a8d87e7307db738bf39ab1ca3ce1053f1c163.
2017-11-17 10:49:31 +01:00
Sebastian Huber
cc7a8d87e7 SX(9): Implement with reader/writer lock 2017-11-16 09:02:28 +01:00
Sebastian Huber
97a98f6cd7 RWLOCK(9): Add reader/writer lock implementation 2017-11-16 09:02:24 +01:00
Sebastian Huber
b03a1c0b59 Fix file descriptor reference counting in accept()
Update #3132.
2017-11-15 13:25:28 +01:00
Sebastian Huber
06f06d4fdf Fix warning 2017-11-10 14:19:29 +01:00
Sebastian Huber
4525674a97 tcpdump: Fix import/export 2017-11-10 14:13:19 +01:00
Christian Mauderer
9521c08d78 wpa_supplicant: Use arc4random instead of getentropy. 2017-11-10 14:13:19 +01:00
gordon
bc4bb2e9be Update wpa_supplicant/hostapd for 2017-01 vulnerability release.
hostapd: Avoid key reinstallation in FT handshake
Prevent reinstallation of an already in-use group key
Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases
Fix TK configuration to the driver in EAPOL-Key 3/4 retry case
Prevent installation of an all-zero TK
Fix PTK rekeying to generate a new ANonce
TDLS: Reject TPK-TK reconfiguration
WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use
WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used
WNM: Ignore WNM-Sleep Mode Response without pending request
FT: Do not allow multiple Reassociation Response frames
TDLS: Ignore incoming TDLS Setup Response retries

Submitted by:	jhb
Obtained from:	https://w1.fi/security/2017-01/ (against later version)
Security:	FreeBSD-SA-17:07
Security:	CERT VU#228519
Security:	CVE-2017-13077
Security:	CVE-2017-13078
Security:	CVE-2017-13079
Security:	CVE-2017-13080
Security:	CVE-2017-13081
Security:	CVE-2017-13082
Security:	CVE-2017-13086
Security:	CVE-2017-13087
Security:	CVE-2017-13088
Differential Revision:	https://reviews.freebsd.org/D12693
2017-11-10 14:13:19 +01:00
Christian Mauderer
bdc4f21c53 wpa: Port to new files to RTEMS. 2017-11-10 14:13:19 +01:00
Christian Mauderer
b0f0b2f493 wpa: Import all files for KRACK patch. 2017-11-10 14:13:19 +01:00
Christian Mauderer
a506ba970a at91_mci: Add timing to read_ivar. 2017-11-10 14:13:19 +01:00
Christian Mauderer
e7f3260886 freebsd/bus: Check return value of bus_accessor. 2017-11-10 14:13:18 +01:00
Christian Mauderer
ec29b2a0c2 at91_mci: Port to RTEMS and adapt for atsam. 2017-11-10 14:13:15 +01:00
Sebastian Huber
ea5880a3cc at91_mci: Import from FreeBSD 2017-11-10 14:01:58 +01:00
Christian Mauderer
589220752b saf1761_otg: Port to RTEMS. 2017-11-10 14:01:55 +01:00
Christian Mauderer
cf8e1d47e2 usb/saf1761: Import from FreeBSD.
Import the files for the SAF1761 USB controller from
FreeBSD commit:
    642b174daddbd0efd9bb5f242c43f4ab4db6869f
    Tue Apr 4 04:01:02 2017
2017-11-10 13:33:04 +01:00
Christian Mauderer
bed8742caa wpa_supplicant: Fix getopt. 2017-11-10 13:33:03 +01:00
Christian Mauderer
79ad9525a2 wpa_supplicant: Include rtems-bsd-program.h. 2017-11-10 13:33:03 +01:00
Christian Mauderer
4613db09fc wpa_supplicant: Add lock. 2017-11-10 13:33:03 +01:00
Christian Mauderer
ee0c369cdd wpa_supplicant: Move forking command into own file.
The malloc wrapper must not be disabled. Therefore the command that uses
malloc without a wrapper has to live in another file.
2017-11-10 13:33:03 +01:00
Sichen Zhao
ce2262ee28 Add wpa_supplicant_fork command.
Add fork command for wpa supplicant to start a new task.
2017-11-10 13:33:03 +01:00
Sichen Zhao
8f2267bbb9 Port wpa supplicant to RTEMS.
Add wpa_supplicant lib support and shell command support in RTEMS.
2017-11-10 13:33:03 +01:00
Sichen Zhao
9c9d11b481 Import wpa from FreeBSD 2017-11-10 13:33:02 +01:00