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: <AM6PR04MB50160B2B6FB6ADA46EAF76E1F8019@AM6PR04MB5016.eurprd04.prod.outlook.com>
Date:   Wed, 30 Jun 2021 08:29:56 +0000
From:   "Y.b. Lu" <yangbo.lu@....com>
To:     Mat Martineau <mathew.j.martineau@...ux.intel.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
        "mptcp@...ts.linux.dev" <mptcp@...ts.linux.dev>,
        Richard Cochran <richardcochran@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Matthieu Baerts <matthieu.baerts@...sares.net>,
        Shuah Khan <shuah@...nel.org>,
        Michal Kubecek <mkubecek@...e.cz>,
        Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>, Rui Sousa <rui.sousa@....com>,
        Sebastien Laveze <sebastien.laveze@....com>
Subject: RE: [net-next, v4, 08/11] net: sock: extend SO_TIMESTAMPING for PHC
 binding

Hi Mat,

> -----Original Message-----
> From: Mat Martineau <mathew.j.martineau@...ux.intel.com>
> Sent: 2021年6月26日 9:00
> To: Y.b. Lu <yangbo.lu@....com>
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> linux-kselftest@...r.kernel.org; mptcp@...ts.linux.dev; Richard Cochran
> <richardcochran@...il.com>; David S . Miller <davem@...emloft.net>;
> Jakub Kicinski <kuba@...nel.org>; Matthieu Baerts
> <matthieu.baerts@...sares.net>; Shuah Khan <shuah@...nel.org>; Michal
> Kubecek <mkubecek@...e.cz>; Florian Fainelli <f.fainelli@...il.com>;
> Andrew Lunn <andrew@...n.ch>; Rui Sousa <rui.sousa@....com>; Sebastien
> Laveze <sebastien.laveze@....com>
> Subject: Re: [net-next, v4, 08/11] net: sock: extend SO_TIMESTAMPING for
> PHC binding
> 
> On Fri, 25 Jun 2021, Yangbo Lu wrote:
> 
[...]
> > diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> > index ea38cbcd2ad4..e20aefc20d75 100644
> > --- a/net/mptcp/sockopt.c
> > +++ b/net/mptcp/sockopt.c
> > @@ -207,14 +207,26 @@ static int
> mptcp_setsockopt_sol_socket_timestamping(struct mptcp_sock *msk,
> > {
> > 	struct mptcp_subflow_context *subflow;
> > 	struct sock *sk = (struct sock *)msk;
> > +	struct so_timestamping timestamping;
> > 	int val, ret;
> >
> > -	ret = mptcp_get_int_option(msk, optval, optlen, &val);
> > -	if (ret)
> > -		return ret;
> > +	if (optlen == sizeof(timestamping)) {
> > +		if (copy_from_sockptr(&timestamping, optval,
> > +				      sizeof(timestamping)))
> > +			return -EFAULT;
> > +	} else if (optlen == sizeof(int)) {
> > +		if (copy_from_sockptr(val, optval, sizeof(*val)))
>                                        ^^^
> 
> As the kbuild bot noted, this needs to be a pointer. You could pass in
> &timestamping.flags and you wouldn't need the 'val' variable at all.
> 
> 

Ok, I sent v5 to fix.
Sorry for the trouble. It seemed my test config missed to enable MPTCP.

Thanks.

> -Mat
> 
> 
> > +			return -EFAULT;
> > +
> > +		memset(&timestamping, 0, sizeof(timestamping));
> > +		timestamping.flags = val;
> > +	} else {
> > +		return -EINVAL;
> > +	}
> >
> > 	ret = sock_setsockopt(sk->sk_socket, SOL_SOCKET, optname,
> > -			      KERNEL_SOCKPTR(&val), sizeof(val));
> > +			      KERNEL_SOCKPTR(&timestamping),
> > +			      sizeof(timestamping));
> > 	if (ret)
> > 		return ret;
> >
> > @@ -224,7 +236,7 @@ static int
> mptcp_setsockopt_sol_socket_timestamping(struct mptcp_sock *msk,
> > 		struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
> > 		bool slow = lock_sock_fast(ssk);
> >
> > -		sock_set_timestamping(sk, optname, val);
> > +		sock_set_timestamping(sk, optname, timestamping);
> > 		unlock_sock_fast(ssk, slow);
> > 	}
> >
> > --
> > 2.25.1
> >
> >
> 
> --
> Mat Martineau
> Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ