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]
Message-ID: <20210118134856.11df03a0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Mon, 18 Jan 2021 13:48:56 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Vadym Kochan <vadym.kochan@...ision.eu>
Cc:     Jiri Pirko <jiri@...dia.com>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        Oleksandr Mazur <oleksandr.mazur@...ision.eu>
Subject: Re: [RESEND PATCH] net: core: devlink: use right genl user_ptr when
 handling port param get/set

On Mon, 18 Jan 2021 19:39:54 +0200 Vadym Kochan wrote:
> From: Oleksandr Mazur <oleksandr.mazur@...ision.eu>
> 
> Fix incorrect user_ptr dereferencing when handling port param get/set:
> 
>     idx [0] stores the 'struct devlink' pointer;
>     idx [1] stores the 'struct devlink_port' pointer;
> 
> Fixes: f4601dee25d5 ("devlink: Add port param get command")
> Signed-off-by: Oleksandr Mazur <oleksandr.mazur@...ision.eu>
> Signed-off-by: Vadym Kochan <vadym.kochan@...ision.eu>
> ---
> 1) Fixed plvision.com -> plvision.eu

LGTM, but the fixes tag is wrong:

Fixes: 637989b5d77e ("devlink: Always use user_ptr[0] for devlink and simplify post_doit")

right?

> diff --git a/net/core/devlink.c b/net/core/devlink.c
> index ee828e4b1007..738d4344d679 100644
> --- a/net/core/devlink.c
> +++ b/net/core/devlink.c
> @@ -4146,7 +4146,7 @@ static int devlink_nl_cmd_port_param_get_dumpit(struct sk_buff *msg,
>  static int devlink_nl_cmd_port_param_get_doit(struct sk_buff *skb,
>  					      struct genl_info *info)
>  {
> -	struct devlink_port *devlink_port = info->user_ptr[0];
> +	struct devlink_port *devlink_port = info->user_ptr[1];
>  	struct devlink_param_item *param_item;
>  	struct sk_buff *msg;
>  	int err;
> @@ -4175,7 +4175,7 @@ static int devlink_nl_cmd_port_param_get_doit(struct sk_buff *skb,
>  static int devlink_nl_cmd_port_param_set_doit(struct sk_buff *skb,
>  					      struct genl_info *info)
>  {
> -	struct devlink_port *devlink_port = info->user_ptr[0];
> +	struct devlink_port *devlink_port = info->user_ptr[1];
>  
>  	return __devlink_nl_cmd_param_set_doit(devlink_port->devlink,
>  					       devlink_port->index,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ