netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dccp: change L/R must have at least one byte in the dccpsf_val field
@ 2008-08-13 12:55 Arnaldo Carvalho de Melo
  2008-08-13 15:04 ` gerrit
  2008-08-14  1:08 ` Eugene Teo
  0 siblings, 2 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-08-13 12:55 UTC (permalink / raw)
  To: David S. Miller, Gerrit Renker; +Cc: netdev, dccp

Hi David, Gerrit,

	Please consider applying.

- Arnaldo

dccp: change L/R must have at least one byte in the dccpsf_val field
    
Thanks to Eugene Teo for reporting this problem.
    
Signed-off-by: Eugene Teo <eugenete@kernel.sg>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index b622d97..1ca3b26 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -474,6 +474,11 @@ static int dccp_setsockopt_change(struct sock *sk, int type,
 
 	if (copy_from_user(&opt, optval, sizeof(opt)))
 		return -EFAULT;
+	/*
+	 * rfc4340: 6.1. Change Options
+	 */
+	if (opt.dccpsf_len < 1)
+		return -EINVAL;
 
 	val = kmalloc(opt.dccpsf_len, GFP_KERNEL);
 	if (!val)




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-08-14  1:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-13 12:55 [PATCH] dccp: change L/R must have at least one byte in the dccpsf_val field Arnaldo Carvalho de Melo
2008-08-13 15:04 ` gerrit
2008-08-13 20:49   ` David Miller
2008-08-14  1:08 ` Eugene Teo
2008-08-14  1:12   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).