lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Apr 2021 16:29:06 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc:     "Darrick J. Wong" <djwong@...nel.org>, linux-xfs@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v4][next] xfs: Replace one-element arrays with
 flexible-array members

> Below are the results of running xfstests for "all" with the following
> configuration in local.config:

...

> Other tests might need to be run in order to verify everything is working
> as expected. For such tests, the intervention of the maintainers might be
> needed.

This is a little weird for a commit log.  If you want to show results
this would be something that goes into a cover letter.

> +/*
> + * Calculates the size of structure xfs_efi_log_format followed by an
> + * array of n number of efi_extents elements.
> + */
> +static inline size_t
> +sizeof_efi_log_format(size_t n)
> +{
> +	return struct_size((struct xfs_efi_log_format *)0, efi_extents, n);

These helpers are completely silly.  Just keep the existing open code
version using sizeof with the one-off removed.

> -					(sizeof(struct xfs_efd_log_item) +
> -					(XFS_EFD_MAX_FAST_EXTENTS - 1) *
> -					sizeof(struct xfs_extent)),
> -					0, 0, NULL);
> +					 struct_size((struct xfs_efd_log_item *)0,
> +					 efd_format.efd_extents,
> +					 XFS_EFD_MAX_FAST_EXTENTS),
> +					 0, 0, NULL);
>  	if (!xfs_efd_zone)
>  		goto out_destroy_buf_item_zone;
>  
>  	xfs_efi_zone = kmem_cache_create("xfs_efi_item",
> -					 (sizeof(struct xfs_efi_log_item) +
> -					 (XFS_EFI_MAX_FAST_EXTENTS - 1) *
> -					 sizeof(struct xfs_extent)),
> +					 struct_size((struct xfs_efi_log_item *)0,
> +					 efi_format.efi_extents,
> +					 XFS_EFI_MAX_FAST_EXTENTS),

Same here.  And this obsfucated version also adds completely pointless
overly long lines while making the code unreadable.

Powered by blists - more mailing lists