[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 19/25: ext2fs: Poison pointers into dereferenced cache pages.
From: |
Samuel Thibault |
Subject: |
[hurd] 19/25: ext2fs: Poison pointers into dereferenced cache pages. |
Date: |
Mon, 24 Oct 2016 00:16:45 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 93ba74df1d6523ac49d5b227e30e1cfca930f7a9
Author: Justus Winter <address@hidden>
Date: Sat Oct 8 18:41:02 2016 +0200
ext2fs: Poison pointers into dereferenced cache pages.
* ext2fs/ext2fs.h (disk_cache_block_deref): Replace with a macro that
NULLs the given pointer.
(dino_deref): Likewise.
* ext2fs/pager.c (disk_cache_block_deref): Rename.
* ext2fs/pokel.c (pokel_add): Adapt.
(pokel_exec): Likewise.
---
ext2fs/ext2fs.h | 8 ++++++--
ext2fs/pager.c | 2 +-
ext2fs/pokel.c | 6 +++---
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index c233ce0..afcd25c 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -271,7 +271,9 @@ extern pthread_cond_t disk_cache_reassociation;
void *disk_cache_block_ref (block_t block);
void disk_cache_block_ref_ptr (void *ptr);
-void disk_cache_block_deref (void *ptr);
+void _disk_cache_block_deref (void *ptr);
+#define disk_cache_block_deref(PTR) \
+ do { _disk_cache_block_deref (PTR); PTR = NULL; } while (0)
int disk_cache_block_is_ref (block_t block);
/* Our in-core copy of the super-block (pointer into the disk_cache). */
@@ -412,12 +414,14 @@ dino_ref (ino_t inum)
}
EXT2FS_EI void
-dino_deref (struct ext2_inode *inode)
+_dino_deref (struct ext2_inode *inode)
{
ext2_debug ("(%p)", inode);
disk_cache_block_deref (inode);
}
#endif /* Use extern inlines. */
+#define dino_deref(INODE) \
+ do { _dino_deref (INODE); INODE = NULL; } while (0)
/* ---------------------------------------------------------------- */
/* inode.c */
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index 456b582..6a92682 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -1197,7 +1197,7 @@ disk_cache_block_ref_ptr (void *ptr)
}
void
-disk_cache_block_deref (void *ptr)
+_disk_cache_block_deref (void *ptr)
{
int index;
diff --git a/ext2fs/pokel.c b/ext2fs/pokel.c
index 3afb32e..53dc513 100644
--- a/ext2fs/pokel.c
+++ b/ext2fs/pokel.c
@@ -71,7 +71,7 @@ pokel_add (struct pokel *pokel, void *loc, vm_size_t length)
{
if (pokel->image == disk_cache)
for (vm_offset_t i = offset; i < end; i += block_size)
- disk_cache_block_deref (disk_cache + i);
+ _disk_cache_block_deref (disk_cache + i);
break;
}
@@ -85,7 +85,7 @@ pokel_add (struct pokel *pokel, void *loc, vm_size_t length)
vm_offset_t i_begin = p_offs > offset ? p_offs : offset;
vm_offset_t i_end = p_end < end ? p_end : end;
for (vm_offset_t i = i_begin; i < i_end; i += block_size)
- disk_cache_block_deref (disk_cache + i);
+ _disk_cache_block_deref (disk_cache + i);
}
ext2_debug ("extended 0x%x[%ul] to 0x%x[%ul]",
@@ -140,7 +140,7 @@ _pokel_exec (struct pokel *pokel, int sync, int wait)
vm_offset_t begin = trunc_block (pl->offset);
vm_offset_t end = round_block (pl->offset + pl->length);
for (vm_offset_t i = begin; i != end; i += block_size)
- disk_cache_block_deref (pokel->image + i);
+ _disk_cache_block_deref (pokel->image + i);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (12576ff -> 341f43d), Samuel Thibault, 2016/10/23
- [hurd] 01/25: remap: Refuse non-absolute paths, Samuel Thibault, 2016/10/23
- [hurd] 04/25: Fix message about not being able to request shutdown notification, Samuel Thibault, 2016/10/23
- [hurd] 02/25: typo, Samuel Thibault, 2016/10/23
- [hurd] 07/25: Fix looping over runsystem possibilities, Samuel Thibault, 2016/10/23
- [hurd] 03/25: Fix exec crash when setexecdata has never been called, Samuel Thibault, 2016/10/23
- [hurd] 05/25: exec: Fix loading binaries without a memory manager object, Samuel Thibault, 2016/10/23
- [hurd] 10/25: Fix patch to runsystem.hurd, Samuel Thibault, 2016/10/23
- [hurd] 20/25: console-client: Remove unused variable., Samuel Thibault, 2016/10/23
- [hurd] 19/25: ext2fs: Poison pointers into dereferenced cache pages.,
Samuel Thibault <=
- [hurd] 08/25: libfshelp: acquire references to control ports, Samuel Thibault, 2016/10/23
- [hurd] 15/25: Avoid fatal error handling in option parsers., Samuel Thibault, 2016/10/23
- [hurd] 25/25: boot: Ignore EINTR., Samuel Thibault, 2016/10/23
- [hurd] 24/25: Avoid warnings if increasing a threads priority fails., Samuel Thibault, 2016/10/23
- [hurd] 18/25: ext2fs: Rename parameter., Samuel Thibault, 2016/10/23
- [hurd] 09/25: Fix installing runsystem.hurd, Samuel Thibault, 2016/10/23
- [hurd] 12/25: fakeroot: set FAKED_MODE, Samuel Thibault, 2016/10/23
- [hurd] 14/25: ext2fs: Disable option to specify alternate superblock., Samuel Thibault, 2016/10/23
- [hurd] 17/25: trans/crash: Fix setting core file template at runtime., Samuel Thibault, 2016/10/23
- [hurd] 21/25: fshelp: Fix fetching the control port., Samuel Thibault, 2016/10/23