[Bug 1175565] New: lvm can't pass build with gcc option Wstringop-overflow
https://bugzilla.suse.com/show_bug.cgi?id=1175565 Bug ID: 1175565 Summary: lvm can't pass build with gcc option Wstringop-overflow Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: openSUSE Tumbleweed Status: NEW Severity: Major Priority: P5 - None Component: Basesystem Assignee: screening-team-bugs@suse.de Reporter: heming.zhao@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- when build lvm2-2.03.10 package, the lvmlockd can't pass build. warning: ``` [ 72s] In function 'strcpy', [ 72s] inlined from '_store_str' at device_mapper/libdm-common.c:1453:2, [ 72s] inlined from '_stack_node_op' at device_mapper/libdm-common.c:1589:2: [ 72s] /usr/include/bits/string_fortified.h:90:10: warning: '__builtin_strcpy' writing 1 or more bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] [ 72s] 90 | return __builtin___strcpy_chk (__dest, __src, __bos (__dest)); ``` the reason is lvm2 use zero-sized array like: ``` struct node_op_parms { struct dm_list list; node_op_t type; char *dev_name; uint32_t major; uint32_t minor; uid_t uid; gid_t gid; mode_t mode; uint32_t read_ahead; uint32_t read_ahead_flags; char *old_name; int warn_if_udev_failed; unsigned rely_on_udev; char names[0]; }; ``` the last item char names[0] should be changed with flexible array: char names[] -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1175565 https://bugzilla.suse.com/show_bug.cgi?id=1175565#c1 heming zhao <heming.zhao@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|screening-team-bugs@suse.de |heming.zhao@suse.com --- Comment #1 from heming zhao <heming.zhao@suse.com> --- assign this bug to me. the patch had been sent to upstream, I'm not sure whether upstream accept or deny it, or how long upstream accept/merge it. Currently, this bug block building lvmlockd package. I will generate a suse special patch for passing the build. when upstream merge this bug, I will replace it with upstream version. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1175565 https://bugzilla.suse.com/show_bug.cgi?id=1175565#c2 heming zhao <heming.zhao@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from heming zhao <heming.zhao@suse.com> --- the fixed had been merged into tb. bug is closed as fixed -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com