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: <20171002.105601.1655145601306767130.davem@davemloft.net>
Date:   Mon, 02 Oct 2017 10:56:01 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     Michal.Kalderon@...ium.com
Cc:     netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
        dledford@...hat.com, Ariel.Elior@...ium.com
Subject: Re: [PATCH net-next 01/12] qed: Add ll2 option to limit the number
 of bds per packet

From: Michal Kalderon <Michal.Kalderon@...ium.com>
Date: Mon, 2 Oct 2017 11:23:47 +0300

> +		p_pkt = (void *)((u8 *)p_tx->descq_array + desc_size * i);

Hmmm... this is definitely a red flag.

> @@ -63,17 +63,14 @@ struct qed_ll2_rx_packet {
>  struct qed_ll2_tx_packet {
>  	struct list_head list_entry;
>  	u16 bd_used;
> -	u16 vlan;
> -	u16 l4_hdr_offset_w;
> -	u8 bd_flags;
>  	bool notify_fw;
>  	void *cookie;
> -
> +	/* Flexible Array of bds_set determined by max_bds_per_packet */
>  	struct {
>  		struct core_tx_bd *txq_bd;
>  		dma_addr_t tx_frag;
>  		u16 frag_len;
> -	} bds_set[ETH_TX_MAX_BDS_PER_NON_LSO_PACKET];
> +	} bds_set[1];
>  };

If you do this then you have to make the ->descq_array a void pointer
or something.

Otherwise someone will try to access it as an array and it will
explode because the elements of the array are of a variable size.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ