From: libin <huawei.libin@huawei.com> To: Steven Rostedt <rostedt@goodmis.org> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>, <will.deacon@arm.com>, <lkp@intel.com>, <catalin.marinas@arm.com>, <takahiro.akashi@linaro.org>, <zhouchengming1@huawei.com>, <xiexiuqi@huawei.com>, <guohanjun@huawei.com>, <linux-kernel@vger.kernel.org>, <dingtianhong@huawei.com>, <linux-arm-kernel@lists.infradead.org> Subject: [PATCH] recordmcount: fix endianness handling bug for nop_mcount Date: Tue, 3 Nov 2015 08:58:47 +0800 [thread overview] Message-ID: <563806C7.7070606@huawei.com> (raw) In-Reply-To: <20151102143324.071eee7e@gandalf.local.home> In nop_mcount, shdr->sh_offset and welp->r_offset should handle endianness properly, otherwise it will trigger Segmentation fault if the recordmcount main and file.o have different endianness. Cc: <stable@vger.kernel.org> # 3.0+ Signed-off-by: Li Bin <huawei.libin@huawei.com> --- scripts/recordmcount.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index 49b582a..b9897e2 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h @@ -377,7 +377,7 @@ static void nop_mcount(Elf_Shdr const *const relhdr, if (mcountsym == Elf_r_sym(relp) && !is_fake_mcount(relp)) { if (make_nop) - ret = make_nop((void *)ehdr, shdr->sh_offset + relp->r_offset); + ret = make_nop((void *)ehdr, _w(shdr->sh_offset) + _w(relp->r_offset)); if (warn_on_notrace_sect && !once) { printf("Section %s has mcount callers being ignored\n", txtname); -- 1.7.1
WARNING: multiple messages have this Message-ID (diff)
From: huawei.libin@huawei.com (libin) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] recordmcount: fix endianness handling bug for nop_mcount Date: Tue, 3 Nov 2015 08:58:47 +0800 [thread overview] Message-ID: <563806C7.7070606@huawei.com> (raw) In-Reply-To: <20151102143324.071eee7e@gandalf.local.home> In nop_mcount, shdr->sh_offset and welp->r_offset should handle endianness properly, otherwise it will trigger Segmentation fault if the recordmcount main and file.o have different endianness. Cc: <stable@vger.kernel.org> # 3.0+ Signed-off-by: Li Bin <huawei.libin@huawei.com> --- scripts/recordmcount.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index 49b582a..b9897e2 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h @@ -377,7 +377,7 @@ static void nop_mcount(Elf_Shdr const *const relhdr, if (mcountsym == Elf_r_sym(relp) && !is_fake_mcount(relp)) { if (make_nop) - ret = make_nop((void *)ehdr, shdr->sh_offset + relp->r_offset); + ret = make_nop((void *)ehdr, _w(shdr->sh_offset) + _w(relp->r_offset)); if (warn_on_notrace_sect && !once) { printf("Section %s has mcount callers being ignored\n", txtname); -- 1.7.1
next prev parent reply other threads:[~2015-11-03 1:00 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-10-30 8:31 [PATCH 0/3] recordmcount: bugfix and amend Li Bin 2015-10-30 8:31 ` Li Bin 2015-10-30 8:31 ` [PATCH 1/3] recordmcount: fix endianness handling bug for nop_mcount Li Bin 2015-10-30 8:31 ` Li Bin 2015-10-30 8:45 ` libin 2015-10-30 8:45 ` libin 2015-10-30 14:35 ` Sergei Shtylyov 2015-10-30 14:35 ` Sergei Shtylyov 2015-10-31 2:07 ` libin 2015-10-31 2:07 ` libin 2015-11-02 19:33 ` Steven Rostedt 2015-11-02 19:33 ` Steven Rostedt 2015-11-03 0:58 ` libin [this message] 2015-11-03 0:58 ` [PATCH] " libin 2015-10-30 8:31 ` [PATCH 2/3] recordmcount: x86: assign a meaningful value to rel_type_nop Li Bin 2015-10-30 8:31 ` Li Bin 2015-10-30 8:31 ` [PATCH 3/3] recordmcount: arm64: replace the ignored mcount call into nop Li Bin 2015-10-30 8:31 ` Li Bin 2015-10-30 8:44 ` libin 2015-10-30 8:44 ` libin
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=563806C7.7070606@huawei.com \ --to=huawei.libin@huawei.com \ --cc=catalin.marinas@arm.com \ --cc=dingtianhong@huawei.com \ --cc=guohanjun@huawei.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lkp@intel.com \ --cc=rostedt@goodmis.org \ --cc=sergei.shtylyov@cogentembedded.com \ --cc=takahiro.akashi@linaro.org \ --cc=will.deacon@arm.com \ --cc=xiexiuqi@huawei.com \ --cc=zhouchengming1@huawei.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: linkBe 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.