Commit Graph

13215 Commits

Author SHA1 Message Date
Loris Nardo
b5767d2c60 jffs2: Add checks for long file name
Add filename length checks to prevent the creation of files and folders
that cannot be listed, unlinked or renamed by subsequent calls.
These changes are sufficient to make the jffs2fsrenamelongname and
jffs2nandfsrenamelongname testcases pass.

Updates #5073
2024-08-23 20:28:23 +00:00
Sebastian Huber
3332e54772 score: Disable ISR for fatal extensions
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
e81a5db70e score: Remove unused _CPU_Fatal_halt()
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
e80883b406 score: Simplify _Terminate()
In _Terminate(), everything after invoking the fatal extensions is essentially
dead code.  Simplify this code block and provide a reasonable safe fall-back
for badly configured applications.  Just disable masked interrupts and execute
an idle loop.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
e2ce9d426a score: Mark _CPU_Thread_Idle_body() as no-return
This helps the compiler to not generate dead code.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
cd748d5f6b nios2: Use higher level error handling
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
2bb8ce9741 bsps/sparc: Use default fatal extension
Provide bsp_reset() through the sparc CPU port.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
002c6067ba bsps: Add fatal source/code to bsp_reset()
Mark bsp_reset() as no-return.  Use default BSP fatal handler in lm32 and m68k
BSPs.  Remove empty bsp_reset() implementation.

Update #5067.
2024-08-23 14:54:37 +00:00
shuhua hua
991b3b1695 Unify the parameters in the function declaration 2024-08-20 06:40:46 +00:00
Loris Nardo
606584d032 msdos: Fix file truncated to 0
Previously the first cluster of the file was not updated when
truncating to 0 but was in any case freed.
Now the first cluster of the file is updated during the truncation,
leaving the directory entry in a consistent state.

Closes #2757
2024-08-15 15:42:26 +00:00
Kinsey Moore
73918bc788 cpukit/libblock: Close all valid FDs
This is intended to close any valid FDs that were opened, but 0 is also
a valid FD. This change ensures that a FD of 0 is also closed properly.

Coverity CID 1467408 (original)

Coverity CID 1616151 (followup)

off_by_one: Testing whether handle fd is strictly greater than zero is
suspicious. fd leaks when it is zero.
2024-08-12 13:21:09 -05:00
Loris Nardo
9c57576a4b open: Fix race condition when called with O_TRUNC
Fix a race condition in which a file opened with O_TRUNC is made
available to other file functions expecting a file descriptor before
the truncation is performed.

This is only possible if the other thread was using an invalid file
descriptor as the open call has yet to finish.

Closes #5109
2024-08-11 18:58:20 +00:00
Joel Sherrill
f920b6f1e4 cpukit/score/src/kern_ntptime.c: Use time_t not a 32-bit type
A time_t (tv_sec) was being assigned to a 32-bit variable. This
introduced a Y2038 issue.

Coverity CID 1512505

Closes #5111.
2024-08-11 02:31:27 +00:00
Joel Sherrill
5e6d7dca8f libblock/src/bdpart-register.c: Do not pass bad value to close()
Coverity CID 1467408

close() was called and fd can potentially be negative.

Closes #5113.
2024-08-11 02:30:19 +00:00
Joel Sherrill
a51b7d4b57 objectinitializeinformation.c: Add Assert for API index too high
Coverity Scan spotted the possibility that the
_Objects_Information_table could be over-indexed if the API
value provided was too high. This function is only used during
initialization and the input should be trusted. Adding a debug
_Assert() emphasizes this trust.

Coverity CID 1512508

Closes #5084.
2024-08-11 01:31:01 +00:00
zak liang
4337300649 lashdisk.c: Invalid printf format string 2024-08-10 17:16:39 -04:00
Chris Johns
cc34558448 libdebugger/powerpc: Add PowerPC support
Closes #5098
2024-08-07 05:09:38 +00:00
Chris Johns
53a62631ac libdebugger/target: Add support for backend code writters
The call lets backends support special methods of writing code.

Updates #5098
2024-08-07 05:09:38 +00:00
Chris Johns
6a367f4689 libdebugger/target: Move global stepping variables in to the target data
Updates #5098
2024-08-07 05:09:38 +00:00
Joel Sherrill
f29986391d aio_fsync.c: Address Coverity dead code issue
Coverity CID 1616018

O_SYNC and O_DSYNC have the same value which led Coverity to note that
checking for both values in if's or switches leads to dead code. The
solution is to add a cpp check that they are equal and enough commentary
so if they ever are not the same, there is a hint as to why the cpp
check got tripped.

Closes #5100.
2024-08-07 03:05:50 +00:00
Matheus Pecoraro
bb950bd770 x86_64/amd64: ACPI support for the AMD64 BSP
- Implements necessary ACPICA OS Services Layer interfaces;
- Retrieve the RSDP from the FreeBSD Bootloader for amd64 or from multiboot2 for amd64efi;
- Add ACPI initialization routine;
- Use ACPI in bsp_reset.
2024-08-06 21:28:15 +00:00
Mohamed Hassan
6ab27bb54e libtests/stackchk04: Add a new testsuite for the detailed reporter
Now as the default reporter is set to be a quiet reporter, we have stackchk test case for the default quiet reporter, stackchk03 for a custom user-defined reporter and stackchk04 for the detailed reporter function
2024-08-06 22:40:12 +03:00
Amar Takhar
81e81d1650 Convert LICENSE to LICENSE.md
This also fixes one spelling mistake:

  jffs2/src/LICENCE -> jffs2/src/LICENSE.md
2024-08-05 21:43:36 +00:00
Amar Takhar
020681779d cpukit/libcsupport: merge TODO and CASES into README 2024-08-05 21:40:57 +00:00
Amar Takhar
3139d38137 cpukit: Convert cpukit/*/README to MarkDown
There are a lot of README files this is just a cursory glance to convert but
will render fine online.  If they don't we can make changes.
2024-08-05 21:37:12 +00:00
the-m3chanic
e13236123c cpukit/sapi/src: fixed grammar mistake in comment in exinit.c 2024-08-05 21:29:58 +00:00
the-m3chanic
362deb38dc cpukit/sapi/src: removed macro, made asm() global at file scope and changed python script being loaded 2024-08-05 21:29:58 +00:00
the-m3chanic
fad8219a4e cpukit/sapi/src: added DEFINE_GDB_PY macro to exinit.c to embed gdb-inline section 2024-08-05 21:29:58 +00:00
Amar Takhar
55a0356d7c cpukit: Convert files to README.md MarkDown 2024-08-02 21:43:39 +00:00
Amar Takhar
52a9fdec5c Convert various files to README.md MarkDown 2024-08-02 21:13:35 +00:00
alessandronardin
adce380138 cpukit/posix/aio*: added support for O_DSYNC
The aio_fsync function now supports the value O_DSYNC for op.
Tests are added to improve coverage and test new features.

Closes #5040.
2024-08-02 20:02:58 +00:00
Mohamed Hassan
dc123bb828 libmisc/stackchk: Add configurability to the stack checker reporting function 2024-08-02 20:00:20 +00:00
shuhua huang
a0eecb52bc fix system fatal error caused by imperfect user input commands, e.g. "rtl sym -u" 2024-08-02 05:54:12 +00:00
Joel Sherrill
30ae3ef9da Revert "objectgetinfo.c: Add test case for API field too high"
This reverts commit 807070a696
2024-07-30 20:33:18 +00:00
Joel Sherrill
807070a696 objectgetinfo.c: Add test case for API field too high
This was spotted by Coverity as CID 1592935.

Closes #5076.
2024-07-27 10:29:05 -05:00
Amar Takhar
0bd9737e58 Move old devel links to GitLab 2024-07-26 21:37:42 +00:00
Loris Nardo
b354087338 getdents: hold the IOP while performing the operation
As all the other functions about file descriptor, getdents should hold the IOP of the file descriptor it is working on.

Closes #5074
2024-07-26 20:01:40 +00:00
Amar Takhar
de8452e32c Update Doxygen to point to GitLab.
These are git.rtems.org links.

Point to LICENSE.md directly it has a TOC now the licenses can be found without
anchors and less to maintain.
2024-07-26 14:25:58 -04:00
Loris Nardo
a558c96c64 msdos: update inode during rename
rename now actively changes the inode of the file being renamed.
This change has been done to fix an issue when the file being renamed is already opened before the rename, in particular failing to update the inode number (and the two lookup tables) could cause at least two problems:
1) A new file created in the same source folder of the file being renamed may get the same fat file descriptor of the renamed file
2) An open to the renamed file opens a new fat file descriptor, thus putting out of sync the operations on the file (two distinct fat file descriptor working on the same clusters and entries)

Previously the inode was in any case changed once the file was closed.

Another possible solution would have been to separate the inode number from the lookup table, but this solution would have required much more memory because it needed to keep track of all files seen in the file system up to the last operation and not only the opened ones.

Closes #5044
2024-07-25 18:22:46 +00:00
alessandronardin
1fe3d396d3 cpukit/posix/src/aio_misc.c: Fix incorrect operator in condition
Coverity Issue: CID 1615135 Control flow issues  (DEADCODE)
2024-07-25 17:29:48 +02:00
alessandronardin
3b96aaddde posix/aio*: Added notification on request completion
The patch adds the generation of a notification after an Asynchronous I/O
request has been completed. The notification is generated using the aio_sigevent
filed in the aiocb struct, as defined by the posix specifiations.
A new control, ensuring the validity of the field, is added on each call to
aio_read(), aio_write() and aio_fsync().
The patch also adds tests to cover the new code, and fixes formatting errors of
various aio files.
2024-07-24 11:05:21 +02:00
Chris Johns
e58ff8984c libcsupport/libio: Add rtems_libio_count_open_iops to return open descriptors
Close #5063
2024-07-24 03:23:06 +00:00
Sebastian Huber
7333afe0ae libdl: Constify TLS offset table 2024-07-20 01:31:57 +00:00
Chris Johns
cc034e7d2f libcsupport/getrusage: Return task and idle time using getrusage
Close #5062
2024-07-18 00:11:09 +00:00
Kinsey Moore
174b69afd6 cpukit/shell: Add window size retrieval control
This adds an environment variable that can be used to enable or disable
window size retrieval for the RTEMS shell. This will also disable window
size retrieval upon failure while allowing the user to re-enable it.
2024-07-18 00:10:15 +00:00
Kinsey Moore
8eb4932b13 cpukit/shell: Account for tick rate in timeouts
On systems that don't provide a proper terminal or have broken window
size detection, the RTEMS shell can take a long time execute commands if
the kernel tick interval is longer than 1ms. This updates the shell
window size retrieval timeout code to account for the kernel tick
interval bringing the experienced timeout from 12.5ms to 1.25ms when
using the default kernel tick interval (10ms).
2024-07-18 00:10:15 +00:00
Sebastian Huber
1dd384bb1b score: Add Doxygen file comment to bsd-tree.h
Update #5049.
2024-07-12 07:50:19 +02:00
Sebastian Huber
26b95e148c libtest: Move parts to extra files
Move the RTEMS test printer and rtems_test_exit() to separate files, to
remove dependencies from the begin/end test messsage support.

Update #4963.
2024-07-10 06:01:25 +00:00
Gedare Bloom
ddbd0d574a score/bsd-tree.h: Clarify the rationale for the file in a comment. 2024-07-09 22:52:40 +00:00
Gedare Bloom
88ca88f3fd cpukit/bsd-tree.h: prepend CPP with RTEMS_ scoping 2024-07-09 22:52:40 +00:00