[Devel] [PATCH rh7 v2] netlink: Don't manipulate @sk_peek_off if data fetching failed

Cyrill Gorcunov gorcunov at virtuozzo.com
Mon Feb 6 05:28:39 PST 2017


On Mon, Feb 06, 2017 at 03:58:52PM +0300, Konstantin Khorenko wrote:
> So, what is the result of discussion here?
> 
> --
> Best regards,
> 
> Konstantin Khorenko,
> Virtuozzo Linux Kernel Team
> 
> On 12/23/2016 10:19 AM, Cyrill Gorcunov wrote:
> > On Fri, Dec 23, 2016 at 09:59:28AM +0300, Cyrill Gorcunov wrote:
> > > On Thu, Dec 22, 2016 at 04:45:10PM -0800, Andrey Vagin wrote:
> > > > 
> > > > Actually, this patch breaks the old behaviour even when MSG_PEEK isn't set.
> > > > 
> > > > I was thinking a bit more and I don't understand why it is a problem. If
> > > > we can't fill a buffer, an error will be returned and a user will be able
> > > > to set peek_offset to get these data again.
> > > 
> > > A user doesn't have to set peek again, without the patch the internal state
> > > of sk is context-dependant, which is broken design. Take a look on unix
> > > sockets code, they DON'T modify offset if something earlier failed for
> > > exactly same reason.
> > 
> > Another option -- set offset only iff data copying passed.

I think the patch is correct. Up to Andrew, since it's his code in first place.


More information about the Devel mailing list