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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YSAwaKONl7vptrX/@mit.edu>
Date:   Fri, 20 Aug 2021 18:44:56 -0400
From:   "Theodore Ts'o" <tytso@....edu>
To:     Jan Kara <jack@...e.cz>
Cc:     linux-ext4@...r.kernel.org
Subject: Re: [PATCH 2/2] tune2fs: Fix conversion of quota files

On Fri, Aug 20, 2021 at 09:46:56PM +0200, Jan Kara wrote:
> 
> diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
> index fbc3833aee98..34ab632fb81c 100644
> --- a/lib/support/mkquota.c
> +++ b/lib/support/mkquota.c
> @@ -569,14 +569,14 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
>   */
>  static errcode_t quota_read_all_dquots(struct quota_handle *qh,
>                                         quota_ctx_t qctx,
> -				       int update_limits EXT2FS_ATTR((unused)))
> +				       int update_limits)
>  {
>  	struct scan_dquots_data scan_data;
>  
>  	scan_data.quota_dict = qctx->quota_dict[qh->qh_type];
>  	scan_data.check_consistency = 0;
> -	scan_data.update_limits = 0;
> -	scan_data.update_usage = 1;
> +	scan_data.update_limits = update_limits;
> +	scan_data.update_usage = 0;
>  
>  	return qh->qh_ops->scan_dquots(qh, scan_dquots_callback, &scan_data);
>  }

This change, while it is correct for tune2fs, is breaking e2fsck's
f_orphquot test.  The root cause is that e2fsck_read_all_quotas() in
e2fsck/super.c is calling quota_update_limits(), where it had wanted
to be reading the quota usage data, not the limits.

I think what we need to do is to take quota_read_all_dquots(), which
is only used by quota_update_limits(), and then fodl it into
quota_update_limits().  And then add a flags parameter to indicate
whether we want to be reading the limits or the usage, and then rename
quota_update_limits() to quota_read_all_dquots().

Does that make sense to you?  (One of the reasons why the quota
functions are all in libsupport is precisely because I knew these
functions still needed more polishing.)

						- Ted

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ