summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/IpFragment.c
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Use layers info to extract IP header in IpFragmentAnand Kumar2018-12-211-34/+28
| | | | | | | | | | - Rely on layers l3Offset field to get offset of IP header. - Aslo fix passing 'newNbl' to IP fragment which is not required. - Fixed including a header file twice. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* treewide: Fix spelling of "receive".Ben Pfaff2018-09-271-2/+2
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* datapath-windows: Do not drop Ip fragments less than MIN_FRAGMENT_SIZEAnand Kumar2018-03-081-6/+3
| | | | | | | | | | | | | | | | | Previously ipfragment module would drop any fragments less than MIN_FRAGMENT_SIZE (400 bytes), which was added to safeguard against the vulnerability CVE-2000-0305. This check is incorrect, since minimum size of the Ipfragment is 68 bytes (i.e. max length of Ip Header + 8 bytes of L4 header). So Ip fragments less than MIN_FRAGMENT_SIZE (400 bytes) is not guranted to be malformed or illegal. To guard against security vulnerability CVE-2000-0305, for a given ip datagram, ipfragments should be dropped only when number of smallest fragments recieved reaches a certain threshold. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Fix possible NULL dereference in IpFragmentAlin Serdean2017-11-291-0/+1
| | | | | | | | | If we can't allocate the NBL just go to the cleanup sequence. Found using WDK 10 static code analysis. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@gmail.com>
* datapath-windows: Fix bugs in cleaner threadsShashank Ram2017-09-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conntrack, Conntrack-related, Stt, and IP fragmentation have cleaner threads that run periodically to clean up their respective tables. During driver unload, OvsExtDetach() calls into routines that are meant for explicitly cleaning these tables up and freeing the resources associated with these threads. If during driver unload, these cleaner threads run immediately after the resources are freed, such as locks used by these threads, then the cleaner threads result in a kernel crash since they try to acquire locks that have already been freed. For eg, OvsIpFragmentEntryCleaner() caused a kernel crash because it tried to acquire a lock that was already freed by OvsCleanupIpFragment(). The fix is to simply exit the cleaner thread if the lock associated with the thread is not initialized, because the only way the threads can run when the lock is invalid is when the lock has been freed up during driver unload. Testing done: Verified that cleaner threads run as expected without crashing during driver unload. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add annotation for OvsIpFragmentEntryCleanerAlin Serdean2017-08-021-1/+1
| | | | | | | | Make the function `OvsIpFragmentEntryCleaner` aware it is a kstart_routine. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Shashank Ram <rams@vmware.com>
* datapath-windows: Add validations in fragmentation moduleAnand Kumar2017-07-101-12/+29
| | | | | | | | | | | | | | | - Minimum valid fragment size is 400 bytes, any fragment smaller is likely to be intentionally crafted (CVE-2000-0305). - Validate maximum length of an Ip datagram - Added counters to keep track of number of fragments for a given Ip datagram. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Fix possible null dereference in ipfragmentAlin Serdean2017-05-231-1/+1
| | | | | | | | Found using static analysis tools. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Retain MRU value in the _OVS_BUFFER_CONTEXT.Anand Kumar2017-05-081-0/+2
| | | | | | | | | | This patch introduces a new field MRU(Maximum Recieved Unit) in the _OVS_BUFFER_CONTEXT and it is used only for Ip Fragments to retain MRU for the reassembled IP datagram when the packet is forwarded to userspace. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* datapath-windows: Added a new file to support Ipv4 fragments.Anand Kumar2017-05-081-0/+511
This patch adds functionalities to support IPv4 fragments, which will be used by Conntrack module. Added a new structure to hold the Ipv4 fragments and a hash table to hold Ipv4 datagram entries. Also added a clean up thread that runs every minute to delete the expired IPv4 datagram entries. The individual fragments are ignored by the conntrack. Once all the fragments are recieved, a new NBL is created out of the reassembled fragments and conntrack executes actions on the new NBL. Created new APIs OvsProcessIpv4Fragment() to process individual fragments, OvsIpv4Reassemble() to reassemble Ipv4 fragments. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>