From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesus Sanchez-Palencia Subject: Re: [PATCH v1 net-next 02/14] net: Add a new socket option for a future transmit time. Date: Wed, 27 Jun 2018 16:07:15 -0700 Message-ID: References: <20180627215950.6719-1-jesus.sanchez-palencia@intel.com> <20180627215950.6719-3-jesus.sanchez-palencia@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: tglx@linutronix.de, jan.altenberg@linutronix.de, vinicius.gomes@intel.com, kurt.kanzenbach@linutronix.de, henrik@austad.us, richardcochran@gmail.com, ilias.apalodimas@linaro.org, ivan.khoronzhuk@linaro.org, mlichvar@redhat.com, willemb@google.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us To: Eric Dumazet , netdev@vger.kernel.org Return-path: Received: from mga07.intel.com ([134.134.136.100]:34677 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752233AbeF0XMP (ORCPT ); Wed, 27 Jun 2018 19:12:15 -0400 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Hi Eric, On 06/27/2018 03:16 PM, Eric Dumazet wrote: > > > On 06/27/2018 02:59 PM, Jesus Sanchez-Palencia wrote: >> From: Richard Cochran >> >> This patch introduces SO_TXTIME. User space enables this option in >> order to pass a desired future transmit time in a CMSG when calling >> sendmsg(2). The argument to this socket option is a 6-bytes long struct >> defined as: >> >> struct sock_txtime { >> clockid_t clockid; >> u16 flags; >> }; > > Note that sizeof(struct sock_txtime) is 8, not 6, because of alignments. Oh yeah, sure. > > This means that your implementation of getsockopt(... SO_TXTIME ) > is probably leaking two bytes of kernel stack to user space. I'm failing to see how... There is a memset() in sock.c:1147 clearing all the 8 bytes that we later use to (explicitly) assign each member of the struct. Aren't the 2 extra bytes sanitized, then? What have I missed? Thanks, Jesus