Skip to content

Commit

Permalink
dccp: change L/R must have at least one byte in the dccpsf_val field
Browse files Browse the repository at this point in the history
    
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>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Aug 13, 2008
1 parent c1e24df commit 3e8a0a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3e8a0a5

Please sign in to comment.