lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210423151919.195033-1-ckuehl@redhat.com>
Date:   Fri, 23 Apr 2021 10:19:19 -0500
From:   Connor Kuehl <ckuehl@...hat.com>
To:     linux-fsdevel@...r.kernel.org
Cc:     Miklos Szeredi <miklos@...redi.hu>, linux-kernel@...r.kernel.org
Subject: [PATCH] fuse: Send FUSE_WRITE_KILL_SUIDGID for killpriv v1

FUSE doesn't seem to be adding the FUSE_WRITE_KILL_SUIDGID flag on write
requests for FUSE connections that support FUSE_HANDLE_KILLPRIV but not
FUSE_HANDLE_KILLPRIV_V2.

However, the FUSE userspace header states:

	FUSE_HANDLE_KILLPRIV: fs handles killing suid/sgid/cap on
	write/chown/trunc
	^^^^^

To improve backwards compatibility with file servers that don't support
FUSE_HANDLE_KILLPRIV_V2, add the FUSE_WRITE_KILL_SUIDGID flag to write
requests if FUSE_HANDLE_KILLPRIV has been negotiated -OR- if the
conditions for FUSE_HANDLE_KILLPRIV_V2 support are met.

Signed-off-by: Connor Kuehl <ckuehl@...hat.com>
---
 fs/fuse/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 8cccecb55fb8..7dc9182d1ece 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1106,7 +1106,7 @@ static ssize_t fuse_send_write_pages(struct fuse_io_args *ia,
 
 	fuse_write_args_fill(ia, ff, pos, count);
 	ia->write.in.flags = fuse_write_flags(iocb);
-	if (fm->fc->handle_killpriv_v2 && !capable(CAP_FSETID))
+	if (fm->fc->handle_killpriv || (fm->fc->handle_killpriv_v2 && !capable(CAP_FSETID)))
 		ia->write.in.write_flags |= FUSE_WRITE_KILL_SUIDGID;
 
 	err = fuse_simple_request(fm, &ap->args);
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ