4 Commits

Author SHA1 Message Date
Zhang Ning
ca925a740a fs/file_table: split fget_light
due to systemd updated, sun8i kernel doesn't compact to new systemd.
after check systemd code, it return -EBADF in below code:

https://github.com/systemd/systemd/blob/master/src/basic/fs-util.c#L804-L815

fstat on path fds (open with O_PATH).

after check sun8i kernel code, in fstat path, fget_light rectly returns
NULL on path fds (file->f_mode & FMODE_PATH).

on mainline kernel, fget_light is wraper function of __fget_light.
on fstat path, it uses __fget_light, doesn't check FMODE_PATH.

so follow mainline kernel, change the behavior of sun8i kernel.

test case:

int main(int argc, char **argv)
{
    int fd;
    struct stat previous_stat;

    fd =  open("/", O_CLOEXEC|O_NOFOLLOW|O_PATH);
    if (fd < 0) {
        printf("%d, %s\n", __LINE__,  strerror(errno));
         return -errno;
    }

    if(fstat(fd, &previous_stat) < 0) {

        printf("%d, %s\n", __LINE__, strerror(errno));
        return -errno;
    }
}

expect no error.

Signed-off-by: Zhang Ning <832666+zhangn1985@users.noreply.github.com>
2019-01-27 18:48:12 +08:00
Omonar
6a01e2ff18 Backported ARM/NEON optimized crypto routines from kernel 3.13.y 2017-10-12 21:41:45 +03:00
zador-blood-stained
ab8ef7fe13 Bump version to 3.4.113 2017-04-29 11:16:49 +03:00
igorpecovnik
1bbb331aab sun8i init 2016-04-12 12:21:19 +02:00