lkml.org 
[lkml]   [2021]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.13 256/800] smb3: fix possible access to uninitialized pointer to DACL
    Date
    From: Steve French <stfrench@microsoft.com>

    [ Upstream commit a5628263a9f8d47d9a1548fe9d5d75ba4423a735 ]

    dacl_ptr can be null so we must check for it everywhere it is
    used in build_sec_desc.

    Addresses-Coverity: 1475598 ("Explicit null dereference")
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/cifs/cifsacl.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
    index 784407f9280f..a18dee071fcd 100644
    --- a/fs/cifs/cifsacl.c
    +++ b/fs/cifs/cifsacl.c
    @@ -1308,7 +1308,7 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
    ndacl_ptr = (struct cifs_acl *)((char *)pnntsd + ndacloffset);
    ndacl_ptr->revision =
    dacloffset ? dacl_ptr->revision : cpu_to_le16(ACL_REVISION);
    - ndacl_ptr->num_aces = dacl_ptr->num_aces;
    + ndacl_ptr->num_aces = dacl_ptr ? dacl_ptr->num_aces : 0;

    if (uid_valid(uid)) { /* chown */
    uid_t id;
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-07-12 10:41    [W:4.277 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site