Skip to contentSkip to conversation

sctp: avoid overwrite the return value of sctp_process_asconf_ack()

PATCH Superseded Wei Yongjun 2 participants 2 messages May 12, 2009

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sctp: avoid overwrite the return value of sctp_process_asconf_ack()

The return value of sctp_process_asconf_ack() may be overwritten while process parameters with no error. This patch fixed the problem.

---
 net/sctp/sm_make_chunk.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/sctp/sm_make_chunk.c +2 -1
index ab91712..06ad732 100644
@@ -3271,7 +3271,8 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
 
 		switch (err_code) {
 		case SCTP_ERROR_NO_ERROR:
-			retval = sctp_asconf_param_success(asoc, asconf_param);
+			if (sctp_asconf_param_success(asoc, asconf_param))
+				retval = 1;
 			break;
 
 		case SCTP_ERROR_RSRC_LOW:
Signature · 1 line
1.5.3.8
#1 lore raw
Quoted 14 lines · Wei Yongjun

The return value of sctp_process_asconf_ack() may be overwritten while process parameters with no error. This patch fixed the problem.

---
 net/sctp/sm_make_chunk.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/sctp/sm_make_chunk.c +0 -0
index ab91712..06ad732 100644

net/sctp/sm_make_chunk.c int sctp_process_asconf_ack(struct sctp_association *asoc, · line 3278

Quoted 9 lines
net/sctp/sm_make_chunk.c +2 -1
@@ -3271,7 +3271,8 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
 
 		switch (err_code) {
 		case SCTP_ERROR_NO_ERROR:
-			retval = sctp_asconf_param_success(asoc, asconf_param);
+			if (sctp_asconf_param_success(asoc, asconf_param))
+				retval = 1;
 			break;
 
 		case SCTP_ERROR_RSRC_LOW:

Hmm... As long as you are cleaning up, looks like sctp_asconf_param_success can easily become a void and we avoid this whole thing. Right now, that function will never return 'TRUE'.

-vlad