netdb/dns: validate nameserver input in dns_add_nameserver#18670
Open
masc2008 wants to merge 1 commit intoapache:masterfrom
Open
netdb/dns: validate nameserver input in dns_add_nameserver#18670masc2008 wants to merge 1 commit intoapache:masterfrom
masc2008 wants to merge 1 commit intoapache:masterfrom
Conversation
0fd80d4 to
26d1bbe
Compare
Contributor
|
Thanks Jerry, not only for this patch If |
It can't be zero or broadcast addr for a valid dns server. Signed-off-by: shichunma <masc2008@gmail.com>
26d1bbe to
c699efe
Compare
Contributor
Author
thanks, I got your point, and updated. |
cd495a3 to
c699efe
Compare
|
|
||
| errout: | ||
| dns_unlock(); | ||
| fclose(stream); |
| ret = OK; | ||
| } | ||
|
|
||
| dns_unlock(); |
This file contains hidden or 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
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.
Note: Please adhere to Contributing Guidelines.
Summary
from user space, it may receive un-valid dns and call netlib_set_ipvxdnsaddr.
so if add a check in nuttx kernel, it can avoid invalid dns setting.
Impact
it's avoid invalid dns setting, when invalid dns set, dns will fail to work.
Testing
from app, set a dns with addr: 0.0.0.0, then ping domain fails to work.
after add this check, such invaid addr can't be added, so it will continue work.
Tested on BES chip.