From: Hyunchul Lee hyc.lee@gmail.com
mainline inclusion from mainline-5.15-rc1 commit 99f45259fe121a10881f486e075019260f403b6a category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA
Reference: https://git.kernel.org/torvalds/linux/c/99f45259fe12
-------------------------------
Because functions and variables generated from ASN1 compiler aren't static, append ksmbd prefix into thoses to avoid link errors.
Signed-off-by: Hyunchul Lee hyc.lee@gmail.com Signed-off-by: Namjae Jeon namjae.jeon@samsung.com Signed-off-by: Steve French stfrench@microsoft.com Signed-off-by: Jason Yan yanaijie@huawei.com Signed-off-by: Zhong Jinghua zhongjinghua@huawei.com --- fs/cifsd/asn1.c | 27 ++++++------ fs/cifsd/ksmbd_spnego_negtokeninit.asn1 | 31 +++++++++++++ ...rg.asn1 => ksmbd_spnego_negtokentarg.asn1} | 2 +- fs/cifsd/spnego_negtokeninit.asn1 | 43 ------------------- 4 files changed, 47 insertions(+), 56 deletions(-) create mode 100644 fs/cifsd/ksmbd_spnego_negtokeninit.asn1 rename fs/cifsd/{spnego_negtokentarg.asn1 => ksmbd_spnego_negtokentarg.asn1} (80%) delete mode 100644 fs/cifsd/spnego_negtokeninit.asn1
diff --git a/fs/cifsd/asn1.c b/fs/cifsd/asn1.c index 1be3072fee1a..2c63a3e5618b 100644 --- a/fs/cifsd/asn1.c +++ b/fs/cifsd/asn1.c @@ -18,8 +18,8 @@ #include "asn1.h" #include "connection.h" #include "auth.h" -#include "spnego_negtokeninit.asn1.h" -#include "spnego_negtokentarg.asn1.h" +#include "ksmbd_spnego_negtokeninit.asn1.h" +#include "ksmbd_spnego_negtokentarg.asn1.h"
#define SPNEGO_OID_LEN 7 #define NTLMSSP_OID_LEN 10 @@ -119,7 +119,7 @@ int ksmbd_decode_negTokenInit(unsigned char *security_blob, int length, struct ksmbd_conn *conn) { - return asn1_ber_decoder(&spnego_negtokeninit_decoder, conn, + return asn1_ber_decoder(&ksmbd_spnego_negtokeninit_decoder, conn, security_blob, length); }
@@ -127,7 +127,7 @@ int ksmbd_decode_negTokenTarg(unsigned char *security_blob, int length, struct ksmbd_conn *conn) { - return asn1_ber_decoder(&spnego_negtokentarg_decoder, conn, + return asn1_ber_decoder(&ksmbd_spnego_negtokentarg_decoder, conn, security_blob, length); }
@@ -248,8 +248,8 @@ int build_spnego_ntlmssp_auth_blob(unsigned char **pbuffer, u16 *buflen, return 0; }
-int gssapi_this_mech(void *context, size_t hdrlen, unsigned char tag, - const void *value, size_t vlen) +int ksmbd_gssapi_this_mech(void *context, size_t hdrlen, unsigned char tag, + const void *value, size_t vlen) { unsigned long *oid; size_t oidlen; @@ -273,8 +273,9 @@ int gssapi_this_mech(void *context, size_t hdrlen, unsigned char tag, return err; }
-int neg_token_init_mech_type(void *context, size_t hdrlen, unsigned char tag, - const void *value, size_t vlen) +int ksmbd_neg_token_init_mech_type(void *context, size_t hdrlen, + unsigned char tag, const void *value, + size_t vlen) { struct ksmbd_conn *conn = context; unsigned long *oid; @@ -310,8 +311,9 @@ int neg_token_init_mech_type(void *context, size_t hdrlen, unsigned char tag, return -EBADMSG; }
-int neg_token_init_mech_token(void *context, size_t hdrlen, unsigned char tag, - const void *value, size_t vlen) +int ksmbd_neg_token_init_mech_token(void *context, size_t hdrlen, + unsigned char tag, const void *value, + size_t vlen) { struct ksmbd_conn *conn = context;
@@ -324,8 +326,9 @@ int neg_token_init_mech_token(void *context, size_t hdrlen, unsigned char tag, return 0; }
-int neg_token_targ_resp_token(void *context, size_t hdrlen, unsigned char tag, - const void *value, size_t vlen) +int ksmbd_neg_token_targ_resp_token(void *context, size_t hdrlen, + unsigned char tag, const void *value, + size_t vlen) { struct ksmbd_conn *conn = context;
diff --git a/fs/cifsd/ksmbd_spnego_negtokeninit.asn1 b/fs/cifsd/ksmbd_spnego_negtokeninit.asn1 new file mode 100644 index 000000000000..0065f191b54b --- /dev/null +++ b/fs/cifsd/ksmbd_spnego_negtokeninit.asn1 @@ -0,0 +1,31 @@ +GSSAPI ::= + [APPLICATION 0] IMPLICIT SEQUENCE { + thisMech + OBJECT IDENTIFIER ({ksmbd_gssapi_this_mech}), + negotiationToken + NegotiationToken + } + +MechType ::= OBJECT IDENTIFIER ({ksmbd_neg_token_init_mech_type}) + +MechTypeList ::= SEQUENCE OF MechType + +NegTokenInit ::= + SEQUENCE { + mechTypes + [0] MechTypeList, + reqFlags + [1] BIT STRING OPTIONAL, + mechToken + [2] OCTET STRING OPTIONAL ({ksmbd_neg_token_init_mech_token}), + mechListMIC + [3] OCTET STRING OPTIONAL + } + +NegotiationToken ::= + CHOICE { + negTokenInit + [0] NegTokenInit, + negTokenTarg + [1] ANY + } diff --git a/fs/cifsd/spnego_negtokentarg.asn1 b/fs/cifsd/ksmbd_spnego_negtokentarg.asn1 similarity index 80% rename from fs/cifsd/spnego_negtokentarg.asn1 rename to fs/cifsd/ksmbd_spnego_negtokentarg.asn1 index 8324bcd1bbd7..1151933e7b9c 100644 --- a/fs/cifsd/spnego_negtokentarg.asn1 +++ b/fs/cifsd/ksmbd_spnego_negtokentarg.asn1 @@ -13,7 +13,7 @@ NegTokenTarg ::= supportedMech [1] OBJECT IDENTIFIER OPTIONAL, responseToken - [2] OCTET STRING OPTIONAL ({neg_token_targ_resp_token}), + [2] OCTET STRING OPTIONAL ({ksmbd_neg_token_targ_resp_token}), mechListMIC [3] OCTET STRING OPTIONAL } diff --git a/fs/cifsd/spnego_negtokeninit.asn1 b/fs/cifsd/spnego_negtokeninit.asn1 deleted file mode 100644 index 1b153cb6a39e..000000000000 --- a/fs/cifsd/spnego_negtokeninit.asn1 +++ /dev/null @@ -1,43 +0,0 @@ -GSSAPI ::= - [APPLICATION 0] IMPLICIT SEQUENCE { - thisMech - OBJECT IDENTIFIER ({gssapi_this_mech}), - negotiationToken - NegotiationToken - } - -MechType ::= OBJECT IDENTIFIER ({neg_token_init_mech_type}) - -MechTypeList ::= SEQUENCE OF MechType - -NegTokenInit ::= - SEQUENCE { - mechTypes - [0] MechTypeList, - reqFlags - [1] BIT STRING OPTIONAL, - mechToken - [2] OCTET STRING OPTIONAL ({neg_token_init_mech_token}), - mechListMIC - [3] OCTET STRING OPTIONAL - } - -NegTokenTarg ::= - SEQUENCE { - negResult - [0] ENUMERATED OPTIONAL, - supportedMech - [1] OBJECT IDENTIFIER OPTIONAL, - responseToken - [2] OCTET STRING OPTIONAL ({neg_token_targ_resp_token}), - mechListMIC - [3] OCTET STRING OPTIONAL - } - -NegotiationToken ::= - CHOICE { - negTokenInit - [0] NegTokenInit, - negTokenTarg - [1] ANY - }