Patch "sctp: handle invalid error codes without calling BUG()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sctp: handle invalid error codes without calling BUG()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sctp-handle-invalid-error-codes-without-calling-bug.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit bd73733d8f59f1584299c88e600e0b6fccebfd60
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Fri Jun 9 14:04:43 2023 +0300

    sctp: handle invalid error codes without calling BUG()
    
    [ Upstream commit a0067dfcd9418fd3b0632bc59210d120d038a9c6 ]
    
    The sctp_sf_eat_auth() function is supposed to return enum sctp_disposition
    values but if the call to sctp_ulpevent_make_authkey() fails, it returns
    -ENOMEM.
    
    This results in calling BUG() inside the sctp_side_effects() function.
    Calling BUG() is an over reaction and not helpful.  Call WARN_ON_ONCE()
    instead.
    
    This code predates git.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 82d96441e64d6..c4a2d647e6cc7 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1255,7 +1255,10 @@ static int sctp_side_effects(enum sctp_event event_type,
 	default:
 		pr_err("impossible disposition %d in state %d, event_type %d, event_id %d\n",
 		       status, state, event_type, subtype.chunk);
-		BUG();
+		error = status;
+		if (error >= 0)
+			error = -EINVAL;
+		WARN_ON_ONCE(1);
 		break;
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux