Patch "af_unix: call proto_unregister() in the error path in af_unix_init()" has been added to the 5.15-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

    af_unix: call proto_unregister() in the error path in af_unix_init()

to the 5.15-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:
     af_unix-call-proto_unregister-in-the-error-path-in-a.patch
and it can be found in the queue-5.15 subdirectory.

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



commit cfb9104394f5d2525237d90b2c7a37aad83af3d0
Author: Yang Yingliang <yangyingliang@xxxxxxxxxx>
Date:   Thu Dec 8 23:01:58 2022 +0800

    af_unix: call proto_unregister() in the error path in af_unix_init()
    
    [ Upstream commit 73e341e0281a35274629e9be27eae2f9b1b492bf ]
    
    If register unix_stream_proto returns error, unix_dgram_proto needs
    be unregistered.
    
    Fixes: 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap")
    Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
    Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
    Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index a579e28bd213..545823c1d5ed 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -3401,6 +3401,7 @@ static int __init af_unix_init(void)
 	rc = proto_register(&unix_stream_proto, 1);
 	if (rc != 0) {
 		pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
+		proto_unregister(&unix_dgram_proto);
 		goto out;
 	}
 



[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