Project

General

Profile

Bug #6170

attempted to kmem_alloc() size of 0 in nfs_acl_dup_cache

Added by Alexander Kolbasov about 5 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-08-28
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

DEBUG kernel panicked:

attempted to kmem_alloc() size of 0
ffffff01ef81ca90 nfs_acl_dup_cache+0xbb(ffffff01ef81cd90, ffffff7c7bb126d0)
ffffff01ef81cc60 acl_getacl3+0x9f(ffffff53db3ace00, ffffff01ef81cd90, 0, ffffff4c29e378f0)
ffffff01ef81cce0 nfs3_getsecattr+0x91(ffffff53db3ace00, ffffff01ef81cd90, 0, ffffff4c29e378f0, 0)
ffffff01ef81cd60 fop_getsecattr+0x57(ffffff53db3ace00, ffffff01ef81cd90, 0, ffffff4c29e378f0, 0)
ffffff01ef81ce20 cacl+0x170(1, 4, 80698b0, ffffff53db3ace00, ffffff01ef81ce4c)
ffffff01ef81cea0 acl+0xa6(8047a2b, 1, 4, 80698b0)
ffffff01ef81cf00 _sys_sysenter_post_swapgs+0x241()

History

#1

Updated by Alexander Kolbasov about 5 years ago

Suggested fix:

diff --git a/usr/src/uts/common/fs/nfs/nfs_acl_vnops.c b/usr/src/uts/common/fs/nfs/nfs_acl_vnops.c
index 4057245..f9447bb 100644
--- a/usr/src/uts/common/fs/nfs/nfs_acl_vnops.c
+++ b/usr/src/uts/common/fs/nfs/nfs_acl_vnops.c
@@ -710,16 +710,20 @@ nfs_acl_dup_cache(vsecattr_t *vsp, vsecattr_t *rvsp)
        if (vsp->vsa_mask & VSA_ACL) {
                ASSERT(rvsp->vsa_mask & VSA_ACLCNT);
                aclsize = rvsp->vsa_aclcnt * sizeof (aclent_t);
-               vsp->vsa_aclentp = kmem_alloc(aclsize, KM_SLEEP);
-               bcopy(rvsp->vsa_aclentp, vsp->vsa_aclentp, aclsize);
+               if (aclsize != 0) {
+                       vsp->vsa_aclentp = kmem_alloc(aclsize, KM_SLEEP);
+                       bcopy(rvsp->vsa_aclentp, vsp->vsa_aclentp, aclsize);
+               }
        }
        if (vsp->vsa_mask & VSA_ACLCNT)
                vsp->vsa_aclcnt = rvsp->vsa_aclcnt;
        if (vsp->vsa_mask & VSA_DFACL) {
                ASSERT(rvsp->vsa_mask & VSA_DFACLCNT);
                aclsize = rvsp->vsa_dfaclcnt * sizeof (aclent_t);
-               vsp->vsa_dfaclentp = kmem_alloc(aclsize, KM_SLEEP);
-               bcopy(rvsp->vsa_dfaclentp, vsp->vsa_dfaclentp, aclsize);
+               if (aclsize != 0) {
+                       vsp->vsa_dfaclentp = kmem_alloc(aclsize, KM_SLEEP);
+                       bcopy(rvsp->vsa_dfaclentp, vsp->vsa_dfaclentp, aclsize);
+               }
        }
        if (vsp->vsa_mask & VSA_DFACLCNT)
                vsp->vsa_dfaclcnt = rvsp->vsa_dfaclcnt;
#2

Updated by Bryan Horstmann-Allen almost 2 years ago

  • Project changed from site to illumos gate

Also available in: Atom PDF