FD (file descriptor) is widely used in system software development, and almost all implementations of posix os (including nuttx) use FD as an index. the value of fd needs to be allocated starting from the minimum available value of 3, and each process has a copy, so the same fd value is very easy to reuse in the program. In multi threaded or multi process environments without address isolation, If the ownership, global variables, and competition relationships of fd are not properly handled, there may be issues with fd duplication or accidental closure. Further leading to the following issues, which are difficult to troubleshoot. 1. Security vulnerability: the fd we wrote is not the expected fd and will be accessed by hackers to obtain data 2. Program exceptions or crashes: write or read fd failures, and program logic errors 3. The structured file XML or database is damaged: the data format written to the database is not the expected format. The implementation principle of fdsan is based on the implementation of Android https://android.googlesource.com/platform/bionic/+/master/docs/fdsan.md Signed-off-by: hujun5 <hujun5@xiaomi.com>
83 lines
3.0 KiB
Plaintext
83 lines
3.0 KiB
Plaintext
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
comment "Non-standard Library Support"
|
|
|
|
config LIBC_CRC64_FAST
|
|
bool "Fast CRC64"
|
|
default n
|
|
---help---
|
|
Enable the CRC64 lookup table to compute the CRC64 faster.
|
|
|
|
config LIBC_KBDCODEC
|
|
bool "Keyboard CODEC"
|
|
default n
|
|
---help---
|
|
In NuttX, a keyboard/keypad driver is simply a character driver that
|
|
may have an (optional) encoding/decoding layer on the data returned
|
|
by the character driver. A keyboard may return simple text data
|
|
(alphabetic, numeric, and punctuation) or control characters
|
|
(enter, control-C, etc.). However, in addition, most keyboards
|
|
support actions that cannot be represented as text data. Such
|
|
actions include things like cursor controls (home, up arrow,
|
|
page down, etc.), editing functions (insert, delete, etc.), volume
|
|
controls, (mute, volume up, etc.) and other special functions.
|
|
Some special encoding may be required to multiplex these two classes
|
|
of data.
|
|
|
|
This option enables the functions that implement the encoding and
|
|
decoding of keyboard data. These are the interfaces prototyped in
|
|
include/nuttx/input/kbd_codec.h. While not correctly a part of
|
|
the C library, it is included here because the decoding side of this
|
|
interface must be accessible by end user programs.
|
|
|
|
config LIBC_SLCDCODEC
|
|
bool "Segment LCD CODEC"
|
|
default n
|
|
---help---
|
|
In NuttX, a character-oriented, segment LCD (SLCD) driver is simply
|
|
a character device that may have an (optional) encoding/decoding
|
|
layer on the data provided to the SLCD driver. The application may
|
|
provide simple text data (alphabetic, numeric, and punctuation) or
|
|
control characters (enter, control-C, etc.). However, in addition,
|
|
most SLCDs support actions that cannot be represented as text data.
|
|
Such actions include things like cursor controls (home, up arrow,
|
|
page down, etc.) and other special functions (e.g., blinking). Some
|
|
special encoding may be required to multiplex these two classes of
|
|
data.
|
|
|
|
This option enables the functions that implement the encoding and
|
|
decoding of SLCD data. These are the interfaces prototyped in
|
|
include/nuttx/lcd/slcd_codec.h. While not correctly a part of the C
|
|
library, it is included here because the encoding side of this
|
|
interface must be accessible by end user programs.
|
|
|
|
config LIBC_ENVPATH
|
|
bool "Support PATH Environment Variable"
|
|
default n
|
|
depends on !DISABLE_ENVIRON
|
|
---help---
|
|
Use the contents of the common environment variable to locate executable
|
|
or library files. Default: n
|
|
|
|
config FDSAN
|
|
bool "Enable Fdsan"
|
|
default n
|
|
---help---
|
|
Enable the fdsan support
|
|
|
|
config LIBC_FTOK_VFS_PATH
|
|
string "Relative path to ftok storage"
|
|
default "/var/ftok"
|
|
---help---
|
|
The relative path to where ftok will exist in the root namespace.
|
|
|
|
config LIBC_MEM_FD_VFS_PATH
|
|
string "Relative path to memfd storage"
|
|
default "memfd"
|
|
depends on FS_TMPFS
|
|
---help---
|
|
The relative path to where memfd will exist in the tmpfs namespace.
|