)]}' { "commit": "406c706c7b7f1730aa787e914817b8d16b1e99f6", "tree": "570db537a1ab34e0ab06c8d5adc8a31e031e11c7", "parents": [ "7ee47dcfff1835ff75a794d1075b6b5f5462cfed" ], "author": { "name": "Peter Griffin", "email": "peter.griffin@linaro.org", "time": "Thu Nov 03 17:02:10 2022 +0000" }, "committer": { "name": "Al Viro", "email": "viro@zeniv.linux.org.uk", "time": "Sat Nov 19 02:22:11 2022 -0500" }, "message": "vfs: vfs_tmpfile: ensure O_EXCL flag is enforced\n\nIf O_EXCL is *not* specified, then linkat() can be\nused to link the temporary file into the filesystem.\nIf O_EXCL is specified then linkat() should fail (-1).\n\nAfter commit 863f144f12ad (\"vfs: open inside -\u003etmpfile()\")\nthe O_EXCL flag is no longer honored by the vfs layer for\ntmpfile, which means the file can be linked even if O_EXCL\nflag is specified, which is a change in behaviour for\nuserspace!\n\nThe open flags was previously passed as a parameter, so it\nwas uneffected by the changes to file-\u003ef_flags caused by\nfinish_open(). This patch fixes the issue by storing\nfile-\u003ef_flags in a local variable so the O_EXCL test\nlogic is restored.\n\nThis regression was detected by Android CTS Bionic fcntl()\ntests running on android-mainline [1].\n\n[1] https://android.googlesource.com/platform/bionic/+/\n refs/heads/master/tests/fcntl_test.cpp#352\n\nFixes: 863f144f12ad (\"vfs: open inside -\u003etmpfile()\")\nAcked-by: Miklos Szeredi \u003cmszeredi@redhat.com\u003e\nTested-by: Will McVicker \u003cwillmcvicker@google.com\u003e\nSigned-off-by: Peter Griffin \u003cpeter.griffin@linaro.org\u003e\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "578c2110df0223fbdb952e3e002de5feaa2d1446", "old_mode": 33188, "old_path": "fs/namei.c", "new_id": "9155ecb547ce62464dd8b304e63ed73b7cf2b73e", "new_mode": 33188, "new_path": "fs/namei.c" } ] }