From: Daniel Borkmann <dborkman@xxxxxxxxxx> Date: Thu, 17 Apr 2014 17:26:50 +0200 > From: Vlad Yasevich <vyasevic@xxxxxxxxxx> > > Currently, it is possible to create an SCTP socket, then switch > auth_enable via sysctl setting to 1 and crash the system on connect: ... > What happens while auth_enable=0 in that case is, that > ep->auth_hmacs is initialized to NULL in sctp_auth_init_hmacs() > when endpoint is being created. > > After that point, if an admin switches over to auth_enable=1, > the machine can crash due to NULL pointer dereference during > reception of an INIT chunk. When we enter sctp_process_init() > via sctp_sf_do_5_1B_init() in order to respond to an INIT chunk, > the INIT verification succeeds and while we walk and process > all INIT params via sctp_process_param() we find that > net->sctp.auth_enable is set, therefore do not fall through, > but invoke sctp_auth_asoc_set_default_hmac() instead, and thus, > dereference what we have set to NULL during endpoint > initialization phase. > > The fix is to make auth_enable immutable by caching its value > during endpoint initialization, so that its original value is > being carried along until destruction. The bug seems to originate > from the very first days. > > Fix in joint work with Daniel Borkmann. > > Reported-by: Joshua Kinard <kumba@xxxxxxxxxx> > Signed-off-by: Vlad Yasevich <vyasevic@xxxxxxxxxx> > Signed-off-by: Daniel Borkmann <dborkman@xxxxxxxxxx> Applied and queued up for -stable, thanks everyone. -- To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html