oss-sec mailing list archives
Re: Re: open(2) with side effects
From: Florian Weimer <fweimer () redhat com>
Date: Thu, 23 Apr 2015 16:35:48 +0200
On 04/23/2015 04:16 PM, Stephane Chazelas wrote:
2015-04-23 15:08:43 +0200, Florian Weimer:How common are file names on Linux which, when just opened and closed (maybe with fstat or fgetattr inbetween), trigger side effects, such as tape rewind?[...] Depends what you mean by side effect.
I'm only interested in side effects which are visible to other users and not directly related to global resource consumption (e.g., dentry usage or disk space due to keeping open a deleted file). Pretend that I'm writing a backup tool or something AV-like, which has to files without interfering with anything else.
named pipes come to mind. If a process is blocked on open() with O_RDONLY or O_WRONLY on a named pipe, then when another process comes along and does the symmetric (O_WRONLY or O_RDONLY) open(), the first process is unblocked, and when you close() it, the other process will see eof() on the fd or get a SIGPIPE if it writes...
Interesting. I don't like that at all. -- Florian Weimer / Red Hat Product Security
Current thread:
- open(2) with side effects Florian Weimer (Apr 23)
- Re: open(2) with side effects Stephane Chazelas (Apr 23)
- Re: Re: open(2) with side effects Florian Weimer (Apr 23)
- AW: Re: open(2) with side effects Fiedler Roman (Apr 23)
- Re: Re: open(2) with side effects Florian Weimer (Apr 23)
- Re: open(2) with side effects Jann Horn (Apr 23)
- Re: open(2) with side effects Stephane Chazelas (Apr 23)