This patch fixes a couple of issues with the stack guard size and
properly constructs the STACK_ALIGN and STACK_ALIGN_SIZE definitions.
The ARM AAPCS requires that the stack pointers be 8 byte aligned. The
STACK_ALIGN_SIZE definition is meant to contain the stack pointer
alignment requirements. This is the required alignment at public API
boundaries (ie stack frames).
The STACK_ALIGN definition is the required alignment for the start
address for stack buffer storage. STACK_ALIGN is used to validate
the allocation sizes for stack buffers.
The MPU_GUARD_ALIGN_AND_SIZE definition is the minimum alignment and
size for the MPU. The minimum size and alignment just so happen to be
32 bytes for vanilla ARM MPU implementations.
When defining stack buffers, the stack guard alignment requirements
must be taken into consideration when allocating the stack memory.
The __align() must be filled in with either STACK_ALIGN_SIZE or the
align/size of the MPU stack guard. The align/size for the guard region
will be 0 when CONFIG_MPU_STACK_GUARD is not set, and 32 bytes when it
is.
The _ARCH_THREAD_STACK_XXXXXX APIs need to know the minimum alignment
requirements for the stack buffer memory and the stack guard size to
correctly allocate and reference the stack memory. This is reflected
in the macros with the use of the STACK_ALIGN definition and the
MPU_GUARD_ALIGN_AND_SIZE definition.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This patch removes the redundant stack alignment check being done. The
stack definition macros enforce the alignment requirements via the
__align() directives.
In addition, fix the rounding down of the psp to be correct. The
actual initial stack pointer is the end of the stack minus the size of
the __esf structure. Rounding down after the subtraction will get us
to the correct offset.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
If network context is closed, send FIN by placing it to the end
of send queue instead of sending it immediately. This way all
pending data is sent before the connection is closed.
Jira: ZEP-1853
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Due to a security advisory released on August 28th 2017[1], it's
advisable to update mbedTLS to 2.6.0.
The vulnerability, identified as CVE-2017-14032, allows bypassing the
authentication of a peer when the authentication mode is configured as
optional (the default is secure, but applications might change the
setting.)
tests/crypto/mbedtls is passing.
[1] https://goo.gl/s4imN6
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The stack address was incorrectly specified when stack usage
was being debugged. This caused compiler to emit this warning
drivers/ieee802154/ieee802154_cc2520.c:1136:16: warning:
dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
((struct cc2520_context *)(&__device_cc2520))->
^
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We use UART1 for UART pipe in a number of qemu tests, so lets do the
same thing for the bluetooth test and move the bluetooth uart to UART2.
Jira: ZEP-2412.
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Implement the Zephyr Read Key Hierarchy Roots command, returning the IR
and ER present in nRF5x ICs when compiling for those.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Implement the first Vendor-Specific Command of the Zephyr specification
other than the 3 mandatory ones already present in the codebase, along
with a Kconfig option to enable and disable the presence of the VS
commands.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The documentation of k_fifo_put mentions that the items must have 32
bits reserved for kernel use as that is where the sys_snode_t pointer
is placed but this detail was not taken into consideration when
designing the cmd_queue which access each element as a btp_cmd.
Note: This probably used to work just because k_fifo_get used to place
data directly into thread's swap_data so the kernel never really touched
the list but with the changes to use k_poll the list is always updated
exposing this issue.
Jira: ZEP-2568
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
TLS and DTLS are not related to each other so allow DTLS to be
enabled even if TLS is disabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The "net app" command was accessing NULL pointer if TLS and UDP were
enabled but DTLS was not.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Earlier we modified the original pkt chain when creating IPv6
fragments. This is not a proper way as the original chain might
still be used in TCP when re-sending a message. So when fragmenting
the packet, clone it first and leave original packet intact. This
occupies litle more memory but is now safe.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is very unlikely to happen but the device will access null
pointer if we do not properly check the return value of header
check function.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When trying to figure out where ICMP / TCP / UDP header is located
in net_buf, print more information about what we were doing if the
header cannot fit the first fragment. This is much needed infomation
in debugging weird issues.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Using memcpy() to copy net_pkt is not safe because there are
pointers inside. So use the new net_pkt_clone() to do that.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is needed when one wants to copy the whole fragment chain
and its head pointer net_pkt.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IP header was stripped by _net_app_ssl_mux() when it received
IP packet. This is fine but if the application expects the get
the IP header, then there is a problem. Fix this by saving IP
header to ssl_context and then putting it back in front of the
packet when the data is passed to application.
Note that this IP header is not used by net_app when the packet
is sent because TLS/DTLS creates a tunnel for transferring packets
and user can only sent packets via this tunnel.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit fixes the issue reported by Coverity: an array compared
against NULL is always false.
Coverity-CID: 143715
Coverity-CID: 143730
THis patch is ported from below patch:
https://gerrit.zephyrproject.org/r/#/c/7419/
Jira : ZEP-2468
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This commit fixes the issue reported by Coverity: an array compared
against NULL is always false.
Coverity-CID: 143687
Coverity-CID: 143737
Coverity-CID: 143740
This patch is ported from the below patch:
https://gerrit.zephyrproject.org/r/#/c/7418/
Jira: ZEP-2468
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This was failing to build when the PWD was not that of the
tests/benchmarks/object_footprint because it was asking to load
$(PWD)/Kconfig.
Kconfig shall be specified with no directory location, as the file
will be imported relative to to Zephyr app's directory.
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
The default IPv6 multicast address count was too small,
increasing addresses to 5.
Jira: ZEP-2560
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The verify_send_report() failed in quark_se_c1000_devboard because
the multicast group was already joined. We can safely ignore this
error for this specific test.
Fixes#1240
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The echo-server sample was using removed net_app_server_tls_disable()
function, the correct one is called net_app_server_disable()
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Replace net_udp_get_hdr and net_udp_set_hdr macros with static inline
function definitions to avoid unused variable build warnings when
NET_UDP is not defined.
This fixes the following warning:
subsys/net/ip/6lo.c: In function 'compress_IPHC_header':
subsys/net/ip/6lo.c:759:22: warning: unused variable 'hdr' [-Wunused-variable]
struct net_udp_hdr hdr, *udp;
^~~
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
k_delayed_work_cancel now only fail if it hasn't been submitted which
means it is not in use anyway so it safe to reset its data regardless
of its return.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
For some reason, the ESP32 HAL defines XCHAL_EXCM_LEVEL to 3. This
enables a version of _Level4Vector that doesn't work on this hardware.
Without complete visibility if the version that should work be axed,
keep both in the tree, but build the working other version instead
if building for ESP32.
Jira: ZEP-2556
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
If the interrupt isn't acknowledged, the callback will continue to be
called.
Jira: ZEP-2556
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Zephyr Security WG requests listing a point of contact on the main
GitHub repo README for security-related inquiries. (This section of
the README is also included in the project intro page, via include
directive.)
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
SYS_DLIST_FOR_EACH_CONTAINER is preferable over using
SYS_DLIST_FOR_EACH_NODE as that avoid casting directly which assumes the
node field is always at the beginning.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Updated doc for release 1.9 for :-
1. Added device tree support for Intel Quark based microcontroller
boards.
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
This tests the situation when there are multiple threads calling
k_queue_get which was causing issues when using k_poll.
Jira: ZEP-2553
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This is necessary in order for k_queue_get to work properly since that
is used with buffer pools which might be used by multiple threads asking
for buffers.
Jira: ZEP-2553
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Updated doc for rel 1.9 for :-
1. TICKLESS Kernel support for nrf RTC timer.
2. Added test cases for stress test round robin scheduling and priority
premptive scheduling.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>