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: <ZMESLQsNgTGnD2j/@corigine.com>
Date:   Wed, 26 Jul 2023 14:31:41 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     sharmaajay@...uxonhyperv.com
Cc:     Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>,
        Dexuan Cui <decui@...rosoft.com>, Wei Liu <wei.liu@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, linux-rdma@...r.kernel.org,
        linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Ajay Sharma <sharmaajay@...rosoft.com>
Subject: Re: [Patch v2 5/5] RDMA/mana_ib : Query adapter capabilities

On Tue, Jul 25, 2023 at 08:57:00PM -0700, sharmaajay@...uxonhyperv.com wrote:

...

> diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c

...

> +int mana_ib_query_adapter_caps(struct mana_ib_dev *mib_dev)
> +{
> +	struct mana_ib_query_adapter_caps_resp resp = {};
> +	struct mana_ib_query_adapter_caps_req req = {};
> +	int err;
> +
> +	mana_gd_init_req_hdr(&req.hdr, MANA_IB_GET_ADAPTER_CAP, sizeof(req),
> +			     sizeof(resp));
> +	req.hdr.resp.msg_version = MANA_IB__GET_ADAPTER_CAP_RESPONSE_V3;
> +	req.hdr.dev_id = mib_dev->gc->mana_ib.dev_id;
> +
> +	err = mana_gd_send_request(mib_dev->gc, sizeof(req), &req,
> +				   sizeof(resp), &resp);
> +
> +	if (err) {
> +		ibdev_err(&mib_dev->ib_dev, "Failed to query adapter caps err %d", err);
> +		return err;
> +	}
> +
> +	memcpy(&mib_dev->adapter_caps, &resp.max_sq_id,
> +			sizeof(mib_dev->adapter_caps));

Hi Ajay,

The indentation of the line above is off.

	memcpy(&mib_dev->adapter_caps, &resp.max_sq_id,
	       sizeof(mib_dev->adapter_caps));

But, perhaps more importantly, an x86_64 allmodconfig W=1 build with gcc-12
yields:

 In file included from ./include/linux/string.h:254,
                  from ./include/linux/bitmap.h:11,
                  from ./include/linux/ethtool.h:16,
                  from ./include/rdma/ib_verbs.h:15,
                  from drivers/infiniband/hw/mana/mana_ib.h:9,
                  from drivers/infiniband/hw/mana/main.c:6:
 In function 'fortify_memcpy_chk',
     inlined from 'mana_ib_query_adapter_caps' at drivers/infiniband/hw/mana/main.c:626:2:
 ./include/linux/fortify-string.h:592:25: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
   592 |                         __read_overflow2_field(q_size_field, size);
       |

> +	return 0;
> +}

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ