VirtualBox

Changeset 88571 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Apr 16, 2021 5:59:50 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143868
Message:

Additions: Linux: vboxsf: adapt to 5.10.x+ kernels, bugref:9994.

This patch fixed the issue when executables in VBox share
could no be executed even if share was mounted with '-o exec'
option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/regops.c

    r88428 r88571  
    14681468
    14691469
     1470#if RTLNX_VER_MAX(5,10,0)
    14701471/**
    14711472 * Read function used when accessing files that are memory mapped.
     
    14761477static ssize_t vbsf_reg_read_mapped(struct file *file, char /*__user*/ *buf, size_t size, loff_t *off)
    14771478{
    1478 #if RTLNX_VER_MIN(3,16,0)
     1479# if RTLNX_VER_MIN(3,16,0)
    14791480    struct iovec    iov = { .iov_base = buf, .iov_len = size };
    14801481    struct iov_iter iter;
     
    14911492    return cbRet;
    14921493
    1493 #elif RTLNX_VER_MIN(2,6,19)
     1494# elif RTLNX_VER_MIN(2,6,19)
    14941495    struct iovec    iov = { .iov_base = buf, .iov_len = size };
    14951496    struct kiocb    kiocb;
     
    15061507    return cbRet;
    15071508
    1508 #else /* 2.6.18 or earlier: */
     1509# else /* 2.6.18 or earlier: */
    15091510    return generic_file_read(file, buf, size, off);
    1510 #endif
     1511# endif
    15111512}
    15121513
     
    16261627}
    16271628
    1628 
    16291629/**
    16301630 * Read from a regular file.
     
    16921692    }
    16931693
    1694 #if 0 /* Turns out this is slightly slower than locking the pages even for 4KB reads (4.19/amd64). */
     1694# if 0 /* Turns out this is slightly slower than locking the pages even for 4KB reads (4.19/amd64). */
    16951695    /*
    16961696     * For medium sized requests try use a bounce buffer.
     
    17211721        }
    17221722    }
    1723 #endif
     1723# endif
    17241724
    17251725    return vbsf_reg_read_locking(file, buf, size, off, pSuperInfo, sf_r);
    17261726}
     1727#endif /* < 5.10.0 */
    17271728
    17281729
     
    18141815
    18151816
     1817#if RTLNX_VER_MAX(5,10,0)
    18161818/**
    18171819 * Fallback case of vbsf_reg_write() that locks the user buffers and let the host
     
    19411943}
    19421944
    1943 
    19441945/**
    19451946 * Write to a regular file.
     
    19871988        && mapping->nrpages > 0
    19881989        && mapping_writably_mapped(mapping)) {
    1989 #if RTLNX_VER_MIN(2,6,32)
     1990# if RTLNX_VER_MIN(2,6,32)
    19901991        int err = filemap_fdatawait_range(mapping, pos, pos + size - 1);
    19911992        if (err)
    19921993            return err;
    1993 #else
     1994# else
    19941995        /** @todo ...   */
    1995 #endif
     1996# endif
    19961997    }
    19971998
     
    20352036    }
    20362037
    2037 #if 0 /* Turns out this is slightly slower than locking the pages even for 4KB reads (4.19/amd64). */
     2038# if 0 /* Turns out this is slightly slower than locking the pages even for 4KB reads (4.19/amd64). */
    20382039    /*
    20392040     * For medium sized requests try use a bounce buffer.
     
    20742075        }
    20752076    }
    2076 #endif
     2077# endif
    20772078
    20782079    return vbsf_reg_write_locking(file, buf, size, off, pos, inode, sf_i, pSuperInfo, sf_r);
    20792080}
     2081#endif /* < 5.10.0 */
    20802082
    20812083#if RTLNX_VER_MIN(2,6,19)
     
    35063508struct file_operations vbsf_reg_fops = {
    35073509    .open            = vbsf_reg_open,
     3510#if RTLNX_VER_MAX(5,10,0)
    35083511    .read            = vbsf_reg_read,
    35093512    .write           = vbsf_reg_write,
     3513#endif
    35103514#if RTLNX_VER_MIN(3,16,0)
    35113515    .read_iter       = vbsf_reg_read_iter,
Note: See TracChangeset for help on using the changeset viewer.

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