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: <1385046014.10637.44.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Thu, 21 Nov 2013 07:00:14 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Vlad Yasevich <vyasevich@...il.com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH] net: rework recvmsg handler msg_name and msg_namelen
 logic

On Thu, 2013-11-21 at 09:52 -0500, Vlad Yasevich wrote:
> On 11/20/2013 07:38 PM, Hannes Frederic Sowa wrote:
> > diff --git a/include/linux/net.h b/include/linux/net.h
> > index b292a04..4bcee94 100644
> > --- a/include/linux/net.h
> > +++ b/include/linux/net.h
> > @@ -164,6 +164,14 @@ struct proto_ops {
> >  #endif
> >  	int		(*sendmsg)   (struct kiocb *iocb, struct socket *sock,
> >  				      struct msghdr *m, size_t total_len);
> > +	/* Notes for implementing recvmsg:
> > +	 * ===============================
> > +	 * msg->msg_namelen should get updated by the recvmsg handlers
> > +	 * iff msg_name != NULL. It is by default 0 to prevent
> > +	 * returning uninitialized memory to user space.  The recvfrom
> > +	 * handlers can assume that msg.msg_name is either NULL or has
> > +	 * a minimum size of sizeof(struct sockaddr_storage).
>              ^^^^^^^
> 
> You meant "maximum", right?

He meant : A protocol can safely assume there are sizeof(struct
sockaddr_storage) bytes available.

So a protocol should use BUILD_BUG_ON() to make sure sockaddr_storage is
big enough.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ