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] [day] [month] [year] [list]
Date:   Sun, 12 Feb 2017 13:54:28 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     yuan linyu <cugyly@....com>,
        "David S . Miller" <davem@...emloft.net>
Cc:     netdev@...r.kernel.org,
        yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
Subject: Re: [PATH v2 net-next] net: remove member 'max' of struct scm_fp_list

On 2/11/2017 5:36 AM, yuan linyu wrote:

> From: yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
>
> 'max' only used at three places in scm.c,
> 1. in scm_fp_copy(), fpl->max = SCM_MAX_FD;
> 2. in scm_fp_copy(), if (fpl->count + num > fpl->max)
> 3. in scm_fp_dup(), new_fpl->max = new_fpl->count;
> at place 2, fpl->max can be replaced with SCM_MAX_FD.
> no other place read this 'max' again, so it can be removed.
>
> Signed-off-by: yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
> ---
> v1->v2:
>     update commit log to describe correct reason to remove 'max'
>
>  include/net/scm.h |  3 +--
>  net/core/scm.c    | 20 +++++---------------
>  2 files changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/include/net/scm.h b/include/net/scm.h
> index 59fa93c..1301227 100644
> --- a/include/net/scm.h
> +++ b/include/net/scm.h
> @@ -19,8 +19,7 @@ struct scm_creds {
>  };
>
>  struct scm_fp_list {
> -	short			count;
> -	short			max;
> +	unsigned int	count;

    Why break the alignment in the 2nd column?

>  	struct user_struct	*user;
>  	struct file		*fp[SCM_MAX_FD];
>  };
[...]

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ