linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init()
@ 2008-09-14 14:32 Manish Katiyar
  2008-09-16  7:22 ` Fwd: " Manish Katiyar
  2008-10-01 23:50 ` [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init()G Theodore Tso
  0 siblings, 2 replies; 3+ messages in thread
From: Manish Katiyar @ 2008-09-14 14:32 UTC (permalink / raw)
  To: linux-ext4, Theodore Tso; +Cc: mkatiyar

Since "prog" is not initialized with 0 , below check in
ext2fs_progress_init() is wrong and may lead to corruptions.


Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>

---
 resize/sim_progress.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/resize/sim_progress.c b/resize/sim_progress.c
index a575633..e7dba88 100644
--- a/resize/sim_progress.c
+++ b/resize/sim_progress.c
@@ -83,7 +83,7 @@ errcode_t ext2fs_progress_init(ext2_sim_progmeter *ret_prog,
        errcode_t               retval;

        retval = ext2fs_get_mem(sizeof(struct ext2_sim_progress), &prog);
-       if (!prog)
+       if (retval)
                return retval;
        memset(prog, 0, sizeof(struct ext2_sim_progress));

-- 
1.5.4.3


Thanks -
Manish

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Fwd: [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init()
  2008-09-14 14:32 [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init() Manish Katiyar
@ 2008-09-16  7:22 ` Manish Katiyar
  2008-10-01 23:50 ` [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init()G Theodore Tso
  1 sibling, 0 replies; 3+ messages in thread
From: Manish Katiyar @ 2008-09-16  7:22 UTC (permalink / raw)
  To: Theodore Tso, linux-ext4

---------- Forwarded message ----------
From: Manish Katiyar <mkatiyar@gmail.com>
Date: Sun, Sep 14, 2008 at 8:02 PM
Subject: [PATCH] resize2fs : Fix potential memory corruption in
ext2fs_progress_init()
To: linux-ext4@vger.kernel.org, Theodore Tso <tytso@mit.edu>
Cc: mkatiyar@gmail.com


Since "prog" is not initialized with 0 , below check in
ext2fs_progress_init() is wrong and may lead to corruptions.


Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>

---
 resize/sim_progress.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/resize/sim_progress.c b/resize/sim_progress.c
index a575633..e7dba88 100644
--- a/resize/sim_progress.c
+++ b/resize/sim_progress.c
@@ -83,7 +83,7 @@ errcode_t ext2fs_progress_init(ext2_sim_progmeter *ret_prog,
       errcode_t               retval;

       retval = ext2fs_get_mem(sizeof(struct ext2_sim_progress), &prog);
-       if (!prog)
+       if (retval)
               return retval;
       memset(prog, 0, sizeof(struct ext2_sim_progress));

--
1.5.4.3


Any ack/nack on this one ?? I also saw some utilities
(debugfs,resizefs) usage don't print the options specified in man
pages. Is it intentional ? Are they hidden options for developers ?

Thanks -
Manish


Thanks -
Manish

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init()G
  2008-09-14 14:32 [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init() Manish Katiyar
  2008-09-16  7:22 ` Fwd: " Manish Katiyar
@ 2008-10-01 23:50 ` Theodore Tso
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Tso @ 2008-10-01 23:50 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: linux-ext4

On Sun, Sep 14, 2008 at 08:02:12PM +0530, Manish Katiyar wrote:
> Since "prog" is not initialized with 0 , below check in
> ext2fs_progress_init() is wrong and may lead to corruptions.

Thanks, applied. (Sorry for the delay; I've been really busy the past
two weeks.)

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-01 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-14 14:32 [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init() Manish Katiyar
2008-09-16  7:22 ` Fwd: " Manish Katiyar
2008-10-01 23:50 ` [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init()G Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).