Skip to content
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: icmpv4: Drop ICMPv4 packet if ICMP header is NULL #6170

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

rmstoi
Copy link
Collaborator

@rmstoi rmstoi commented Feb 13, 2018

This commit fixes the crash of echo_server from malformed ICMPv4 packet.

Fixes #6081

Signed-off-by: Ruslan Mstoi [email protected]

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, minor nit pick.

@@ -143,6 +143,11 @@ static inline enum net_verdict process_icmpv4_pkt(struct net_pkt *pkt,

icmp_hdr = net_icmpv4_get_hdr(pkt, &hdr);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually we do not have empty line after setting the var and then checking it, so you could remove this extra line here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for info. Updated patch pushed.

@codecov-io
Copy link

codecov-io commented Feb 13, 2018

Codecov Report

Merging #6170 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6170      +/-   ##
==========================================
- Coverage   52.86%   52.86%   -0.01%     
==========================================
  Files         412      412              
  Lines       40284    40286       +2     
  Branches     7802     7803       +1     
==========================================
  Hits        21296    21296              
- Misses      15773    15774       +1     
- Partials     3215     3216       +1
Impacted Files Coverage Δ
subsys/net/ip/ipv4.c 83.09% <0%> (-2.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b27344...af91a54. Read the comment docs.

@rmstoi rmstoi force-pushed the icmpv4_drop_null_header branch from 79fa6b4 to af91a54 Compare February 13, 2018 13:13
@rmstoi
Copy link
Collaborator Author

rmstoi commented Feb 13, 2018

Patch amended by removing empty line and pushed.

This commit fixes the crash of echo_server from malformed
ICMPv4 packet.

Fixes zephyrproject-rtos#6081

Signed-off-by: Ruslan Mstoi <[email protected]>
@jukkar jukkar merged commit b743f98 into zephyrproject-rtos:master Feb 13, 2018
@rmstoi rmstoi deleted the icmpv4_drop_null_header branch February 13, 2018 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

echo server crash from corrupt ICMPv4 packet
3 participants