From 83994913b6603c3a0dbb5ece4b3b5b47457ed99e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 5 Mar 2020 21:48:10 +0100 Subject: imfs: Constify imfs_memfile_bytes_per_block The CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK value is validated by . Changing this value during runtime could lead to memory corruption. Update #3894. --- cpukit/include/rtems/confdefs/libio.h | 2 +- cpukit/include/rtems/imfs.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'cpukit/include') diff --git a/cpukit/include/rtems/confdefs/libio.h b/cpukit/include/rtems/confdefs/libio.h index aced98b3b9..3c45771952 100644 --- a/cpukit/include/rtems/confdefs/libio.h +++ b/cpukit/include/rtems/confdefs/libio.h @@ -196,7 +196,7 @@ static const devFS_data _Filesystem_Root_data = { #error "CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK must be a power of two between 16 and 512" #endif -int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; +const int imfs_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; static IMFS_fs_info_t _IMFS_fs_info; diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h index 565d103226..09e8bd4a9d 100644 --- a/cpukit/include/rtems/imfs.h +++ b/cpukit/include/rtems/imfs.h @@ -66,8 +66,7 @@ typedef struct IMFS_jnode_tt IMFS_jnode_t; * @endcode */ #define IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK 128 - extern int imfs_rq_memfile_bytes_per_block; - extern int imfs_memfile_bytes_per_block; + extern const int imfs_memfile_bytes_per_block; #define IMFS_MEMFILE_BYTES_PER_BLOCK imfs_memfile_bytes_per_block #define IMFS_MEMFILE_BLOCK_SLOTS \ -- cgit v1.2.3