[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 05/21: ext2fs: Fix block leak in xattr code.
From: |
Samuel Thibault |
Subject: |
[hurd] 05/21: ext2fs: Fix block leak in xattr code. |
Date: |
Sat, 04 Mar 2017 21:10:58 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 08336418301f68c87e29e3735aa83cee1bc3c9b7
Author: Justus Winter <address@hidden>
Date: Mon Oct 3 18:12:17 2016 +0200
ext2fs: Fix block leak in xattr code.
* ext2fs/xattr.c (ext2_set_xattr): Avoid allocating and leaking a
block if the caller tries to delete an extended attribute from a node
that has no extended attribute in the first place.
---
ext2fs/xattr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c
index 4592d5e..41e8c89 100644
--- a/ext2fs/xattr.c
+++ b/ext2fs/xattr.c
@@ -686,6 +686,14 @@ ext2_set_xattr (struct node *np, const char *name, const
char *value,
ei = dino_ref (np->cache_id);
blkno = ei->i_file_acl;
+ /* Avoid allocating a block if this is a request to delete data. */
+ if (blkno == 0 && value == NULL)
+ {
+ block = NULL;
+ err = ENODATA;
+ goto cleanup;
+ }
+
if (blkno == 0)
{
/* Allocate and initialize new block */
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 06/21: ext2fs: Do not read translator record on Linux filesystems., (continued)
- [hurd] 06/21: ext2fs: Do not read translator record on Linux filesystems., Samuel Thibault, 2017/03/04
- [hurd] 10/21: ext2fs: fix block reference, Samuel Thibault, 2017/03/04
- [hurd] 16/21: libshouldbeinlibc: Fix NDEBUG build., Samuel Thibault, 2017/03/04
- [hurd] 08/21: ext2fs: Fix block allocation., Samuel Thibault, 2017/03/04
- [hurd] 12/21: ext2fs: fix extended attribute retrieval, Samuel Thibault, 2017/03/04
- [hurd] 11/21: ext2fs: minor cleanup, Samuel Thibault, 2017/03/04
- [hurd] 15/21: Fix mig URL, Samuel Thibault, 2017/03/04
- [hurd] 19/21: boot: Fix failing device lookups in unprivileged mode., Samuel Thibault, 2017/03/04
- [hurd] 09/21: ext2fs: Fix potential block leak., Samuel Thibault, 2017/03/04
- [hurd] 14/21: Merge remote-tracking branch 'remotes/darnassus/ext2fs-xattrs', Samuel Thibault, 2017/03/04
- [hurd] 05/21: ext2fs: Fix block leak in xattr code.,
Samuel Thibault <=
- [hurd] 21/21: Avoid ports_interrupt_rpcs cancel itself, Samuel Thibault, 2017/03/04
- [hurd] 07/21: ext2fs: Require users to opt-in for xattr-based translator records., Samuel Thibault, 2017/03/04
- [hurd] 20/21: boot: Make the halt message nicer., Samuel Thibault, 2017/03/04
- [hurd] 13/21: ext2fs: downgrade warnings about old translator records to debug messages, Samuel Thibault, 2017/03/04
- [hurd] 18/21: boot: Add a verbose option., Samuel Thibault, 2017/03/04
- [hurd] 04/21: ext2fs: Use correct type for sizes., Samuel Thibault, 2017/03/04
- [hurd] 02/21: ext2fs: Use xattr to store passive translator, Samuel Thibault, 2017/03/04
- [hurd] 17/21: boot: Cleanup Makefile., Samuel Thibault, 2017/03/04
- [hurd] 01/21: ext2fs: Add support for xattr, Samuel Thibault, 2017/03/04