Skip to content

Commit 0a16e24

Browse files
thejhvivekkreddy
authored andcommitted
udmabuf: also check for F_SEAL_FUTURE_WRITE
When F_SEAL_FUTURE_WRITE was introduced, it was overlooked that udmabuf must reject memfds with this flag, just like ones with F_SEAL_WRITE. Fix it by adding F_SEAL_FUTURE_WRITE to SEALS_DENIED. Fixes: ab3948f ("mm/memfd: add an F_SEAL_FUTURE_WRITE seal to memfd") Cc: stable@vger.kernel.org Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Jann Horn <jannh@google.com> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241204-udmabuf-fixes-v2-2-23887289de1c@google.com
1 parent 9cb189a commit 0a16e24

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/dma-buf/udmabuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static const struct dma_buf_ops udmabuf_ops = {
297297
};
298298

299299
#define SEALS_WANTED (F_SEAL_SHRINK)
300-
#define SEALS_DENIED (F_SEAL_WRITE)
300+
#define SEALS_DENIED (F_SEAL_WRITE|F_SEAL_FUTURE_WRITE)
301301

302302
static int check_memfd_seals(struct file *memfd)
303303
{

0 commit comments

Comments
 (0)