[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181122.110741.785675530252485911.davem@davemloft.net>
Date: Thu, 22 Nov 2018 11:07:41 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: Igor.Russkikh@...antia.com
Cc: linux-usb@...r.kernel.org, netdev@...r.kernel.org, andrew@...n.ch,
Dmitry.Bezrukov@...antia.com
Subject: Re: [PATCH v3 net-next 08/21] net: usb: aqc111: Implement TX data
path
From: Igor Russkikh <Igor.Russkikh@...antia.com>
Date: Wed, 21 Nov 2018 10:13:37 +0000
> + if (padding_size != 0)
> + skb_put(skb, padding_size);
I think you want to use skb_put_zero() here rather than leaving it
uninitialized. I know it's padding, but if for some reason this leaks
onto the wire or elsewhere we'll regret not initializing this buffer.
> + /* Copy TX header */
> + skb_push(skb, sizeof(tx_desc));
> + cpu_to_le64s(&tx_desc);
> + skb_copy_to_linear_data(skb, &tx_desc, sizeof(tx_desc));
I seriously wonder if, with all of the invariants wrt. length modulus
and padding, that you can safely just go:
__le64 *p;
p = skb_push(skb, sizeof(tx_desc));
*p = cpu_to_le64(tx_desc);
or something like that.
Powered by blists - more mailing lists