Commit Graph

12535 Commits (86b5c81ea2606de66bf08b00fdfb8ec0735e7df4)
 

Author SHA1 Message Date
Philippe Antoine 86b5c81ea2 dnp3: fix int warnings
There is a hack to know the type of an integer
and do an explicit cast in the python script
generating the C file

Also extends some bounds check against negative values
3 years ago
Philippe Antoine 53fc70a9a7 protodetect: fix int warnings
There is actually a real evasion with AppLayerProtoDetectPMGetProto
using u16 instead of u32 for buflen
3 years ago
Philippe Antoine 743fb12aa8 ci: adds default warning flag about float conversions 3 years ago
Philippe Antoine 46981ccd98 warning: explicit casts to double 3 years ago
Philippe Antoine b88f015bfb source/pcap: remove unused code 3 years ago
Philippe Antoine 05f9b3ffc6 fuzz: restrict flags passed to AppLayerProtoDetectGetProto
So that rust does not panic with an unhandled value
3 years ago
Victor Julien 39bf623fdd af-packet: add send error counter 3 years ago
Victor Julien 373278438d packetpool: ReleasePacket callback check on getter
Any packet coming from the pool should have `PacketPoolReturnPacket`
as its callback. Check that this is the case.
3 years ago
Victor Julien 8a5b945c7b af-packet: only ref mpeer if needed in tpacket v2
We only use it in autofp mode, for reference counting purposes.

Removes 2 atomic operations per packet in the more common workers
runmode.
3 years ago
Victor Julien d272075da0 af-packet: minor output updates 3 years ago
Victor Julien e9c6ad19b3 af-packet: optimize packet setup
Don't set fields we don't use in V3.
3 years ago
Victor Julien cad0ff9ebb af-packet: add counters on how poll() works
Use `capture.afpacket.*` counter name space.
3 years ago
Victor Julien c7ad3f8d30 af-packet: don't check ifstate per send call in IPS
Instead just accept that the socket state leads to `sendto` errors.
So print at most one error per socket.
3 years ago
Victor Julien dab036727f af-packet: simplify AFPWritePacket
Since return code was ignored by all callers, we can just turn it into a
void function and slightly simplify the logic.
3 years ago
Victor Julien 3f79f452ad af-packet: use BUG_ON for 'impossible' condition 3 years ago
Victor Julien 2fab3ff0e8 af-packet: refactor VLAN hdr handling
Update the packet payload after decode, instead of during IPS send.

This means the updates happen in the capture thread, and the VLAN header
is available to logging as well.

Ticket: #4805.
3 years ago
Victor Julien b9189946f9 af-packet: remove tpacket-v1 support
Ticket: #4796.

V2 (for IDS and IPS) and V3 (for IDS) are widely supported. V2 was introduced
in 2008, so we can safely assume that all systems can run V2+.
3 years ago
Jason Ish 1f6a15cdf3 app-layer/template: don't always enable if unittests built
314ec77f88 had the unintended side affect
of enabling the template parser and detection buffer if unittests were
enabled.

Fix this by using the new `Default` method for registering parsers.
However, the buffer still needs an explicit configuration check.

Also convert Notice debug messages to Debug to reduce output when in
unittest mode.  If we feel stronly this should still be Notice in the
template, that is a conversion we can make in the generation script when
generating a new parser.
3 years ago
Jeff Lucovsky 6a470a84e7 tftp: Change references to echo
This commit changes the references to the "echo" protocol to tftp. The
references to echo are part of the template parser code.
3 years ago
Jeff Lucovsky 23faeaea5c ftp: Remove diagnostic print
This commit removes a diagnostic message displayed during extraction of
the EPSV port.
3 years ago
Jeff Lucovsky ca7d097225 netmap: V14 API changes
This commit modifies the Netmap packet handling to use API version 14.

@bmeeks8 contributed many changes instrumental to this effort.
3 years ago
Jeff Lucovsky 3496e543af util: Add sys/ioctl.h to common include
This commit adds another system include file based on autoconf to the
common Suricata include file for convenience.
3 years ago
Jeff Lucovsky 84ee01dbe9 util/log: Include device name with thread count 3 years ago
Jeff Lucovsky 1c1c21be9e config/netmap: Check for latest API version
This commit checks for the latest Netmap API version.
3 years ago
Philippe Antoine c023116857 range: prevents memory leak of file from HTTP2
If a HTTP2 transaction gets freed before the end of the range
request, we need to have the files container which is in
the state, to transfer owernship of this file to the files
container.

Ticket: 4811
3 years ago
Philippe Antoine 15649424a7 conf: avoid quadratic complexity
Ticket: 4812

When adding many sequence nodes
3 years ago
Pierre Chifflier acb3ec6db1 rust/nfs: convert parser to nom7 functions (NFS v2 records) 3 years ago
Pierre Chifflier ea1d03f8e3 rust/nfs: add a maximum number of operations per compound
The `count` combinator preallocates a number of bytes. Since the value
is untrusted, this can result in an Out Of Memory allocation.
Use a maximum value, large enough to cover all current implementations.
3 years ago
Pierre Chifflier 0ffe123330 rust/nfs: convert parser to nom7 functions (NFS v3 and v4 records) 3 years ago
Modupe Falodun c33cfed704 detect-fragoffset: convert unittests to FAIL/PASS APIs
Bug: #4040
3 years ago
Corey Thomas 7be793f7b4 ci: add fedora 35 to builds 3 years ago
Jason Ish 52b9c12f41 smtp: log transaction even if no email present
The SMTP transaction logger was not writing the log if the email
portion of the logger failed, such as in the case of STARTTLS
where this is no email decoded.

Ticket #4817
3 years ago
Sam Muhammed fcf399b02c detect/proto: convert unittests to FAIL/PASS APIs
Task #4027
3 years ago
Modupe Falodun 2a800d572c detect-icode: convert unittests to FAIL/PASS APIs
Bug: #4045
3 years ago
Modupe Falodun 97801c795b detect-id: convert unittests to FAIL/PASS APIs
Bug: #4046
3 years ago
Sam Muhammed 4076c8b762 detect/siggroup: convert unittests to FAIL/PASS APIs
Task #4028
3 years ago
Benjamin Wilkins e21a50fee6 lua: Fix SCRule functions for match scripts
Save Signature structure to lua register so SCRule functions can work
in match scripts, where no PacketAlert is present

Resolves Feature #2450
3 years ago
Jason Ish 9b71f56728 modbus: free eve thread context on deinit
Was triggering ASAN leak detection.
3 years ago
Jason Ish eb6cc62937 dhcp: fix url in comment
rustdoc was complaining about the format of the URL in a comment
while trying to generate documentation. Convert the comment to a
non-rustdoc comment for now to satisfy rustdoc.
3 years ago
Jason Ish 55ff912ee7 app-layer: remove IsTxEventAware: never used
The function AppLayerParserProtocolIsTxEventAware is not used so
remove.
3 years ago
Jason Ish b57280ff48 rdp: fix transaction id
By our convention the transaction ID is incremented then applied
to the new transaction. And the generic transaction iterator
requires this behaviour.
3 years ago
Jason Ish 1ad71b96da app-layer: remove tx detect state setter and getter
Instead access detect state through AppLayerParserGetTxData.
3 years ago
Jason Ish 9c67c634c1 app-layer: include DetectEngineState in AppLayerTxData
Every transaction has an existing mandatory field, tx_data. As
DetectEngineState is also mandatory, include it in tx_data.

This allows us to remove the boilerplate every app-layer has
for managing detect engine state.
3 years ago
Jason Ish f4b4d531b0 rdp: add tx iterator 3 years ago
Jason Ish 238ec953b7 krb5: use tx iterator 3 years ago
Jason Ish ef0c351953 ntp: add tx iterator 3 years ago
Jason Ish 871fb035b4 sip: add tx iterator 3 years ago
Jason Ish d6b2d7e16a ike: add tx iterator
For IKE the manual iterator functions were there, but never
registered. So this commit does add a tx iterator to ike.
3 years ago
Jason Ish 3f2d2bc12b snmp: use generic tx iterator 3 years ago
Jason Ish ac4c5ada2f dhcp: use generic tx iterator 3 years ago