oss-sec mailing list archives

Re: Fw: Security risk of vim swap files


From: Jakub Wilk <jwilk () jwilk net>
Date: Tue, 7 Nov 2017 21:58:23 +0100

* Seth Arnold <seth.arnold () canonical com>, 2017-11-06, 15:09:
Is it not the kernel's responsibility to enforce umask(2) is properly applied?

Yes, most programs don't have to care about this.

Obviously there's good case to be made that manual chmod(2) calls could or should be modified by umask(2) values by hand, but probably all those chmod(2) calls ought to be re-written to set the modes correctly at file creation time (or mkdir, etc) to avoid race conditions.

vim creates the swapfile initially with mode 0600, and later chmods it.
There's no race condition.

--
Jakub Wilk


Current thread: