All of lore.kernel.org
 help / color / mirror / Atom feed
From: Falcon <falcon_lvm@yahoo.com>
To: Andreas Dilger <adilger@turbolinux.com>
Cc: Linux LVM mailing list <linux-lvm@msede.com>
Subject: Re: [linux-lvm] Additions to LVM-BUGS-0.8final
Date: Sun, 06 Aug 2000 16:32:01 +0200	[thread overview]
Message-ID: <398D76E1.CDC2018@yahoo.com> (raw)
In-Reply-To: 200008042228.QAA00728@lynx.turbolabs.com

Andreas Dilger escribi�:

> Here is a list of additional bug fixes that appeared on the linux-lvm
> mailing list, but are not currently in the BUGS file on the LVM site.
>
> Cheers, Andreas
> ------------------------------------------------------------------------------
>
> Michael Marxmeier <mike@msede.com> writes:
>
> <22> vg_check_name -- LEAVING with ret: 0
> <22> lvm_remove_recursive -- CALLED with dir: /dev/Main_VG
>
> This looks like a bug in lvm_remove_recursive() (tools/lib/...)
> A short look reveales the following suspicious code
> sequence around line 71:
>
>                if ( ( file_name = malloc ( strlen (dir) +
>                                            strlen (dir_ent->d_name) +
>                                            2)) == NULL) {
>                   ret = -LVM_EREMOVE_RECURSIVE_MALLOC;
>                   goto lvm_remove_recursive_end;
>                }
>                sprintf ( file_name, "%s/%s%c", dir, dir_ent->d_name,
> 0);
>
> AFAICS this could write a byte beyound file_name, depending
> on file name length (due to malloc alignment).
>
> Try to replace the sprintf() with:
>
> sprintf ( file_name, "%s/%s", dir, dir_ent->d_name);
>
> or make the +2 a +3 in the malloc call.
>

[root@isiux /]# vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found inactive volume group "isiux_dg"
vgscan -- ERROR "lvm_remouverecursive(): opendir" removing volume group directory
and special files
vgscan -- found inactive volume group "root_dg"
vgscan -- ERROR "lvm_remouverecursive(): opendir" removing volume group directory
and special files
vgscan -- ERROR "lvm_remouverecursive(): opendir" creating "/etc/lvmtab" and
"/etc/lvmtab.d"

I change the code that you say , and cotinue the error

                                           strlen (dir_ent->d_name) +
                                           3)) == NULL) {
                  ret = -LVM_EREMOVE_RECURSIVE_MALLOC;
                  goto lvm_remove_recursive_end;
               }
               sprintf ( file_name, "%s/%s", dir, dir_ent->d_name, 0);
               if ( lstat ( file_name, &sb) == 0) {

And when compile it , it say that :

cc -c -pipe -Wall -O2 -D_GNU_SOURCE -DDEBUG -I/root/LVM/0.8final/tools/lib
-I/root/LVM/0.8final/tools -o lvm_remove_recursive.o lvm_remove_recursive.c
lvm_remove_recursive.c: In function `lvm_remove_recursive':
lvm_remove_recursive.c:51: warning: too many arguments for format
cc -c -pipe -Wall -O2 -D_GNU_SOURCE -DDEBUG -I/root/LVM/0.8final/tools/lib
-I/root/LVM/0.8final/tools -o lvm_show_filetype.o lvm_show_filetype.c
cc -c -pipe -Wall -O2 -D_GNU_SOURCE -DDEBUG -I/root/LVM/0.8final/tools/lib
-I/root/LVM/0.8final/tools -o lvm_show_size.o lvm_show_size.c

  reply	other threads:[~2000-08-06 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-04 22:28 [linux-lvm] Additions to LVM-BUGS-0.8final Andreas Dilger
2000-08-06 14:32 ` Falcon [this message]
2000-08-06 20:55   ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=398D76E1.CDC2018@yahoo.com \
    --to=falcon_lvm@yahoo.com \
    --cc=adilger@turbolinux.com \
    --cc=linux-lvm@msede.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.