Important bugfix for Linux MQ #394

Merged
gaisser merged 2 commits from KSat/fsfw:linux/hotfix-mq into development 2021-04-08 16:31:05 +02:00
Owner

This bug was not an issue on hosted Linux or Rapsberry Pi (at least on the surface), but causes crashes on a Zynq SoC.

A buffer write was exceeded by 4 bytes, causing buffer overflow errors on that system.

The former implementation used the hardcoded value MAX_DATA_SIZE.
I replaced this with getMaximumMessageSize() but this is actually a problem because this will return the size with the header as well.

I suspect even a unit test would not have caught this because this was not an obvious issue on host systems. Maybe valgrind or a static code analyzer would have caught it..

This bug was not an issue on hosted Linux or Rapsberry Pi (at least on the surface), but causes crashes on a Zynq SoC. A buffer write was exceeded by 4 bytes, causing buffer overflow errors on that system. The former implementation used the hardcoded value `MAX_DATA_SIZE`. I replaced this with `getMaximumMessageSize()` but this is actually a problem because this will return the size with the header as well. I suspect even a unit test would not have caught this because this was not an obvious issue on host systems. Maybe `valgrind` or a static code analyzer would have caught it..
muellerr added the
bug
label 2021-04-08 15:29:35 +02:00
muellerr added 1 commit 2021-04-08 15:29:35 +02:00
muellerr changed title from super evil bugfix for Linux MQ to Important bugfix for Linux MQ 2021-04-08 15:32:03 +02:00
muellerr added 1 commit 2021-04-08 15:39:33 +02:00
Owner

Bug is also in OSAL for RTEMS!

**Bug is also in OSAL for RTEMS!**
gaisser added this to the ASTP 1.0.0 Local pools milestone 2021-04-08 16:21:02 +02:00
gaisser self-assigned this 2021-04-08 16:21:05 +02:00
gaisser merged commit 2dd2d8f133 into development 2021-04-08 16:31:05 +02:00
gaisser deleted branch linux/hotfix-mq 2021-04-08 16:31:08 +02:00
Sign in to join this conversation.
No description provided.