[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH hurd 09/11] Fix overflow issues in tmpfs and vmallocate
From: |
Samuel Thibault |
Subject: |
Re: [PATCH hurd 09/11] Fix overflow issues in tmpfs and vmallocate |
Date: |
Fri, 29 Dec 2023 22:44:37 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Applied, thanks!
Flavio Cruz, le ven. 29 déc. 2023 16:21:03 -0500, a ecrit:
> ---
> tmpfs/tmpfs.c | 2 +-
> utils/vmallocate.c | 7 +++++--
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tmpfs/tmpfs.c b/tmpfs/tmpfs.c
> index 02d4bd8..d28806a 100644
> --- a/tmpfs/tmpfs.c
> +++ b/tmpfs/tmpfs.c
> @@ -39,7 +39,7 @@ char *diskfs_disk_name = "none";
> int diskfs_default_sync_interval = 0;
>
> /* We must supply some claimed limits, though we don't impose any new ones.
> */
> -int diskfs_link_max = (1ULL << (sizeof (nlink_t) * CHAR_BIT)) - 1;
> +int diskfs_link_max = INT_MAX;
> int diskfs_name_max = 255; /* dirent d_namlen limit */
> int diskfs_maxsymlinks = 8;
>
> diff --git a/utils/vmallocate.c b/utils/vmallocate.c
> index b7eafed..fde8e76 100644
> --- a/utils/vmallocate.c
> +++ b/utils/vmallocate.c
> @@ -160,8 +160,11 @@ main (int argc, char **argv)
> struct child *c, *children = NULL;
> process_t proc = getproc ();
>
> - /* We must make sure that chunk_size fits into vm_size_t. */
> - assert_backtrace (chunk_size <= 1U << (sizeof (vm_size_t) * 8 - 1));
> + /* We must make sure that chunk_size fits into vm_size_t.
> + * We assume sizeof (vm_size_t) = sizeof (uintptr_t). */
> + _Static_assert (sizeof (vm_size_t) == sizeof (uintptr_t),
> + "expected sizeof (vm_size_t) == sizeof (uintptr_t).");
> + assert_backtrace (chunk_size <= UINTPTR_MAX);
>
> /* Parse our arguments. */
> argp_parse (&argp, argc, argv, 0, 0, 0);
> --
> 2.39.2
>
>
--
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.
- Re: [PATCH hurd 04/11] Fix printf format specifiers, (continued)
- [PATCH hurd 07/11] Fix a few pointer related warnings., Flavio Cruz, 2023/12/29
- [PATCH hurd 05/11] x86_64: utmp uses int32_t to store time so use a temporary variable, Flavio Cruz, 2023/12/29
- [PATCH hurd 03/11] Use mach_msg_type_number_t whenever required to avoid warnings, Flavio Cruz, 2023/12/29
- [PATCH hurd 06/11] x86_64: use 21 bytes in libps since %z might require more characters., Flavio Cruz, 2023/12/29
- [PATCH hurd 09/11] Fix overflow issues in tmpfs and vmallocate, Flavio Cruz, 2023/12/29
- Re: [PATCH hurd 09/11] Fix overflow issues in tmpfs and vmallocate,
Samuel Thibault <=
- [PATCH hurd 10/11] libftpconn: add out >= 2 condition to make GCC happy, Flavio Cruz, 2023/12/29
- [PATCH hurd 11/11] pfinet: fix type alias, Flavio Cruz, 2023/12/29
- [PATCH hurd 08/11] proxy-defpager: add missing return statement, Flavio Cruz, 2023/12/29
- Re: [PATCH hurd 01/11] Initialize a few error variables to avoid GCC warnings, Samuel Thibault, 2023/12/29