Patch "sctp: handle invalid error codes without calling BUG()" has been added to the 6.1-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 6.1-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-6.1 subdirectory.

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



commit 6e2560f9193edf9aeb40bc550a55cf46ad075398
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 463c4a58d2c36..970c6a486a9b0 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1251,7 +1251,10 @@ static int sctp_side_effects(enum sctp_event_type 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