From a0e0b2b8f82151b6d6268ea82afbfed1f6949bb0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 13 May 2024 17:50:34 -0600 Subject: [PATCH] qibfs: fix _another_ leak stable inclusion from stable-v6.6.89 commit 5d53e88d8370b9ab14dd830abb410d9a2671edb6 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IC9957 CVE: CVE-2025-37983 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5d53e88d8370b9ab14dd830abb410d9a2671edb6 -------------------------------- [ Upstream commit bdb43af4fdb39f844ede401bdb1258f67a580a27 ] failure to allocate inode => leaked dentry... this one had been there since the initial merge; to be fair, if we are that far OOM, the odds of failing at that particular allocation are low... Signed-off-by: Al Viro Signed-off-by: Sasha Levin (cherry picked from commit 5d53e88d8370b9ab14dd830abb410d9a2671edb6) Signed-off-by: Wentao Guan --- drivers/infiniband/hw/qib/qib_fs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c index 11155e0fb839..35d777976c29 100644 --- a/drivers/infiniband/hw/qib/qib_fs.c +++ b/drivers/infiniband/hw/qib/qib_fs.c @@ -55,6 +55,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry, struct inode *inode = new_inode(dir->i_sb); if (!inode) { + dput(dentry); error = -EPERM; goto bail; } -- Gitee