]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sunrpc/auth_gss/gss_krb5_mech.c
Merge branch 'for_linus' of git://git.infradead.org/~dedekind/ubifs-2.6
[linux-2.6-omap-h63xx.git] / net / sunrpc / auth_gss / gss_krb5_mech.c
index 71b9daefdff3d046d9fcbd486af3eba60dc88e12..ef45eba22485cf355c8fdd17382943d7ff7ec602 100644 (file)
@@ -70,7 +70,7 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res)
        q = (const void *)((const char *)p + len);
        if (unlikely(q > end || q < p))
                return ERR_PTR(-EFAULT);
-       res->data = kmemdup(p, len, GFP_KERNEL);
+       res->data = kmemdup(p, len, GFP_NOFS);
        if (unlikely(res->data == NULL))
                return ERR_PTR(-ENOMEM);
        res->len = len;
@@ -131,7 +131,7 @@ gss_import_sec_context_kerberos(const void *p,
        struct  krb5_ctx *ctx;
        int tmp;
 
-       if (!(ctx = kzalloc(sizeof(*ctx), GFP_KERNEL)))
+       if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS)))
                goto out_err;
 
        p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate));
@@ -147,13 +147,17 @@ gss_import_sec_context_kerberos(const void *p,
        p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
        if (IS_ERR(p))
                goto out_err_free_ctx;
-       if (tmp != SGN_ALG_DES_MAC_MD5)
+       if (tmp != SGN_ALG_DES_MAC_MD5) {
+               p = ERR_PTR(-ENOSYS);
                goto out_err_free_ctx;
+       }
        p = simple_get_bytes(p, end, &tmp, sizeof(tmp));
        if (IS_ERR(p))
                goto out_err_free_ctx;
-       if (tmp != SEAL_ALG_DES)
+       if (tmp != SEAL_ALG_DES) {
+               p = ERR_PTR(-ENOSYS);
                goto out_err_free_ctx;
+       }
        p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime));
        if (IS_ERR(p))
                goto out_err_free_ctx;
@@ -231,6 +235,7 @@ static struct pf_desc gss_kerberos_pfs[] = {
 static struct gss_api_mech gss_kerberos_mech = {
        .gm_name        = "krb5",
        .gm_owner       = THIS_MODULE,
+       .gm_oid         = {9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"},
        .gm_ops         = &gss_kerberos_ops,
        .gm_pf_num      = ARRAY_SIZE(gss_kerberos_pfs),
        .gm_pfs         = gss_kerberos_pfs,