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]
Date:   Sat, 30 Oct 2021 15:35:32 +0000
From:   Haiyang Zhang <haiyangz@...rosoft.com>
To:     Dexuan Cui <decui@...rosoft.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "gustavoars@...nel.org" <gustavoars@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     KY Srinivasan <kys@...rosoft.com>,
        "stephen@...workplumber.org" <stephen@...workplumber.org>,
        "wei.liu@...nel.org" <wei.liu@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        Shachar Raindel <shacharr@...rosoft.com>,
        Paul Rosswurm <paulros@...rosoft.com>,
        "olaf@...fle.de" <olaf@...fle.de>, vkuznets <vkuznets@...hat.com>
Subject: RE: [PATCH net-next 2/4] net: mana: Report OS info to the PF driver



> -----Original Message-----
> From: Dexuan Cui <decui@...rosoft.com>
> Sent: Friday, October 29, 2021 8:54 PM
> To: davem@...emloft.net; kuba@...nel.org; gustavoars@...nel.org; Haiyang
> Zhang <haiyangz@...rosoft.com>; netdev@...r.kernel.org
> Cc: KY Srinivasan <kys@...rosoft.com>; stephen@...workplumber.org;
> wei.liu@...nel.org; linux-kernel@...r.kernel.org; linux-
> hyperv@...r.kernel.org; Shachar Raindel <shacharr@...rosoft.com>; Paul
> Rosswurm <paulros@...rosoft.com>; olaf@...fle.de; vkuznets
> <vkuznets@...hat.com>; Dexuan Cui <decui@...rosoft.com>
> Subject: [PATCH net-next 2/4] net: mana: Report OS info to the PF driver
> 
> The PF driver might use the OS info for statistical purposes.
> 
> Signed-off-by: Dexuan Cui <decui@...rosoft.com>
> ---
>  drivers/net/ethernet/microsoft/mana/gdma_main.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> index cee75b561f59..8a9ee2885f8c 100644
> --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> @@ -3,6 +3,8 @@
> 
>  #include <linux/module.h>
>  #include <linux/pci.h>
> +#include <linux/utsname.h>
> +#include <linux/version.h>
> 
>  #include "mana.h"
> 
> @@ -848,6 +850,15 @@ int mana_gd_verify_vf_version(struct pci_dev *pdev)
>  	req.gd_drv_cap_flags3 = GDMA_DRV_CAP_FLAGS3;
>  	req.gd_drv_cap_flags4 = GDMA_DRV_CAP_FLAGS4;
> 
> +	req.drv_ver = 0;	/* Unused*/
> +	req.os_type = 0x10;	/* Linux */

Instead of a magic number, could you define it as a macro?

Other parts look fine.

Reviewed-by: Haiyang Zhang <haiyangz@...rosoft.com>

> +	req.os_ver_major = LINUX_VERSION_MAJOR;
> +	req.os_ver_minor = LINUX_VERSION_PATCHLEVEL;
> +	req.os_ver_build = LINUX_VERSION_SUBLEVEL;
> +	strscpy(req.os_ver_str1, utsname()->sysname,
> sizeof(req.os_ver_str1));
> +	strscpy(req.os_ver_str2, utsname()->release,
> sizeof(req.os_ver_str2));
> +	strscpy(req.os_ver_str3, utsname()->version,
> sizeof(req.os_ver_str3));
> +
>  	err = mana_gd_send_request(gc, sizeof(req), &req, sizeof(resp),
> &resp);
>  	if (err || resp.hdr.status) {
>  		dev_err(gc->dev, "VfVerifyVersionOutput: %d, status=0x%x\n",
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ