Commit Graph

84 Commits

Author SHA1 Message Date
Micah Snyder
b47745b691 Bump version from 0.104.0 -> 0.105.0-devel-${TODAY}
Also increase FLEVEL from 140 -> 150.
2021-08-24 18:14:40 -07:00
Micah Snyder
11b66a8350 libclamav: Increase FLEVEL by 10 more to 140
For reference, version 0.103 started at 120 and we're already at 124
with v0.103.3.

Ordinarily we would reserve 10 FLEVELs for each feature release, but
we're implementing a new Long Term Support (LTS) program and will be
starting with 0.103, which means additional critical bug fixes for the
0.103 series for the next 2-3 years.

This commit pushes v0.104's FLEVEL to 140 to ensure that there will be
enough FLEVELs for future 0.103 patch versions.
2021-08-14 15:04:21 -07:00
Micah Snyder
bae444a25b clang-format housekeeping 2021-04-09 19:08:14 -07:00
Micah Snyder
1d21a57c83 NEWS.md: Updates from recent patch versions
Also adds the bytecode enum value for 0.103.2.
2021-04-09 10:05:51 -07:00
Micah Snyder
94a2888222 Bumped version from 0.103.0 -> 0.104.0-devel
FLEVEL       121   -> 130
libclamav    9:5:0 -> 9:6:0
libfreshclam 2:1:0 -> 2:2:0
2020-10-16 03:10:49 -07:00
Micah Snyder
9e08216c1a Update NEWS. Change 0.103.0-devel -> 0.104.0-rc
Update the NEWS to add and correct content prior to the release
candidate.

Changed the version string to have the -rc suffix.

Also fixed a couple of --help and manpage issues.
2020-08-13 13:34:47 -07:00
Micah Snyder (micasnyd)
9e20cdf6ea Add CMake build tooling
This patch adds experimental-quality CMake build tooling.

The libmspack build required a modification to use "" instead of <> for
header #includes. This will hopefully be included in the libmspack
upstream project when adding CMake build tooling to libmspack.

Removed use of libltdl when using CMake.

Flex & Bison are now required to build.

If -DMAINTAINER_MODE, then GPERF is also required, though it currently
doesn't actually do anything.  TODO!

I found that the autotools build system was generating the lexer output
but not actually compiling it, instead using previously generated (and
manually renamed) lexer c source. As a consequence, changes to the .l
and .y files weren't making it into the build. To resolve this, I
removed generated flex/bison files and fixed the tooling to use the
freshly generated files. Flex and bison are now required build tools.
On Windows, this adds a dependency on the winflexbison package,
which can be obtained using Chocolatey or may be manually installed.

CMake tooling only has partial support for building with external LLVM
library, and no support for the internal LLVM (to be removed in the
future). I.e. The CMake build currently only supports the bytecode
interpreter.

Many files used include paths relative to the top source directory or
relative to the current project, rather than relative to each build
target. Modern CMake support requires including internal dependency
headers the same way you would external dependency headers (albeit
with "" instead of <>). This meant correcting all header includes to
be relative to the build targets and not relative to the workspace.

For example, ...

```c
include "../libclamav/clamav.h"
include "clamd/clamd_others.h"
```

... becomes:

```c
// libclamav
include "clamav.h"

// clamd
include "clamd_others.h"
```

Fixes header name conflicts by renaming a few of the files.

Converted the "shared" code into a static library, which depends on
libclamav. The ironically named "shared" static library provides
features common to the ClamAV apps which are not required in
libclamav itself and are not intended for use by downstream projects.
This change was required for correct modern CMake practices but was
also required to use the automake "subdir-objects" option.
This eliminates warnings when running autoreconf which, in the next
version of autoconf & automake are likely to break the build.

libclamav used to build in multiple stages where an earlier stage is
a static library containing utils required by the "shared" code.
Linking clamdscan and clamdtop with this libclamav utils static lib
allowed these two apps to function without libclamav. While this is
nice in theory, the practical gains are minimal and it complicates
the build system. As such, the autotools and CMake tooling was
simplified for improved maintainability and this feature was thrown
out. clamdtop and clamdscan now require libclamav to function.

Removed the nopthreads version of the autotools
libclamav_internal_utils static library and added pthread linking to
a couple apps that may have issues building on some platforms without
it, with the intention of removing needless complexity from the
source. Kept the regular version of libclamav_internal_utils.la
though it is no longer used anywhere but in libclamav.

Added an experimental doxygen build option which attempts to build
clamav.h and libfreshclam doxygen html docs.

The CMake build tooling also may build the example program(s), which
isn't a feature in the Autotools build system.

Changed C standard to C90+ due to inline linking issues with socket.h
when linking libfreshclam.so on Linux.

Generate common.rc for win32.

Fix tabs/spaces in shared Makefile.am, and remove vestigial ifndef
from misc.c.

Add CMake files to the automake dist, so users can try the new
CMake tooling w/out having to build from a git clone.

clamonacc changes:
- Renamed FANOTIFY macro to HAVE_SYS_FANOTIFY_H to better match other
  similar macros.
- Added a new clamav-clamonacc.service systemd unit file, based on
  the work of ChadDevOps & Aaron Brighton.
- Added missing clamonacc man page.

Updates to clamdscan man page, add missing options.

Remove vestigial CL_NOLIBCLAMAV definitions (all apps now use
libclamav).

Rename Windows mspack.dll to libmspack.dll so all ClamAV-built
libraries have the lib-prefix with Visual Studio as with CMake.
2020-08-13 00:25:34 -07:00
Micah Snyder
e2f59af30a Clang-format touchup 2020-07-24 16:37:25 -07:00
Jonas Zaddach (jzaddach)
cd977727f0 Add LZMA & BZip2 decompression to bytecode API
Adds LZMA and BZip2 decompression routines to the bytecode API.
The ability to decompress LZMA and BZip2 streams is particularly
useful for bytecode signatures that extend clamav executable
unpacking capabilities.

Of note, the LZMA format is not well standardized. This API
expects the stream to start with the LZMA_Alone header.

Also fixed a bug in LZMA dictionary size setting.
2020-04-29 09:26:07 -07:00
Micah Snyder
206dbaefe8 Update copyright dates for 2020 2020-01-03 15:44:07 -05:00
Micah Snyder
d4a9a760fc Version increment from 0.102 -> 0.103.
Bumps the version from 0.102.0 to 0.103.0-devel-<date>.
Bumps the FLEVEL from 111 to 120.
Bumps the libclamav and libfreshclam revision numbers from 4 -> 5, and 0 -> 1, respectively.
2019-10-15 12:26:31 -04:00
Micah Snyder (micasnyd)
b819efc769 Updated version strings for 0.102.0-rc. 2019-10-02 16:08:30 -04:00
Micah Snyder (micasnyd)
9c58ba7bd7 Update to clamav-devel to synchronize with the clamav-bytecode-compiler project. 2019-10-02 16:08:24 -04:00
Jonas Zaddach
c84683f2f4 Mach-O bytecode unpackers 2019-10-02 16:08:21 -04:00
Jonas Zaddach
2b776e4b89 Linux bytecode unpackers 2019-10-02 16:08:21 -04:00
Micah Snyder
52cddcbcfd Updating and cleaning up copyright notices. 2019-10-02 16:08:18 -04:00
Micah Snyder
8d53f30804 Added 0.101.1 version information, flevel enum value. Increased the FLEVEL setting to 110 for 0.102.0 devel. Increased the libclamav revision value to account for the clamav-types.h change. 2019-10-02 16:08:17 -04:00
Micah Snyder
2e26e12cab Changing ClamAV version number from 0.101.0 to 0.102.0-devel. 2019-10-02 16:08:17 -04:00
Micah Snyder
72fd33c8b2 clang-format'd using new .clang-format rules. 2019-10-02 16:08:16 -04:00
Micah Snyder
38fe8b69a0 Added .clang-format style rules, clam-format script to automate formatting of ClamAV code, and preparing select files so that clang-format does not alter carefully formatted sections. 2019-10-02 16:08:16 -04:00
Micah Snyder
3c43fffda7 Improvements to signature writing documentation. Notably the inclusion of a comprehensive CL_TYPE file type reference, requested by in bb11408. 2018-12-02 23:07:07 -05:00
Micah Snyder (micasnyd)
2f28382694 Updated version string to 0.101-rc and incremented the FLEVEL to 101. 2018-12-02 23:07:07 -05:00
Micah Snyder
420426dd5f Incrementing the libclamav version numbers to 9.0.0 and setting the version strings to 0.101.0-beta. 2018-12-02 23:07:06 -05:00
Micah Snyder
531ba0a361 Adding FUNC_LEVEL_0100_2 to bytecode api following recent 0.100.2 release. 2018-12-02 23:07:01 -05:00
Micah Snyder
d7979d4ff7 Restructured scan options flags from a single bitflag field to a structure containing multiple bitflag fields. This also required adding a new function to the bytecode API to get scan options a la carte, and modifying the existing function to hand back scan options in the old/deprecated uint32_t bitflag format. Re-generated bytecode iface header files.
Updated libclamav documentation detailing new scan options structure.
Renamed references to 'algorithmic' detection to 'heuristic' detection. Renaming references to 'properties' to 'collect metadata'.
Renamed references to 'scan all' to 'scan all match'.
Renamed a couple of 'Hueristic.*' signature names as 'Heuristics.*' signatures (plural) to match majority of other heuristics.
2018-12-02 23:06:59 -05:00
Micah Snyder
9957ff3c66 Adding bytecode functionlity level for 0.100.1. Incrementing the CL_FLEVEL to 100 for 0.101. 2018-07-30 09:14:28 -04:00
Micah Snyder
d64cd9defd Updated version-related strings, structs, FLEVEL for 0.101.0(-devel). 2018-07-30 09:14:11 -04:00
Micah Snyder (micasnyd)
88005aeb12 bb12085: Converting some constants from enums to defines, because the enums may be evaluated as signed on some systems - notably solaris, causing issues if he value is greater than MAX_INT. 2018-07-30 09:14:07 -04:00
Micah Snyder
c9893ef062 Adding missing commas to FunctionalityLevels enum definition where newer version numbers were added. 2018-04-02 07:58:51 -04:00
Micah Snyder
64e2fedac7 Updated the NEWS.md, and reformatted it to improve the markdown. updated the version string from 0.100.0-rc to 0.100.0 in preparation for the release. 2018-04-02 07:58:46 -04:00
Mickey Sola
46a35abe56 mass update of copyright headers 2015-09-17 13:41:26 -04:00
Kevin Lin
47c2d618cd added BC_PRECLASS hook support; replaces target type 13 2015-03-03 15:00:55 -05:00
Kevin Lin
d549c451d9 bytecode: updated functionality level macros 2014-11-19 12:20:12 -05:00
Kevin Lin
61e3637d08 bytecode api: added support for querying int and booleans from json properties 2014-05-06 16:15:08 -04:00
Kevin Lin
fa7ae4ccbc bytecode api: updated copyright information
bytecode api: added json properties reading implementation
2014-05-06 16:13:48 -04:00
Török Edvin
7719760b66 pdf: implement text extraction (bb #2022) 2011-12-23 17:40:22 +02:00
Török Edvin
c16b3abb8c flag and dump PDF objects with /Launch (bb #3514). 2011-10-08 12:20:42 +03:00
Török Edvin
7606789f91 Better detection for encrypted PDFs (bb #2448)
If --block-encrypted is specified then we can detect Encrypted.PDF if:
 - PDF is encrypted with R 2,3,4 or 5
 - PDF is not displayable without specifying a password

If PDF is encrypted, but is displayable without specifying a password, then it
is not detected as Encrypted.PDF.
2011-05-07 18:14:58 +03:00
Török Edvin
acc8bccb89 bb #2307. 2010-10-19 16:23:19 +03:00
Török Edvin
4116c65d1b Add bytecode API to determine whether running under JIT. 2010-10-18 12:35:39 +03:00
Török Edvin
f73212dc62 Fix bytecode virusname reporting (bb #2255).
Also adds possibility to stop a hook from executing, and set
a virus as heuristic (by using BC.Heuristic* name)
2010-09-10 22:11:32 +03:00
Török Edvin
4abbeb3a6c Sync headers with bytecode compiler. 2010-09-02 18:04:00 +03:00
Török Edvin
1dae00ebf4 bytecode: add icon match API. 2010-08-02 18:21:24 +03:00
Török Edvin
dc200c6b19 Add bytecode API for pdf. 2010-08-02 18:21:24 +03:00
Török Edvin
9f1715ccea Add new bytecode APIs to access the environment.
check_platform(...) is an API that can be used to:
 - blacklist JIT/bytecode on just a very specific platform (not recommended)
 - mask (with 0xf/0xff) some fields, and keep just the flags that uniquely
 identify the system where a bug occurs (for example linux + ppc32).
 - it returns a bool so you can do further checks if needed.

The bytecode also has access to all the information collected from the
environment, so it can make more detailed decisions (based on CPU, presence of
SELinux/PaX, etc.).
You can't introduce new detections via bytecode, but you can write new
conditions using existing ones.

The previously added builtin bytecode moved all the JIT disable logic to
bytecode for easy updating.
2010-07-29 14:06:59 +03:00
Török Edvin
d5ffa2acff Introduce BC_STARTUP bytecode (bb #2101, #2078).
This bytecode will be run in interpreter mode on startup:
it can disable the JIT, or disable all further bytecodes.
There will be a builtin copy of it that is loaded if
no BC_STARTUP bytecodes were loaded (like filetypes_int.h and daily.ftm).
Only one BC_STARTUP bytecode is accepted, so as soon as bytecode.cvd will
contain one, it won't be overridable!

This bytecode will replace all the JIT checks (CPU, selinux, pax) etc.,
and allows to disable the JIT on just specific OS/arch/compiler/etc.
combinations. There are too many combinations to have a dconf flag for each.

Also fix the bytecode dconf so that the individual JIT_* flags actually work
(previously we could disable the entire JIT, or none at all).

Also introduce preliminary support for bytecode test mode (we already have
auto, jit and interpreter mode, introducing another mode here is easiest).
The test mode doesn't actually compare the outputs yet, but it does fail if
the JIT is disabled / falls back to interpreter.
2010-07-29 13:48:18 +03:00
Török Edvin
da91503d8e Properly round ilog/iexp/... 2010-05-14 10:41:42 +03:00
Török Edvin
7ebca3d717 Fix interpreter on new bytecode API tests. 2010-05-13 22:44:41 +03:00
Török Edvin
7a7365efe9 0.96.1 new APIs (cli_map etc.) 2010-05-12 23:51:20 +03:00
Török Edvin
8f5cead087 Fix bytecode_api.h
It helps if I actually run make before committing.
2010-05-07 11:09:17 +03:00