Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

EACCES when root opens user files with O_WRONLY|O_CREAT|O_APPEND #2577

@bjaglin

Description

@bjaglin

Issue Report

Bug

Container Linux Version

OK on 2023.5.0
KO on 2079.1.0
KO on 2107.0.0

$ cat /etc/os-release
NAME="Container Linux by CoreOS"
ID=coreos
VERSION=2079.1.0
VERSION_ID=2079.1.0
BUILD_ID=2019-03-24-2042
PRETTY_NAME="Container Linux by CoreOS 2079.1.0 (Rhyolite)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="amd64-usr"

OK on Ubuntu with the same linux kernel as 2079.1.0 (4.19.31)

Environment

EC2

Expected Behavior

root should be able to append to any file

Actual Behavior

root gets EACCES when appending to a file owned by another regular user

Reproduction Steps

core@sand-2154-1555061726 ~ $ echo foo > /tmp/bar
core@sand-2154-1555061726 ~ $ ls -l /tmp/bar
-rw-r--r--. 1 core core 4 Apr 12 16:18 /tmp/bar
core@sand-2154-1555061726 ~ $ sudo su       
sand-2154-1555061726 core # echo > /tmp/bar 
bash: /tmp/bar: Permission denied
sand-2154-1555061726 core # echo >> /tmp/bar 
bash: /tmp/bar: Permission denied
sand-2154-1555061726 core # cat /tmp/bar 
foo
sand-2154-1555061726 core # rm /tmp/bar 
sand-2154-1555061726 core # uname -a
Linux sand-2154-1555061726 4.19.31-coreos #1 SMP Sun Mar 24 20:06:59 -00 2019 x86_64 Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz GenuineIntel GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions