1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
Peter Rajnoha 2f61478436 workaround: gcc v4.8 on 32 bit param. passing bug when -02 opimization used
gcc -O2 v4.8 on 32 bit architecture is causing a bug in parameter
passing. It does not happen with -01 nor -O0.

The problematic part of the code was strlen use in config.c in
the config_def_check fn and the call for _config_def_check_tree in it:

<snip>
  rplen = strlen(rp);
  if (!_config_def_check_tree(handle, vp, vp + strlen(vp), rp, rp + rplen, CFG_PATH_MAX_LEN - rplen, cn, cmd->cft_def_hash)) ...
</snip>

If compiled with -O0 (correct):

Breakpoint 1, config_def_check (cmd=0x819b050, handle=0x81a04f8) at config/config.c:775
(gdb) p	vp
$1 = 0x8189ee0 <_cfg_path> "config"
(gdb) p	strlen(vp)
$2 = 6
(gdb)
_config_def_check_tree (handle=0x81a04f8, vp=0x8189ee0 <_cfg_path>
"config", pvp=0x8189ee6 <_cfg_path+6> "", rp=0xbfffe1e8 "config",
prp=0xbfffe1ee "", buf_size=58, root=0x81a2568, ht=0x81a65
48) at config/config.c:680
(gdb) p	vp
$4 = 0x8189ee0 <_cfg_path> "config"
(gdb) p	pvp
$5 = 0x8189ee6 <_cfg_path+6> ""

If compiled with -O2 (incorrect):

Breakpoint 1, config_def_check (cmd=cmd@entry=0x8183050, handle=0x81884f8) at config/config.c:775
(gdb) p	vp
$1 = 0x8172fc0 <_cfg_path> "config"
(gdb) p strlen(vp)
$2 = 6
(gdb) p	vp + strlen(vp)
$3 = 0x8172fc6 <_cfg_path+6> ""
(gdb)
_config_def_check_tree (handle=handle@entry=0x81884f8, pvp=0x8172fc7
<_cfg_path+7> "host_list", rp=rp@entry=0xbffff190 "config",
prp=prp@entry=0xbffff196 "", buf_size=buf_size@entry=58, ht=0x
818e548, root=0x818a568, vp=0x8172fc0 <_cfg_path> "config") at
config/config.c:674
(gdb) p	pvp
$4 = 0x8172fc7 <_cfg_path+7> "host_list"

The difference is in passing the "pvp" arg for _config_def_check_tree.
While in the correct case, the value of _cfg_path+6 is passed
(the result of vp + strlen(vp) - see the snippet of the code above),
in the incorrect case, this value is increased by 1 to _cfg_path+7,
hence totally malforming the string that is being processed.

This ends up with incorrect validation check and incorrect warning
messages are issued like:

 "Configuration setting "config/checks" has invalid type. Found integer, expected section."

To workaround this issue, remove the "static" qualifier from the
"static char _cfg_path[CFG_PATH_MAX_LEN]". This causes the optimalizer
to be less aggressive (also shuffling the arg list for
_config_def_check_tree call helps).
2013-08-09 13:24:50 +02:00
autoconf Using Fedora 14's autoreconf. 2011-01-07 14:38:34 +00:00
conf RAID: Make "raid10" the default striped + mirror segment type 2013-08-06 14:15:08 -05:00
daemons clogd: fix descriptor leak when daemonzing 2013-08-06 16:21:51 +02:00
doc conf: add separate 'conf' dir for config files 2013-07-02 15:22:11 +02:00
include lib/properties: Common code for handling properties. 2013-07-12 16:52:16 -05:00
lib workaround: gcc v4.8 on 32 bit param. passing bug when -02 opimization used 2013-08-09 13:24:50 +02:00
libdaemon cleanup: easier to read loop code 2013-06-18 22:13:41 +02:00
libdm libdm: update DM_ABORT_ON_INTERNAL_ERRORS 2013-08-06 16:19:31 +02:00
liblvm Revert "lvm2app: lvm_vg_list_lvs filter hidden LVs" 2013-07-24 01:49:18 +01:00
man RAID: Make "raid1" the default mirror segment type 2013-08-06 14:13:55 -05:00
old-tests Add .gitignore files for an in-source-tree build. 2012-06-08 16:26:21 +01:00
po INSTALL rules updates 2010-04-09 21:42:48 +00:00
python python-lvm: Correct parsing arguments for integers 2013-07-26 10:24:01 -05:00
report-generators add copyright notices to new files 2010-07-28 12:20:38 +00:00
reports [REPORT-GENERATORS] cut down stylsheet.css to what we actually use 2010-07-21 10:00:38 +00:00
scripts systemd: udevadm settle for lvm2-activation-net.service 2013-07-24 11:06:38 +02:00
test TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
tools Mirror/RAID1: When up|down-converting default to segtype of current LV 2013-08-07 16:01:45 -05:00
udev udev: fire pvscan --cache properly on CHANGE event for MD devices 2013-05-03 13:55:53 +02:00
unit-tests cleanup: replace memset with struct initilization 2012-06-22 13:23:03 +02:00
.gitignore gitignore: Ignore files ending in ~ 2012-06-11 16:13:02 +01:00
aclocal.m4 Add aclocal.m4 (for pkgconfig). 2011-01-07 16:27:05 +00:00
configure configure: autoreconf 2013-07-31 15:59:05 +02:00
configure.in thin: add thin_repair and thin_dump options 2013-07-31 15:30:47 +02:00
COPYING Outline docs 2001-12-31 16:12:40 +00:00
COPYING.LIB Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
INSTALL quick review of docs 2008-11-04 17:49:22 +00:00
make.tmpl.in cleanup: comments and a message 2013-07-24 22:10:37 +01:00
Makefile.in conf: add separate 'conf' dir for config files 2013-07-02 15:22:11 +02:00
README Rename git report from LVM2.git to lvm2.git. 2012-06-08 17:41:43 +01:00
VERSION post-release 2013-07-25 00:38:53 +01:00
VERSION_DM post-release 2013-07-25 00:38:53 +01:00
WHATS_NEW workaround: gcc v4.8 on 32 bit param. passing bug when -02 opimization used 2013-08-09 13:24:50 +02:00
WHATS_NEW_DM WHATS_NEW: move line to WHATS_NEW_DM 2013-08-06 11:42:01 +02:00

This tree contains the LVM2 and device-mapper tools and libraries.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sources.redhat.com/pub/lvm2/

The source code is stored in git:
  http://git.fedorahosted.org/git/lvm2.git
  git clone git://git.fedorahosted.org/git/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

The source code repository used until 7th June 2012 is accessible here:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.