-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: tcp2: Lock connection when running from work queue #28595
Merged
jukkar
merged 4 commits into
zephyrproject-rtos:master
from
jukkar:bug-28587-tcp2-data-corruption
Sep 28, 2020
Merged
net: tcp2: Lock connection when running from work queue #28595
jukkar
merged 4 commits into
zephyrproject-rtos:master
from
jukkar:bug-28587-tcp2-data-corruption
Sep 28, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tbursztyka
approved these changes
Sep 22, 2020
Saw some crashes with heavily loaded system, added new commits fixing those. |
bf0c9c2
to
b6d0d9b
Compare
|
b6d0d9b
to
9ceec3f
Compare
mniestroj
reviewed
Sep 23, 2020
We run various TCP function from work queue. Make sure the connection lock is taken before accessing the connection. Signed-off-by: Jukka Rissanen <[email protected]>
Saw this crash with heavily loaded system in mimxrt1050_evk: <err> os: ***** MPU FAULT ***** <err> os: Data Access Violation <err> os: MMFAR Address: 0xc <err> os: r0/a1: 0x80000ab0 r1/a2: 0x800f6a60 r2/a3: 0x00000000 <err> os: r3/a4: 0x800f72a0 r12/ip: 0x00000000 r14/lr: 0x6000eb43 <err> os: xpsr: 0x41000000 <err> os: Faulting instruction address (r15/pc): 0x6000dc82 <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0 <err> os: Current thread: 0x80001a18 (rx_workq) <err> os: Halting system Where the fault at 0x6000dc82 points to ethernet_recv() uint16_t type = ntohs(hdr->type); 6000dc82: 89ab ldrh r3, [r5, #12] Signed-off-by: Jukka Rissanen <[email protected]>
Saw this crash with heavily loaded system in nucleo_f767zi: <err> os: ***** MPU FAULT ***** <err> os: Data Access Violation <err> os: MMFAR Address: 0x0 <err> os: r0/a1: 0x800f6d30 r1/a2: 0x80005d84 r2/a3: 0x00000006 <err> os: r3/a4: 0x00000000 r12/ip: 0x00000001 r14/lr: 0x60013f69 <err> os: xpsr: 0x61000000 <err> os: Faulting instruction address (r15/pc): 0x60014304 <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0 <err> os: Current thread: 0x80001a18 (rx_workq) <err> os: Halting system Where the fault at 0x60014304 points to net_conn_input() } else if (IS_ENABLED(CONFIG_NET_TCP) && proto == IPPROTO_TCP) { src_port = proto_hdr->tcp->src_port; 60014300: f8d9 3000 ldr.w r3, [r9] 60014304: 881a ldrh r2, [r3, #0] Signed-off-by: Jukka Rissanen <[email protected]>
Check that Ethernet header is in the first net_buf fragment. This is very unlikely to happen as device driver is expected to only deliver proper Ethernet frames to upper stack. Signed-off-by: Jukka Rissanen <[email protected]>
2d349c0
to
96c0aad
Compare
mniestroj
approved these changes
Sep 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We run various TCP function from work queue. Make sure the
connection lock is taken before accessing the connection.
Signed-off-by: Jukka Rissanen [email protected]
Possible fix to #28587