summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2019-02-13 10:54:55 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2019-02-13 14:00:59 +1100
commite9aa40c6186641f1120ff902c55df6293f772170 (patch)
tree1b18c850a0a0f96f51f54c222bd6d4bcccd5348d /fs
parentda985b480689949895eea740e80d9781674f930a (diff)
autofs: clear O_NONBLOCK on the pipe
autofs does not expect the pipe it is given to have O_NONBLOCK set - specifically if __kernel_write() in autofs_write() returns -EAGAIN, this is treated as a fatal error and the pipe is closed. For safety autofs should, therefore, clear the O_NONBLOCK flag. Releases of systemd prior to 8th February 2019 used pipe2(p, O_NONBLOCK|O_CLOEXEC) and thus (inadvertently) set this flag. Link: http://lkml.kernel.org/r/154993550902.3321.1183632970046073478.stgit@pluto-themaw-net Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Ian Kent <raven@themaw.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'fs')
-rw-r--r--fs/autofs/autofs_i.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index b735f2b1e462..70c132acdab1 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -216,6 +216,8 @@ static inline int autofs_prepare_pipe(struct file *pipe)
return -EINVAL;
/* We want a packet pipe */
pipe->f_flags |= O_DIRECT;
+ /* We don't expect -EAGAIN */
+ pipe->f_flags &= ~O_NONBLOCK;
return 0;
}