[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99eb2611ce8a47289a6c6360f29acdd7@AcuMS.aculab.com>
Date: Fri, 4 Dec 2020 09:03:37 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Arjun Roy' <arjunroy@...gle.com>
CC: Stephen Hemminger <stephen@...workplumber.org>,
Arjun Roy <arjunroy.kdev@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"soheil@...gle.com" <soheil@...gle.com>
Subject: RE: [net-next v2 1/8] net-zerocopy: Copy straggler unaligned data for
TCP Rx. zerocopy.
From: Arjun Roy
> Sent: 03 December 2020 23:25
...
> > > You also have to allow for old (working) applications being recompiled
> > > with the new headers.
> > > So you cannot rely on the fields being zero even if you are passed
> > > the size of the structure.
> > >
> >
> > I think this should already be taken care of in the current code; the
> > full-sized struct with new fields is being zero-initialized, then
> > we're getting the user-provided optlen, then copying from userspace
> > only that much data. So the newer fields would be zero in that case,
> > so this should handle the case of new kernels but old applications.
> > Does this address the concern, or am I misunderstanding?
> >
>
> Actually, on closer read, perhaps the following is what you have in
> mind for the old application?
>
> struct zerocopy_args args;
> args.address = ...;
> args.length = ...;
> args.recv_skip_hint = ...;
> args.inq = ...;
> args.err = ...;
> getsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, &args, sizeof(args));
> // sizeof(args) is now bigger when recompiled with new headers, but we
> did not explicitly set the new fields to 0, therefore issues
That's the one...
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists