[Devel] [PATCH RHEL8 COMMIT] ve: Change error code in vz_security_protocol_check to -EPROTONOSUPPORT

Konstantin Khorenko khorenko at virtuozzo.com
Fri May 29 20:03:30 MSK 2020


The commit is pushed to "branch-rh8-4.18.0-80.1.2.vz8.3.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-80.1.2.vz8.3.10
------>
commit 58cad9a67c174e08547213515818d8470318d37f
Author: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
Date:   Fri May 29 20:03:30 2020 +0300

    ve: Change error code in vz_security_protocol_check to -EPROTONOSUPPORT
    
    'vz_security_protocol_check' is a part of socket creation routine.
    Socket creation can be split into separate stages:
     - family validation and family specific object creation
     - protocol validation and protocol specific object creation
    First family argument is validated. If family is ok, then the code
    can proceeds to further work with protocol agrument.
    
    As part of family validation procedure for containers
    vz_security_family_check is called. If family is not supported in
    container environment and the current context is container the
    function returns with -EAFNOSUPPORT code.
    
    As part of protocol validation procedure for containers
    vz_security_protocol_check is called. If protocol is not supported
    in container environment and the current context is container the
    function CURRENTLY returns with -EAFNOSUPPORT code, although by
    context of the current socket preparation step it should instead
    return -EPROTONOSUPPORT.
    
    https://jira.sw.ru/browse/PSBM-104225
    
    Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
    Acked-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/ve/ve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index bf9f06db7cff..a94d9cf342f3 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -1059,7 +1059,7 @@ int vz_security_protocol_check(struct net *net, int protocol)
 	case  IPPROTO_SCTP:
 		return 0;
 	default:
-		return -EAFNOSUPPORT;
+		return -EPROTONOSUPPORT;
 	}
 }
 EXPORT_SYMBOL_GPL(vz_security_protocol_check);


More information about the Devel mailing list