Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e8a0a55 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

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: default avatarEugene Teo <eugenete@kernel.sg>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c1e24df2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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)