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>] [day] [month] [year] [list]
Message-Id: <20220513105709.2209247-1-leon@georgemail.eu>
Date:   Fri, 13 May 2022 12:57:09 +0200
From:   "Leon M. George" <leon@...rgemail.eu>
To:     Phillip Lougher <phillip@...ashfs.org.uk>
Cc:     "Leon M. George" <leon@...rgemail.eu>, linux-kernel@...r.kernel.org
Subject: [PATCH] squashfs: free page if bio_add_page fails

In squashfs_bio_read, the page recently allocated for use with
bio_add_page isn't freed when the call fails.

This patch adds a call to __free_page.

Signed-off-by: Leon M. George <leon@...rgemail.eu>
---
 fs/squashfs/block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
index 622c844f6d11..5ca1c9caef7d 100644
--- a/fs/squashfs/block.c
+++ b/fs/squashfs/block.c
@@ -110,6 +110,7 @@ static int squashfs_bio_read(struct super_block *sb, u64 index, int length,
 		}
 		if (!bio_add_page(bio, page, len, offset)) {
 			error = -EIO;
+			__free_page(page);
 			goto out_free_bio;
 		}
 		offset = 0;
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ