Skip to content

Commit f6f939b

Browse files
committed
tee-supplicant: preserve large REE FS file lengths
REE FS RPC passes file lengths as 64-bit values, but truncate stored them in size_t. This truncated large lengths on 32-bit builds. Enable 64-bit file offsets and use off_t for the truncate length. Fixes: 1472d0e ("Add new RPC FS functions with useful error codes") Signed-off-by: Sungbae Yoo <sungbaey@nvidia.com> Reviewed-by: Jens Wiklander <jens.wiklander@oss.qualcomm.com>
1 parent ab96380 commit f6f939b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tee-supplicant/src/tee_supp_fs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* POSSIBILITY OF SUCH DAMAGE.
2626
*/
2727

28+
#define _FILE_OFFSET_BITS 64
2829
#define _GNU_SOURCE
2930

3031
#include <assert.h>
@@ -392,7 +393,7 @@ static TEEC_Result ree_fs_new_write(size_t num_params,
392393
static TEEC_Result ree_fs_new_truncate(size_t num_params,
393394
struct tee_ioctl_param *params)
394395
{
395-
size_t len = 0;
396+
off_t len = 0;
396397
int fd = 0;
397398

398399
if (num_params != 1 ||

0 commit comments

Comments
 (0)