I just learned that O_RDONLY is a lie on Linux because you can just open /proc/self/fd/whatever with O_RDWR to change the mode
That's fucking gross man
I just learned that O_RDONLY is a lie on Linux because you can just open /proc/self/fd/whatever with O_RDWR to change the mode
That's fucking gross man
@taxorubio it does not require escalated privileges!
The context is that I have a subprocess which holds onto root in order to open specific files for the main process, which is not root for security reasons. The root process opens them O_RDONLY and passes them to the non-root process via cmsg(3).. which can then open /proc/self/fd/<fd> as O_RDWR and gain write access to that file.
@drewdevault But you would require escalated privileges to set the file descriptor's flags right? So I guess that if the OS won't let you open a file with write permissions, it won't let you change the flags for the same reason and in order to change them you would need the permissions that would have let you write into the file in the first place 🤔
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.