Message ID | 20160122174348.GB29221@canonical.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jan 22, 2016 at 11:43:48AM -0600, Chris J Arges wrote: > On Thu, Jan 21, 2016 at 04:49:04PM -0600, Josh Poimboeuf wrote: > > This is v16 of the compile-time stack metadata validation patch set, > > along with proposed fixes for most of the warnings it found. It's based > > on the tip/master branch. > > > Josh, > > Looks good, with my config [1] I do still get a few warnings building > linux/linux-next. > > Here are the warnings: > $ grep ^stacktool build.log | grep -v staging Thanks for reporting these! > stacktool: arch/x86/kvm/vmx.o: vmx_handle_external_intr()+0x67: call without frame pointer save/setup This can be fixed by setting the stack pointer as an output operand for the inline asm call in vmx_handle_external_intr(). Feel free to submit a patch, or I'll get around to it eventually. > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x9e: return without frame pointer restore > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x89: duplicate frame pointer save > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x8a: duplicate frame pointer setup > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x9e: frame pointer state mismatch > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x0: frame pointer state mismatch These are false positives. Stacktool is confused by the use of a "noreturn" function which it doesn't know about (__reiserfs_panic). Unfortunately the only solution I currently have for dealing with global noreturn functions is to just hard-code a list of them. So the short term fix would be to add "__reiserfs_panic" to the global_noreturns list in tools/stacktool/builtin-check.c. I'm still trying to figure out a better way to deal with this type of issue, as it's a pain to have to keep a hard-coded list of noreturn functions. Unfortunately that info isn't available in the ELF. > stacktool: fs/reiserfs/ibalance.o: .text: unexpected end of section > stacktool: fs/reiserfs/tail_conversion.o: .text: unexpected end of section For some reason I'm not able to recreate these warnings... Can you share one of the .o files?
On Fri, Jan 22, 2016 at 01:14:47PM -0600, Josh Poimboeuf wrote: > On Fri, Jan 22, 2016 at 11:43:48AM -0600, Chris J Arges wrote: > > On Thu, Jan 21, 2016 at 04:49:04PM -0600, Josh Poimboeuf wrote: > > > This is v16 of the compile-time stack metadata validation patch set, > > > along with proposed fixes for most of the warnings it found. It's based > > > on the tip/master branch. > > > > > Josh, > > > > Looks good, with my config [1] I do still get a few warnings building > > linux/linux-next. > > > > Here are the warnings: > > $ grep ^stacktool build.log | grep -v staging > > Thanks for reporting these! > > > stacktool: arch/x86/kvm/vmx.o: vmx_handle_external_intr()+0x67: call without frame pointer save/setup > > This can be fixed by setting the stack pointer as an output operand for > the inline asm call in vmx_handle_external_intr(). > > Feel free to submit a patch, or I'll get around to it eventually. > > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x9e: return without frame pointer restore > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x89: duplicate frame pointer save > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x8a: duplicate frame pointer setup > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x9e: frame pointer state mismatch > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x0: frame pointer state mismatch > > These are false positives. Stacktool is confused by the use of a > "noreturn" function which it doesn't know about (__reiserfs_panic). > > Unfortunately the only solution I currently have for dealing with global > noreturn functions is to just hard-code a list of them. So the short > term fix would be to add "__reiserfs_panic" to the global_noreturns list > in tools/stacktool/builtin-check.c. > > I'm still trying to figure out a better way to deal with this type of > issue, as it's a pain to have to keep a hard-coded list of noreturn > functions. Unfortunately that info isn't available in the ELF. > Josh, Ok I'll hack on the patches above. > > stacktool: fs/reiserfs/ibalance.o: .text: unexpected end of section > > stacktool: fs/reiserfs/tail_conversion.o: .text: unexpected end of section > > For some reason I'm not able to recreate these warnings... Can you > share one of the .o files? > > -- > Josh > Binaries are here: http://people.canonical.com/~arges/stacktool/ --chris -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jan 22, 2016 at 02:40:35PM -0600, Chris J Arges wrote: > On Fri, Jan 22, 2016 at 01:14:47PM -0600, Josh Poimboeuf wrote: > > On Fri, Jan 22, 2016 at 11:43:48AM -0600, Chris J Arges wrote: > > > On Thu, Jan 21, 2016 at 04:49:04PM -0600, Josh Poimboeuf wrote: > > > > This is v16 of the compile-time stack metadata validation patch set, > > > > along with proposed fixes for most of the warnings it found. It's based > > > > on the tip/master branch. > > > > > > > Josh, > > > > > > Looks good, with my config [1] I do still get a few warnings building > > > linux/linux-next. > > > > > > Here are the warnings: > > > $ grep ^stacktool build.log | grep -v staging > > > > Thanks for reporting these! > > > > > stacktool: arch/x86/kvm/vmx.o: vmx_handle_external_intr()+0x67: call without frame pointer save/setup > > > > This can be fixed by setting the stack pointer as an output operand for > > the inline asm call in vmx_handle_external_intr(). > > > > Feel free to submit a patch, or I'll get around to it eventually. > > > > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x9e: return without frame pointer restore > > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x89: duplicate frame pointer save > > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x8a: duplicate frame pointer setup > > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x9e: frame pointer state mismatch > > > stacktool: fs/reiserfs/namei.o: set_de_name_and_namelen()+0x0: frame pointer state mismatch > > > > These are false positives. Stacktool is confused by the use of a > > "noreturn" function which it doesn't know about (__reiserfs_panic). > > > > Unfortunately the only solution I currently have for dealing with global > > noreturn functions is to just hard-code a list of them. So the short > > term fix would be to add "__reiserfs_panic" to the global_noreturns list > > in tools/stacktool/builtin-check.c. > > > > I'm still trying to figure out a better way to deal with this type of > > issue, as it's a pain to have to keep a hard-coded list of noreturn > > functions. Unfortunately that info isn't available in the ELF. > > > > Josh, > Ok I'll hack on the patches above. > > > > stacktool: fs/reiserfs/ibalance.o: .text: unexpected end of section > > > stacktool: fs/reiserfs/tail_conversion.o: .text: unexpected end of section > > > > For some reason I'm not able to recreate these warnings... Can you > > share one of the .o files? > > Binaries are here: > http://people.canonical.com/~arges/stacktool/ Thanks, looks like the same __reiserfs_panic() noreturn fix for those.
These patches fix a few warnings I saw testing stacktool v16. I've done light testing on these by booting it on a machine and running kvm-unit-tests on it. Chris J Arges (2): tools/stacktool: Add __reiserfs_panic to global_noreturns list x86/kvm: Add output operand in vmx_handle_external_intr inline asm arch/x86/kvm/vmx.c | 4 +++- tools/stacktool/builtin-check.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e2951b6..d19dfb2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -33,6 +33,7 @@ #include <linux/slab.h> #include <linux/tboot.h> #include <linux/hrtimer.h> +#include <linux/stacktool.h> #include "kvm_cache_regs.h" #include "x86.h" @@ -8398,6 +8399,7 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu) } else local_irq_enable(); } +STACKTOOL_IGNORE_FUNC(vmx_handle_external_intr); static bool vmx_has_high_real_mode_segbase(void) {