Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9810585
Update source location for coverity
AniruddhaKanhere May 26, 2022
e8704a3
Merge branch 'FreeRTOS:main' into main
AniruddhaKanhere Jun 1, 2022
dfd1eb3
Add coverage checker
AniruddhaKanhere Jun 1, 2022
ed0a199
Add build check with default configuration
AniruddhaKanhere Jun 1, 2022
690f42e
Fix build combination and DNS error
AniruddhaKanhere Jun 1, 2022
9d051fd
uncrustified and fixed cmakelists
AniruddhaKanhere Jun 1, 2022
17efec9
Merge branch 'FreeRTOS:main' into main
AniruddhaKanhere Jul 1, 2022
1798486
This commit updates version number in all files to Development-Branch
AniruddhaKanhere Jul 1, 2022
9baf09c
Merge branch 'FreeRTOS:main' into main
AniruddhaKanhere Jul 6, 2022
29f2c27
Update version number macros
AniruddhaKanhere Jul 6, 2022
8ef5462
This commit fixes a typo in version number macro
AniruddhaKanhere Jul 6, 2022
13fc92b
Merge branch 'main' into main
AniruddhaKanhere Jul 6, 2022
7c4f653
Added a 'critical section' to prevent a race condition in stream buffers
AniruddhaKanhere Jul 6, 2022
ae7cc2c
Merge branch 'main' into main
AniruddhaKanhere Jul 6, 2022
d000125
Uncrustify: triggered by comment.
actions-user Jul 6, 2022
0d132e9
Fixed unit-tests by adding mocked functions
AniruddhaKanhere Jul 6, 2022
9984e16
Merge branch 'main' of https://github.com/aniruddhakanhere/freertos-p…
AniruddhaKanhere Jul 6, 2022
b76e4c3
Merge branch 'main' into main
aggarg Jul 7, 2022
1ccddfe
Merge branch 'FreeRTOS:main' into main
AniruddhaKanhere Jul 21, 2022
4e6edca
Merge branch 'FreeRTOS:main' into main
AniruddhaKanhere Jul 28, 2022
8ab4271
Merge branch 'FreeRTOS:main' into main
AniruddhaKanhere Aug 2, 2022
581b83a
Initial commit of file README.md
AniruddhaKanhere Aug 2, 2022
56be8f1
Update README.md
AniruddhaKanhere Aug 2, 2022
53f95cf
Fix the title of README file in coverity
AniruddhaKanhere Aug 2, 2022
400af4f
Addressed issue comments
AniruddhaKanhere Aug 3, 2022
d1c147c
Update command
AniruddhaKanhere Aug 3, 2022
b48856d
Add details about remaining exception
AniruddhaKanhere Aug 3, 2022
422169c
Move file to original location
AniruddhaKanhere Aug 8, 2022
b920fd0
Merge branch 'main' into main
AniruddhaKanhere Aug 8, 2022
33cb801
Remove use of sudo in commands
AniruddhaKanhere Aug 8, 2022
acdac9e
Fix links; added coverity version note
AniruddhaKanhere Aug 8, 2022
7364eb1
Update README.md
AniruddhaKanhere Aug 8, 2022
74c939f
Remove CMake installation instructions
AniruddhaKanhere Aug 8, 2022
0abf6b5
Merge branch 'main' of https://github.com/AniruddhaKanhere/freertos-p…
AniruddhaKanhere Aug 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MISRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Since the FreeRTOS-Plus-TCP library is designed for small-embedded devices, it n
be efficient. To achieve that and to increase the performace of the IP-stack, it deviates from some MISRA rules.
The specific deviations, suppressed inline, are listed below.

Additionally, [MISRA configuration file](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/tools/coverity_misra.config) contains the project wide deviations.
Additionally, [MISRA configuration file](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/test/Coverity/coverity_misra.config) contains the project wide deviations.

### Suppressed with Coverity Comments
To find the violation references in the source files run grep on the source code
Expand Down
62 changes: 62 additions & 0 deletions test/Coverity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Static code analysis for FreeRTOS-Plus-TCP library
This directory is made for the purpose of statically testing the MISRA C:2012 compliance of FreeRTOS+TCP using
[Synopsys Coverity](https://www.synopsys.com/software-integrity/security-testing/static-analysis-sast.html) static analysis tool.
To that end, this directory provides a [CMake](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/test/Coverity/CMakeLists.txt)
file and [configuration files](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/tree/main/test/Coverity/ConfigFiles) required to build
an application for the tool to analyze.

> **Note**
For generating the report as outlined below, we have used Coverity version 2018.09.

For details regarding the suppressed violations in the report (which can be generated using the instructions described below), please
see the [MISRA.md](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md) file.

## Getting Started
### Prerequisites
You can run this on a platform supported by Coverity. The list and other details can be found [here](https://sig-docs.synopsys.com/polaris/topics/c_coverity-compatible-platforms.html).
To compile and run the Coverity target successfully, you must have the following:

1. CMake version > 3.13.0 (You can check whether you have this by typing `cmake --version`)
2. GCC compiler
- You can see the downloading and installation instructions [here](https://gcc.gnu.org/install/).
3. Download the repo and include the submodules using the following commands.
- `git clone --recurse-submodules https://github.com/FreeRTOS/FreeRTOS-Plus-TCP.git ./FreeRTOS_TCP`
- `cd ./FreeRTOS_TCP`
- `git submodule update --checkout --init --recursive`

### To build and run coverity:
Go to the root directory of the FreeRTOS-Plus-TCP repo and run the following commands in terminal:
1. Update the compiler configuration in Coverity
~~~
cov-configure --force --compiler cc --comptype gcc
~~~
2. Create the build files using CMake in a `build` directory
~~~
cmake -B build -S test/Coverity
~~~
3. Go to the build directory and copy the coverity configuration file
~~~
cd build/
cp ../test/Coverity/coverity_misra.config .
~~~
4. Build the (pseudo) application
~~~
cov-build --emit-complementary-info --dir cov-out make
~~~
5. Go to the Coverity output directory (`cov-out`) and begin Coverity static analysis
~~~
cd cov-out/
cov-analyze --dir . --coding-standard-config ../coverity_misra.config --tu-pattern "file('.*/FreeRTOS-Plus-TCP/source/.*')"
~~~
6. Format the errors in HTML format so that it is more readable while removing the FreeRTOS-Kernel directory from the report
~~~
cov-format-errors --dir . --exclude-files '(.*/FreeRTOS-Kernel/.*)' --html-output html-output
~~~

You should now have the HTML formatted violations list in a directory named `html-output`.
With the current configuration and the provided project, you should see only one deviation from advisory rule 8.13 in file
FreeRTOS_IP.c [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/4ac10c84a384f0414f4aec0d4be0ee7c345f2f8b/source/FreeRTOS_IP.c#L236).
This deviation has a justification outlined [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-813). With
that justification in place, a coverity suppression statement has been added to the code. However, even with that suppression in
place, the coverity tool continues to report the deviation. Thus, as an exception, we have allowed the deviation to be reported in
the HTML formatted report. If you find a way around it, please help us fix this by creating a pull-request in this repository.
File renamed without changes.