Commit 93ed7166 authored by ChenXiaoSong's avatar ChenXiaoSong Committed by Yongqiang Liu
Browse files

Revert "NFSv4: Handle the special Linux file open access mode"

mainline inclusion
from mainline-v5.18-rc2
commit ab0fc21b
category: bugfix
bugzilla: 186890, https://gitee.com/openeuler/kernel/issues/I5BZTX


CVE: NA

--------------------------------

This reverts commit 44942b4e.

After secondly opening a file with O_ACCMODE|O_DIRECT flags,
nfs4_valid_open_stateid() will dereference NULL nfs4_state when lseek().

Reproducer:
  1. mount -t nfs -o vers=4.2 $server_ip:/ /mnt/
  2. fd = open("/mnt/file", O_ACCMODE|O_DIRECT|O_CREAT)
  3. close(fd)
  4. fd = open("/mnt/file", O_ACCMODE|O_DIRECT)
  5. lseek(fd)

Reported-by: default avatarLyu Tao <tao.lyu@epfl.ch>
Signed-off-by: default avatarChenXiaoSong <chenxiaosong2@huawei.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarChenXiaoSong <chenxiaosong2@huawei.com>
Reviewed-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 6d7af2d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment