VirtualBox

vbox的更動 99419 路徑 trunk/src/VBox/Additions/linux


忽略:
時間撮記:
2023-4-17 下午01:51:03 (19 月 以前)
作者:
vboxsync
訊息:

Additions: Linux: vboxsf: replace memcpy with macro which disables false-positive fortify warnings in kernel log, bugref:10209.

位置:
trunk/src/VBox/Additions/linux/sharedfolders
檔案:
修改 4 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/linux/sharedfolders/dirops.c

    r98871 r99419  
    7878        pReq = (VBOXSFCREATEREQ *)VbglR0PhysHeapAlloc(RT_UOFFSETOF(VBOXSFCREATEREQ, StrPath.String) + sf_i->path->u16Size);
    7979        if (pReq) {
    80             memcpy(&pReq->StrPath, sf_i->path, SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size);
     80            VBOX_LINUX_MEMCPY(&pReq->StrPath, sf_i->path, SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size);
    8181            RT_ZERO(pReq->CreateParms);
    8282            pReq->CreateParms.Handle      = SHFL_HANDLE_NIL;
     
    824824        } *pReq = (union CreateAuxReq *)VbglR0PhysHeapAlloc(RT_UOFFSETOF(VBOXSFCREATEREQ, StrPath.String) + path->u16Size);
    825825        if (pReq) {
    826             memcpy(&pReq->Create.StrPath, path, SHFLSTRING_HEADER_SIZE + path->u16Size);
     826            VBOX_LINUX_MEMCPY(&pReq->Create.StrPath, path, SHFLSTRING_HEADER_SIZE + path->u16Size);
    827827            RT_ZERO(pReq->Create.CreateParms);
    828828            pReq->Create.CreateParms.Handle                  = SHFL_HANDLE_NIL;
     
    11311131                                                                       + path->u16Size);
    11321132        if (pReq) {
    1133             memcpy(&pReq->StrPath, path, SHFLSTRING_HEADER_SIZE + path->u16Size);
     1133            VBOX_LINUX_MEMCPY(&pReq->StrPath, path, SHFLSTRING_HEADER_SIZE + path->u16Size);
    11341134            uint32_t fFlags = fDirectory ? SHFL_REMOVE_DIR : SHFL_REMOVE_FILE;
    11351135            if (dentry->d_inode && ((dentry->d_inode->i_mode & S_IFLNK) == S_IFLNK))
     
    12511251                    PSHFLSTRING             pOldPath = sf_file_i->path;
    12521252
    1253                     memcpy(&pReq->StrDstPath, pNewPath, SHFLSTRING_HEADER_SIZE + pNewPath->u16Size);
     1253                    VBOX_LINUX_MEMCPY(&pReq->StrDstPath, pNewPath, SHFLSTRING_HEADER_SIZE + pNewPath->u16Size);
    12541254                    rc = VbglR0SfHostReqRenameWithSrcContig(pSuperInfo->map.root, pReq, pOldPath, virt_to_phys(pOldPath), fRename);
    12551255                    VbglR0PhysHeapFree(pReq);
     
    13521352            if (pReq) {
    13531353                RT_ZERO(*pReq);
    1354                 memcpy(&pReq->StrSymlinkPath, pPath, SHFLSTRING_HEADER_SIZE + pPath->u16Size);
     1354                VBOX_LINUX_MEMCPY(&pReq->StrSymlinkPath, pPath, SHFLSTRING_HEADER_SIZE + pPath->u16Size);
    13551355
    13561356                rc = VbglR0SfHostReqCreateSymlinkContig(pSuperInfo->map.root, pTarget, virt_to_phys(pTarget), pReq);
  • trunk/src/VBox/Additions/linux/sharedfolders/regops.c

    r98103 r99419  
    30733073        return -ENOMEM;
    30743074    }
    3075     memcpy(&pReq->StrPath, sf_i->path, SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size);
     3075    VBOX_LINUX_MEMCPY(&pReq->StrPath, sf_i->path, SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size);
    30763076    RT_ZERO(pReq->CreateParms);
    30773077    pReq->CreateParms.Handle = SHFL_HANDLE_NIL;
  • trunk/src/VBox/Additions/linux/sharedfolders/utils.c

    r98869 r99419  
    193193                pString->u16Length = (uint16_t)cchNls;
    194194                pString->u16Size   = (uint16_t)(cchNls + 1);
    195                 memcpy(pString->String.ach, pszNls, cchNls);
     195                VBOX_LINUX_MEMCPY(pString->String.ach, pszNls, cchNls);
    196196                pString->String.ach[cchNls] = '\0';
    197197                rc = 0;
     
    503503    if (pReq) {
    504504        RT_ZERO(*pReq);
    505         memcpy(&pReq->StrPath, path, SHFLSTRING_HEADER_SIZE + path->u16Size);
     505        VBOX_LINUX_MEMCPY(&pReq->StrPath, path, SHFLSTRING_HEADER_SIZE + path->u16Size);
    506506        pReq->CreateParms.Handle = SHFL_HANDLE_NIL;
    507507        pReq->CreateParms.CreateFlags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW;
     
    589589                if (pReq) {
    590590                    RT_ZERO(*pReq);
    591                     memcpy(&pReq->StrPath, pPath, SHFLSTRING_HEADER_SIZE + pPath->u16Size);
     591                    VBOX_LINUX_MEMCPY(&pReq->StrPath, pPath, SHFLSTRING_HEADER_SIZE + pPath->u16Size);
    592592                    pReq->CreateParms.Handle      = SHFL_HANDLE_NIL;
    593593                    pReq->CreateParms.CreateFlags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW;
     
    890890                    if (fAttrs & ATTR_SIZE)
    891891                        pReq->Create.CreateParms.CreateFlags |= SHFL_CF_ACCESS_WRITE;
    892                     memcpy(&pReq->Create.StrPath, sf_i->path, SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size);
     892                    VBOX_LINUX_MEMCPY(&pReq->Create.StrPath, sf_i->path, SHFLSTRING_HEADER_SIZE + sf_i->path->u16Size);
    893893                    vrc = VbglR0SfHostReqCreate(pSuperInfo->map.root, &pReq->Create);
    894894                    if (RT_SUCCESS(vrc)) {
     
    10281028
    10291029    if (fRoot)
    1030         memcpy(&tmp->String.utf8[0], d_name, d_len + 1);
     1030        VBOX_LINUX_MEMCPY(&tmp->String.utf8[0], d_name, d_len + 1);
    10311031    else {
    1032         memcpy(&tmp->String.utf8[0], p_name, p_len);
     1032        VBOX_LINUX_MEMCPY(&tmp->String.utf8[0], p_name, p_len);
    10331033        tmp->String.utf8[p_len] = '/';
    1034         memcpy(&tmp->String.utf8[p_len + 1], d_name, d_len);
     1034        VBOX_LINUX_MEMCPY(&tmp->String.utf8[p_len + 1], d_name, d_len);
    10351035        tmp->String.utf8[p_len + 1 + d_len] = '\0';
    10361036    }
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c

    r98103 r99419  
    119119    if ((unsigned)info->length >= RT_UOFFSETOF(struct vbsf_mount_info_new, cMaxIoPages)) {
    120120        AssertCompile(sizeof(pSuperInfo->szTag) >= sizeof(info->szTag));
    121         memcpy(pSuperInfo->szTag, info->szTag, sizeof(info->szTag));
     121        VBOX_LINUX_MEMCPY(pSuperInfo->szTag, info->szTag, sizeof(info->szTag));
    122122        pSuperInfo->szTag[sizeof(pSuperInfo->szTag) - 1] = '\0';
    123123    } else {
     
    243243        str_name->u16Length = name_len;
    244244        str_name->u16Size = name_len + 1;
    245         memcpy(str_name->String.utf8, info->name, name_len + 1);
     245        VBOX_LINUX_MEMCPY(str_name->String.utf8, info->name, name_len + 1);
    246246
    247247        /*
     
    14901490    if (data) {
    14911491        if (VBSF_IS_MOUNT_VBOXSF_DATA(data)) {
    1492             memcpy(info, data, sizeof(struct vbsf_mount_info_new));
     1492            VBOX_LINUX_MEMCPY(info, data, sizeof(struct vbsf_mount_info_new));
    14931493        } else {
    14941494            /* this will call vbsf_parse_param() */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette