All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Wilson <jimw@sifive.com>
To: Atish Patra <atishp@atishpatra.org>
Cc: Greentime Hu <greentime.hu@sifive.com>,
	Kito Cheng <kito.cheng@gmail.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Atish Patra <atish.patra@wdc.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Kees Cook <keescook@chromium.org>,
	Anup Patel <anup@brainfault.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	Guo Ren <guoren@linux.alibaba.com>, Zong Li <zong.li@sifive.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Borislav Petkov <bp@suse.de>,
	Michel Lespinasse <walken@google.com>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [PATCH 4/5] RISC-V: Protect .init.text & .init.data
Date: Tue, 13 Oct 2020 18:20:49 -0700	[thread overview]
Message-ID: <CAFyWVaYORWYZTXyXOWiY6xK-SFTvsUxDNDqKQnhVUwzc5N045Q@mail.gmail.com> (raw)
In-Reply-To: <CAOnJCUJN-XMZ+N5w+RbVhJag9D_dey7DAopb0Q35GDfXptyMjA@mail.gmail.com>

On Tue, Oct 13, 2020 at 3:25 PM Atish Patra <atishp@atishpatra.org> wrote:
> This happens only when copy_from_user is called from function that is
> annotated with __init.
> Adding Kito & Jim for their input
>
> @kito, @Jim: Please let me know if I should create a issue in
> riscv-gnu-toolchain repo or somewhere else.

I can't do anything useful without a testcase that I can use to
reproduce the problem.  The interactions here are complex, so pointing
at lines of code or kernel config options doesn't give me any useful
info.

Relaxation can convert calls to a jal.  I don't know of any open bugs
in this area that can generate relocation errors.  if it is a
relaxation error then turning off relaxation should work around the
problem as you suggested.

A kernel build problem is serious.  I think this is worth a bug
report.  FSF binutils or riscv-gnu-toolchain is fine.

Jim

WARNING: multiple messages have this Message-ID (diff)
From: Jim Wilson <jimw@sifive.com>
To: Atish Patra <atishp@atishpatra.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>,
	Kees Cook <keescook@chromium.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Anup Patel <anup@brainfault.org>,
	Kito Cheng <kito.cheng@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Atish Patra <atish.patra@wdc.com>,
	Guo Ren <guoren@linux.alibaba.com>,
	Palmer Dabbelt <palmer@dabbelt.com>, Zong Li <zong.li@sifive.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Greentime Hu <greentime.hu@sifive.com>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	Borislav Petkov <bp@suse.de>,
	Michel Lespinasse <walken@google.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 4/5] RISC-V: Protect .init.text & .init.data
Date: Tue, 13 Oct 2020 18:20:49 -0700	[thread overview]
Message-ID: <CAFyWVaYORWYZTXyXOWiY6xK-SFTvsUxDNDqKQnhVUwzc5N045Q@mail.gmail.com> (raw)
In-Reply-To: <CAOnJCUJN-XMZ+N5w+RbVhJag9D_dey7DAopb0Q35GDfXptyMjA@mail.gmail.com>

On Tue, Oct 13, 2020 at 3:25 PM Atish Patra <atishp@atishpatra.org> wrote:
> This happens only when copy_from_user is called from function that is
> annotated with __init.
> Adding Kito & Jim for their input
>
> @kito, @Jim: Please let me know if I should create a issue in
> riscv-gnu-toolchain repo or somewhere else.

I can't do anything useful without a testcase that I can use to
reproduce the problem.  The interactions here are complex, so pointing
at lines of code or kernel config options doesn't give me any useful
info.

Relaxation can convert calls to a jal.  I don't know of any open bugs
in this area that can generate relocation errors.  if it is a
relaxation error then turning off relaxation should work around the
problem as you suggested.

A kernel build problem is serious.  I think this is worth a bug
report.  FSF binutils or riscv-gnu-toolchain is fine.

Jim

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2020-10-14  9:22 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 21:13 [PATCH 0/5] Improve kernel section protections Atish Patra
2020-10-09 21:13 ` Atish Patra
2020-10-09 21:13 ` [PATCH 1/5] RISC-V: Move __start_kernel to .head.text Atish Patra
2020-10-09 21:13   ` Atish Patra
2020-10-09 21:13 ` [PATCH 2/5] RISC-V: Initialize SBI early Atish Patra
2020-10-09 21:13   ` Atish Patra
2020-10-09 21:13 ` [PATCH 3/5] RISC-V: Enforce protections for kernel sections early Atish Patra
2020-10-09 21:13   ` Atish Patra
2020-10-09 21:13 ` [PATCH 4/5] RISC-V: Protect .init.text & .init.data Atish Patra
2020-10-09 21:13   ` Atish Patra
2020-10-12 13:14   ` Greentime Hu
2020-10-12 13:14     ` Greentime Hu
2020-10-12 23:26     ` Atish Patra
2020-10-12 23:26       ` Atish Patra
2020-10-13  1:28       ` Atish Patra
2020-10-13  1:28         ` Atish Patra
2020-10-13  3:08         ` Greentime Hu
2020-10-13  3:08           ` Greentime Hu
2020-10-13 22:25           ` Atish Patra
2020-10-13 22:25             ` Atish Patra
2020-10-14  1:20             ` Jim Wilson [this message]
2020-10-14  1:20               ` Jim Wilson
2020-10-14  5:24               ` Atish Patra
2020-10-14  5:24                 ` Atish Patra
2020-10-16 18:24                 ` Atish Patra
2020-10-16 18:24                   ` Atish Patra
2020-10-22  1:31                   ` Atish Patra
2020-10-22  1:31                     ` Atish Patra
2020-10-22  5:03                     ` Anup Patel
2020-10-22  5:03                       ` Anup Patel
2020-10-22  7:22                       ` Anup Patel
2020-10-22  7:22                         ` Anup Patel
2020-10-22 17:13                         ` Atish Patra
2020-10-22 17:13                           ` Atish Patra
2020-10-09 21:13 ` [PATCH 5/5] RISC-V: Move dynamic relocation section under __init Atish Patra
2020-10-09 21:13   ` Atish Patra

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=CAFyWVaYORWYZTXyXOWiY6xK-SFTvsUxDNDqKQnhVUwzc5N045Q@mail.gmail.com \
    --to=jimw@sifive.com \
    --cc=akpm@linux-foundation.org \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=atish.patra@wdc.com \
    --cc=atishp@atishpatra.org \
    --cc=bp@suse.de \
    --cc=greentime.hu@sifive.com \
    --cc=guoren@linux.alibaba.com \
    --cc=keescook@chromium.org \
    --cc=kito.cheng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=walken@google.com \
    --cc=zong.li@sifive.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.