for linker fill
bytes")
Cc: sta...@vger.kernel.org
Reported-by: Adam Zabrocki
Signed-off-by: Masami Hiramatsu
---
arch/x86/kernel/kprobes/opt.c | 22 --
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel
tween functions, it should be
> > reconsidered.
> >
>
> Looks like it's a default behavior now.
OK, let me fix that. If the int3 is only used for the padding between functions,
those int3 should continue to the end of the function. So kprobes can
distinguish
the int3 comes from other subsystems or linker.
Thank you,
>
> > Thank you,
> >
> > > If it is OK, we should backport those to stable tree.
> >
> > Agreed.
>
> It is also important to make sure that distro kernels would pick-up such
> backported fix.
>
> Thanks,
> Adam
>
> --
> pi3 (pi3ki31ny) - pi3 (at) itsec pl
> http://pi3.com.pl
>
--
Masami Hiramatsu
vger.kernel.org # 5.9.x
Cc: Peter Zijlstra
Acked-by: Masami Hiramatsu
Signed-off-by: Steven Rostedt (VMware)
---
kernel/kprobes.c | 25 +
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index b885d884603d..1b7fd1ab8d
ger in_nmi() check.
Cc: sta...@vger.kernel.org # 5.9.x
Signed-off-by: Masami Hiramatsu
Signed-off-by: Peter Zijlstra (Intel)
Signed-off-by: Ingo Molnar
Link:
https://lkml.kernel.org/r/159870615628.1229682.6087311596892125907.stgit@devnote2
---
kernel/kprobes.c | 16
1 file
Hi Adam,
On Thu, 10 Dec 2020 08:17:42 +0100
Adam Zabrocki wrote:
> Hi,
>
> On Thu, Dec 10, 2020 at 10:25:07AM +0900, Masami Hiramatsu wrote:
> > Hi Adam,
> >
> > Thank you for reporting and debugging, actually we had investigated this
> > issue in Aug. Please
On Wed, 9 Dec 2020 09:49:19 -0500
Steven Rostedt wrote:
> On Wed, 9 Dec 2020 08:39:54 +0900
> Masami Hiramatsu wrote:
>
> > > OK. I'll look at how to make this for both cases (embedded and not).
> > > Because, my current case is to copy the selftests to the mach
rp->nmissed++;
> return 0;
> }
>
> Essentially, exc_int3() calls nmi_enter(), and pre_handler_kretprobe() before
> invoking any registered kprobe verifies if it is not in NMI via in_nmi() call.
>
> This bug was masked by OPTIMIZER which was turning most of the KPROBES to be
> FTRACE so essentially if someone registered KRETPROBE, buggy code was not
> invoked (FTRACE code was executed instead). However, the optimizer was changed
> and can't optimize as many functions anymore (probably another bug which might
> be worth to investigate) and this bug is more visible.
>
> Thanks,
> Adam
>
> --
> pi3 (pi3ki31ny) - pi3 (at) itsec pl
> http://pi3.com.pl
>
--
Masami Hiramatsu
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 78ff2733ff352175eb7f4418a34654346e1b6cd2
Gitweb:
https://git.kernel.org/tip/78ff2733ff352175eb7f4418a34654346e1b6cd2
Author:Masami Hiramatsu
AuthorDate:Wed, 28 Oct 2020 23:31:10 +09:00
s interface doesn't provide syntax error reports
- synthetic_events interface is not self-reproducive*.
*) I meant
$ cat synthetic_events > saved_events
$ cat saved_events > synthetic_events
should work. But this does *NOT* mean
$ cat user-input > synthetic_events
$ cat synthetic_events > saved_events
$ diff user-input saved_events # no diff
So input and output can be different, but the output can be input again.
Thank you,
--
Masami Hiramatsu
Add ftrace.instance.INSTANCE.tracing_on support to ftrace2bconf.sh
and bconf2ftrace.sh.
commit 8490db06f914 ("tracing/boot: Add per-instance tracing_on
option support") added the per-instance tracing_on option,
but forgot to update the helper scripts.
Signed-off-by: Masami Hiramatsu
On Tue, 8 Dec 2020 10:00:24 -0500
Steven Rostedt wrote:
> On Tue, 8 Dec 2020 21:14:11 +0900
> Masami Hiramatsu wrote:
>
> > On Tue, 1 Dec 2020 16:06:56 -0500
> > Steven Rostedt wrote:
> >
> > > From: Steven Rostedt (VMware)
> > >
> > >
(NULL);
> + if (!tep)
> + pdie("Error loading events");
> +
> + events_enable = tracefs_instance_get_file(NULL, "events/enable");
> + current_tracer = tracefs_instance_get_file(NULL, "current_tracer");
> + tracing_on = tracefs_instance_get_file(NULL, "tracing_on");
> +
> + if (!events_enable || !current_tracer || !tracing_on)
> + pdie("Allocating strings");
> +
> + cpus = sysconf(_SC_NPROCESSORS_CONF);
> +
> + info = calloc(cpus, sizeof(*info));
> + if (!info)
> + pdie("Allocating per cpu info");
> +
> + efd = open(events_enable, O_WRONLY);
> + if (efd < 0)
> + pdie(events_enable);
> +
> + cfd = open(current_tracer, O_WRONLY);
> + if (cfd < 0)
> + pdie(current_tracer);
> +
> + tfd = open(tracing_on, O_WRONLY);
> + if (tfd < 0)
> + pdie(current_tracer);
> +
> + write(efd, "1", 1);
> + write(cfd, "function", 8);
> +
> + test_buffer(tep, time);
> +
> + write(efd, "0", 1);
> + write(cfd, "nop", 3);
> + write(tfd, "1", 1);
> +
> + close(efd);
> + close(cfd);
> + close(tfd);
> + exit(result);
> +}
> diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/ring-buffer.tc
> b/tools/testing/selftests/ftrace/test.d/ftrace/ring-buffer.tc
> new file mode 100644
> index ..05f628124774
> --- /dev/null
> +++ b/tools/testing/selftests/ftrace/test.d/ftrace/ring-buffer.tc
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
> +# description: ftrace - test ring buffer timestamps
> +
> +cd $TOP_DIR/test-ring-buffer
> +if ! make ; then
> + cd $TRACING_DIR
> + exit_untested
> +fi
> +
> +./test-ring-buffer 10
> +
> +make clean
> +
> +cd $TRACING_DIR
> +
--
Masami Hiramatsu
On Mon, 7 Dec 2020 18:33:22 -0500
Steven Rostedt wrote:
>
> Hi Masami,
>
> You had comments on this patch for v2. Is this one fine for you?
Yes, this part is good for me. v2 [1/4] is separated into v3 [1/5] and [2/5].
Acked-by: Masami Hiramatsu
Thank you,
>
> -- Steve
entry.
Fixes: 4d655281eb1b ("tracing/boot Add kprobe event support")
Cc: sta...@vger.kernel.org
Signed-off-by: Masami Hiramatsu
---
kernel/trace/trace.c | 19 +--
kernel/trace/trace.h |5 +
kernel/trace/trace_boot.c |2 ++
kernel/trace
Hi Steve,
On Mon, 7 Dec 2020 15:25:40 -0500
Steven Rostedt wrote:
> On Mon, 7 Dec 2020 23:02:59 +0900
> Masami Hiramatsu wrote:
>
> > There will be the 2 options, one is to change kconfig so that user can not
> > select FTRACE_STARTUP_TEST if BOOTTIME_TRACING=y, anothe
ou,
>From 00037083baca07a8705da39852480f6f53a8297c Mon Sep 17 00:00:00 2001
From: Masami Hiramatsu
Date: Mon, 7 Dec 2020 22:53:16 +0900
Subject: [PATCH] tracing/kprobes: Fix to skip kprobe-events startup test if
kprobe-events is used
commit b6399cc78934 ("tracing/kprobe: Do not run kprobe boot tests
if kprobe_event is on c
opcode for resuming process.
Signed-off-by: Masami Hiramatsu
---
arch/x86/include/asm/kprobes.h | 11 ++-
arch/x86/kernel/kprobes/core.c | 166 ++--
2 files changed, 80 insertions(+), 97 deletions(-)
diff --git a/arch/x86/include/asm/kprobes.h b/arch/x86
cient.
So decode the opcode while preparing kprobes (arch_copy_kprobe())
instead of resume_execution() and set some flags for resuming from
single stepping. This also removes the custom instruction prefix
decoding, which should be done in x86 instruction decoder.
Thank you,
---
Masami Hiramat
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 84da009f06e60cf59d5e861f8e2101d2d3885517
Gitweb:
https://git.kernel.org/tip/84da009f06e60cf59d5e861f8e2101d2d3885517
Author:Masami Hiramatsu
AuthorDate:Thu, 03 Dec 2020 13:51:01 +09:00
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 12cb908a11b2544b5f53e9af856e6b6a90ed5533
Gitweb:
https://git.kernel.org/tip/12cb908a11b2544b5f53e9af856e6b6a90ed5533
Author:Masami Hiramatsu
AuthorDate:Thu, 03 Dec 2020 13:50:50 +09:00
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 4e9a5ae8df5b3365183150f6df49e49dece80d8c
Gitweb:
https://git.kernel.org/tip/4e9a5ae8df5b3365183150f6df49e49dece80d8c
Author:Masami Hiramatsu
AuthorDate:Thu, 03 Dec 2020 13:50:37 +09:00
On Sat, 5 Dec 2020 11:17:04 +0100
Borislav Petkov wrote:
> On Sat, Dec 05, 2020 at 09:12:56AM +0900, Masami Hiramatsu wrote:
> > This may break tools/objtool build. Please keep "inat.h".
>
> How? Please elaborate.
>
> Build tests are fine here.
Oops, sorry,
On Fri, 4 Dec 2020 16:02:21 +0100
Borislav Petkov wrote:
> On Fri, Dec 04, 2020 at 07:55:09PM +0900, Masami Hiramatsu wrote:
> > Hi,
> >
> > Here are the 3rd version of patches to fix the wrong loop boundary
> > check on insn.prefixes.bytes[] array.
>
> Ok, s
On Fri, 04 Dec 2020 15:04:03 -
"tip-bot2 for Masami Hiramatsu" wrote:
> The following commit has been merged into the x86/urgent branch of tip:
>
> Commit-ID: 9dc23f960adb9ce410ef835b32a2398fdb09c828
> Gitweb:
> https://git.kernel.org/tip/9dc23f960adb9ce
On Fri, 4 Dec 2020 16:05:22 +0100
Borislav Petkov wrote:
> On Fri, Dec 04, 2020 at 07:55:20PM +0900, Masami Hiramatsu wrote:
> > +/**
> > + * for_each_insn_prefix() -- Iterate prefixes in the instruction
> > + * @insn: Pointer to struct insn.
> > + * @idx: Index stora
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 46a4ad7814fa39971aa6549b30c1a08d5c2ec65f
Gitweb:
https://git.kernel.org/tip/46a4ad7814fa39971aa6549b30c1a08d5c2ec65f
Author:Masami Hiramatsu
AuthorDate:Thu, 03 Dec 2020 13:51:01 +09:00
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 2d7896c24ec977e91af1ff93c823032a27212700
Gitweb:
https://git.kernel.org/tip/2d7896c24ec977e91af1ff93c823032a27212700
Author:Masami Hiramatsu
AuthorDate:Thu, 03 Dec 2020 13:50:50 +09:00
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 9dc23f960adb9ce410ef835b32a2398fdb09c828
Gitweb:
https://git.kernel.org/tip/9dc23f960adb9ce410ef835b32a2398fdb09c828
Author:Masami Hiramatsu
AuthorDate:Thu, 03 Dec 2020 13:50:37 +09:00
On Fri, 4 Dec 2020 12:06:44 +0100
Borislav Petkov wrote:
> On Fri, Dec 04, 2020 at 09:56:53AM +0900, Masami Hiramatsu wrote:
> > Hmm, there is a difference between Intel SDM and AMD APM.
> >
> > Intel SDM vol.2
> >
> > 2.1.1 Instruction Prefixes
> > Ins
. Or,
if the prefixes.bytes[] is filled with prefix bytes, we can check
the index is less than 4.
Thank you,
---
Masami Hiramatsu (3):
x86/uprobes: Fix not using prefixes.nbytes for loop over prefixes.bytes
x86/insn-eval: Fix not using prefixes.nbytes for loop over prefixes.bytes
Signed-off-by: Masami Hiramatsu
Cc: sta...@vger.kernel.org
---
Changes in v3:
- Add NUM_INSN_FIELD_BYTES and MAX_LEGACY_PREFIX_GROUPS macros
and comments on it.
Changes in v2:
- Add for_each_insn_prefix() macro and fix to check index first.
---
arch/x86/include/asm/insn.h
ceptions")
Reported-by: syzbot+9b64b619f10f19d19...@syzkaller.appspotmail.com
Debugged-by: Kees Cook
Signed-off-by: Masami Hiramatsu
---
arch/x86/boot/compressed/sev-es.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/boot/compressed/sev-es.c
b/arch/x86/boot/c
segment
selector")
Reported-by: syzbot+9b64b619f10f19d19...@syzkaller.appspotmail.com
Debugged-by: Kees Cook
Signed-off-by: Masami Hiramatsu
Cc: sta...@vger.kernel.org
---
arch/x86/lib/insn-eval.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/lib/insn-
On Fri, 4 Dec 2020 09:56:53 +0900
Masami Hiramatsu wrote:
> On Thu, 3 Dec 2020 12:49:46 -0600
> Tom Lendacky wrote:
>
> > On 12/3/20 12:17 PM, Borislav Petkov wrote:
> > > On Thu, Dec 03, 2020 at 12:10:10PM -0600, Tom Lendacky wrote:
> > >> Since that struct
ase, insn.c just store the 1 osp in the prefixes.bytes[], and
just increment prefixes.nbytes for the repeated prefixes.
Anyway, if there is LOCK-REP prefix combination, I have to introduce new
insn_field for legacy prefix.
Thank you,
--
Masami Hiramatsu
On Thu, 3 Dec 2020 13:37:57 +0100
Borislav Petkov wrote:
> On Thu, Dec 03, 2020 at 01:50:37PM +0900, Masami Hiramatsu wrote:
> > Since the insn.prefixes.nbytes can be bigger than the size of
> > insn.prefixes.bytes[] when a same prefix is repeated, we have to
> &
On Thu, 3 Dec 2020 10:45:48 -0600
Tom Lendacky wrote:
> On 12/3/20 6:48 AM, Borislav Petkov wrote:
> > So it ended up like this:
> >
> > ---
> > From 5014e4e902778d63ce392f864b3654baa4b72384 Mon Sep 17 00:00:00 2001
> > From: Masami Hiramatsu
> &g
ceptions")
Reported-by: syzbot+9b64b619f10f19d19...@syzkaller.appspotmail.com
Debugged-by: Kees Cook
Signed-off-by: Masami Hiramatsu
---
arch/x86/boot/compressed/sev-es.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/boot/compressed/sev-es.c
b/arch/x86/boot/c
segment
selector")
Reported-by: syzbot+9b64b619f10f19d19...@syzkaller.appspotmail.com
Debugged-by: Kees Cook
Signed-off-by: Masami Hiramatsu
Cc: sta...@vger.kernel.org
---
arch/x86/lib/insn-eval.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/lib/insn-
xes: 2b1444983508 ("uprobes, mm, x86: Add the ability to install and remove
uprobes breakpoints")
Reported-by: syzbot+9b64b619f10f19d19...@syzkaller.appspotmail.com
Debugged-by: Kees Cook
Reviewed-by: Srikar Dronamraju
Signed-off-by: Masami Hiramatsu
Cc: sta...@vger.kernel.org
---
Changes i
is less than 4.
Thank you,
---
Masami Hiramatsu (3):
x86/uprobes: Fix not using prefixes.nbytes for loop over prefixes.bytes
x86/insn-eval: Fix not using prefixes.nbytes for loop over prefixes.bytes
x86/sev-es: Fix not using prefixes.nbytes for loop over prefixes.bytes
arch/
On Wed, 2 Dec 2020 20:21:35 +0530
Srikar Dronamraju wrote:
> * Masami Hiramatsu [2020-12-02 17:51:16]:
>
> > Since the insn.prefixes.nbytes can be bigger than the size of
> > insn.prefixes.bytes[] when a same prefix is repeated, we have to
> > check whether the insn.pr
On Wed, 2 Dec 2020 11:07:26 -0800
Kees Cook wrote:
> On Wed, Dec 02, 2020 at 09:31:57AM -0600, Tom Lendacky wrote:
> > On 12/2/20 2:51 AM, Masami Hiramatsu wrote:
> > > Since the insn.prefixes.nbytes can be bigger than the size of
> > > insn.prefixes.bytes[] when a
On Wed, 2 Dec 2020 11:04:41 -0800
Kees Cook wrote:
> On Wed, Dec 02, 2020 at 05:51:16PM +0900, Masami Hiramatsu wrote:
> > Since the insn.prefixes.nbytes can be bigger than the size of
> > insn.prefixes.bytes[] when a same prefix is repeated, we have to
> > check whether th
d remove
uprobes breakpoints")
Cc: sta...@vger.kernel.org
Reported-by: Kees Cook
Signed-off-by: Masami Hiramatsu
---
arch/x86/kernel/uprobes.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 3fdaa042823d.
segment
selector")
Cc: sta...@vger.kernel.org
Reported-by: Kees Cook
Signed-off-by: Masami Hiramatsu
---
arch/x86/lib/insn-eval.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/lib/insn-eval.c b/arch/x86/lib/insn-eval.c
index 58f7fb95c7f4..c52c91461f52 100644
-
the end of the array. Or,
if the prefixes.bytes[] is filled with prefix bytes, we can check
the index is less than 4.
Thank you,
---
Masami Hiramatsu (3):
x86/sev-es: Fix not using prefixes.nbytes for loop over prefixes.bytes
x86/uprobes: Fix not using prefixes.nbytes for loop o
ceptions")
Reported-by: Kees Cook
Signed-off-by: Masami Hiramatsu
---
arch/x86/boot/compressed/sev-es.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/sev-es.c
b/arch/x86/boot/compressed/sev-es.c
index 954cb2702e23..6a7a3027c9ac 100644
--- a/
eport.txt?x=1597348d90
> > console output: https://syzkaller.appspot.com/x/log.txt?x=1197348d90
> > kernel config: https://syzkaller.appspot.com/x/.config?x=b12e84189082991c
> > dashboard link: https://syzkaller.appspot.com/bug?extid=9b64b619f10f19d19a7c
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1573a8ad90
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=164ee6c590
> >
> > Reported-by: syzbot+9b64b619f10f19d19...@syzkaller.appspotmail.com
> > Fixes: 4b2bd5fec007 ("proc: fix timerslack_ns CAP_SYS_NICE check when
> > adjusting self")
> >
> > For information about bisection process see: https://goo.gl/tpsmEJ#bisection
>
> --
> Kees Cook
--
Masami Hiramatsu
On Tue, 1 Dec 2020 10:48:18 -0500
Steven Rostedt wrote:
> On Fri, 20 Nov 2020 11:28:55 +0900
> Masami Hiramatsu wrote:
>
> > Hello,
> >
> > This is a series of patches to make the size and the checksum fields
> > in the footer le32 instead of u32.
> >
&
return -EINVAL;
addr = kprobe_addr(&rp->kp);
if (IS_ERR(addr))
return PTR_ERR(addr);
rp->kp.addr = addr;
ret = check_kprobe_rereg(&rp->kp);
if (WARN_ON(ret))
return ret;
if (kretprobe_blacklist_size) {
for (i = 0; > > + ret = check_kprobe_rereg(&rp->kp);
Thank you,
--
Masami Hiramatsu
On Mon, 30 Nov 2020 14:44:42 +0100
Borislav Petkov wrote:
> On Sun, Nov 29, 2020 at 05:50:05PM +0900, Masami Hiramatsu wrote:
> > Good point. I think we can return, e.g. -EFAULT if we failed in
> > get_next(). Then, we can read out next page, for example.
>
> Why -EFAULT?
if you pass in garbage?
> How hard would it be to teach it to return a different error code when
> the buffer is too small?
>
Good point. I think we can return, e.g. -EFAULT if we failed in get_next().
Then, we can read out next page, for example.
Thank you,
--
Masami Hiramatsu
On Thu, 26 Nov 2020 18:50:11 +0100
Borislav Petkov wrote:
> On Thu, Nov 26, 2020 at 10:37:09AM +0900, Masami Hiramatsu wrote:
> > BTW, the instruction validation depends on who needs it, because to
> > check the all invalid ops, we need more information in the
> > x86-opco
.
Reported-by: Thomas Richter
Signed-off-by: Masami Hiramatsu
---
tools/perf/util/dwarf-aux.c| 20 ++--
tools/perf/util/probe-finder.c |3 +--
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index
ned-off-by: Masami Hiramatsu
---
tools/perf/util/dwarf-aux.c |8
1 file changed, 8 insertions(+)
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index aa898014ad12..03c1a39c312a 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -373,6 +373
On Wed, 25 Nov 2020 20:25:53 +0100
Borislav Petkov wrote:
> On Thu, Nov 26, 2020 at 01:53:33AM +0900, Masami Hiramatsu wrote:
> > (only from the viewpoint of VEX coding, a bit stricter, but not perfect.)
>
> Yeah, I wanted to document the fact that it has changed behavior
ing.
> [root@seventh ~]# perf probe probe:security_locked_down
> Semantic error :There is non-digit char in line number.
> Error: Command Parse Error.
> [root@seventh ~]# perf probe probe:security_locked_down__return
> Semantic error :There is non-digit char in line number.
> Error: Command Parse Error.
Since you don't pass any option, both are for adding new probe event.
What happen if you run
$ perf probe -d "*:*"
?
Thank you,
--
Masami Hiramatsu
On Tue, 24 Nov 2020 11:19:43 +0100
Borislav Petkov wrote:
> From: Borislav Petkov
>
> Simplify code, no functional changes.
You've made a functional change. Improve decoding error check :)
Anyway, this looks good to me.
Acked-by: Masami Hiramatsu
Thank you!
>
> Sig
o be initialized
> + * @kaddr: address (in kernel memory) of instruction (or copy thereof)
> + * @buf_len: length of the insn buffer at @kaddr
> + * @m: insn mode, see enum insn_mode
> + *
> + * Returns:
> + * 0: if decoding succeeded
> + * < 0: otherwise.
this return value.
Even for the insn_get_*(), I would like to see them returning -EINVAL
as same as insn_decode(). Same API group has different return value is
confusing.
Thank you,
--
Masami Hiramatsu
ies and resend it again.
> >
> > It all looks good to me, thanks!
> >
> > Masami, does this patch look good, and also patches 1-2 of the series?
> > (I think you previously ACKed patch 2).
> >
>
> Friendly ping...
Sorry for replying late.
Yes, I think this series and the last patch look good to me.
Acked-by: Masami Hiramatsu
for this series.
Thank you!
--
Masami Hiramatsu
mpared.
Thank you,
>
> When you give it a buffer of size smaller than the first instruction:
>
> supplied buf size: 1, ret -22
>
> while the first insn is 2 bytes long:
>
> 0x48 0xcf (IRETQ)
>
> then it signals an error.
>
> Andy, does that work for your use cases?
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
--
Masami Hiramatsu
Add a description about the endianness of the size and the checksum
fields. Those must be stored as le32 instead of u32. This will allow
us to apply bootconfig to the cross build initrd without caring
the endianness.
Reported-by: Steven Rostedt
Suggested-by: Linus Torvalds
Signed-off-by: Masami
Load the size and the checksum fields in the footer as le32
instead of u32. This will allow us to apply bootconfig to the
cross build initrd without caring the endianness.
Reported-by: Steven Rostedt
Suggested-by: Linus Torvalds
Signed-off-by: Masami Hiramatsu
---
init/main.c |4 ++--
1
Store the size and the checksum fields in the footer as le32
instead of u32. This will allow us to apply bootconfig to the
cross build initrd without caring the endianness.
Reported-by: Steven Rostedt
Suggested-by: Linus Torvalds
Signed-off-by: Masami Hiramatsu
---
tools/bootconfig/main.c
2249.30d20...@gandalf.local.home/
[2]
https://lore.kernel.org/linux-doc/CAHk-=wi9redsqogf06dvs2mp7tbp4qoiw8+xzzncdfjr3zo...@mail.gmail.com/
---
Masami Hiramatsu (3):
bootconfig: Load size and checksum in the footer as le32
tools/bootconfig: Store size and checksum in footer as le32
docs: bootc
2249.30d20...@gandalf.local.home/
[2]
https://lore.kernel.org/linux-doc/CAHk-=wi9redsqogf06dvs2mp7tbp4qoiw8+xzzncdfjr3zo...@mail.gmail.com/
---
Masami Hiramatsu (3):
bootconfig: Load size and checksum in the footer as le32
tools/bootconfig: Store size and checksum in footer as le32
docs: bootc
On Thu, 19 Nov 2020 12:42:34 -0500
Steven Rostedt wrote:
> On Thu, 19 Nov 2020 09:36:47 -0800
> Linus Torvalds wrote:
>
> > On Thu, Nov 19, 2020 at 6:31 AM Masami Hiramatsu
> > wrote:
> > >
> > > Here is a seires of patches to change the bootco
-off-by: Masami Hiramatsu
---
Documentation/admin-guide/bootconfig.rst |6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/bootconfig.rst
b/Documentation/admin-guide/bootconfig.rst
index 363599683784..1c6d6919d9e6 100644
--- a/Documentation/admin
handle
new format.
Signed-off-by: Masami Hiramatsu
---
tools/bootconfig/main.c | 43 ++-
tools/bootconfig/test-bootconfig.sh |2 +-
2 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index
To make the bootconfig format more platform independent, use
8-bytes hexadecimal ASCII string for size and checksum field
in the footer. This will allow us to apply bootconfig to the
cross build initrd without caring the endianness.
Signed-off-by: Masami Hiramatsu
---
init/main.c | 20
https://lore.kernel.org/lkml/20201118112249.30d20...@gandalf.local.home/
---
Masami Hiramatsu (3):
bootconfig: Use hexadecimal ASCII string for size and checksum
tools/bootconfig: Use hexadecimal ASCII string for size and checksum
docs: bootconfig: Use hexadecimal ASCII string for size and che
To align the total file size, add padding null character when appending
the bootconfig to initrd image.
Signed-off-by: Masami Hiramatsu
---
0 files changed
diff --git a/Documentation/admin-guide/bootconfig.rst
b/Documentation/admin-guide/bootconfig.rst
index a22024f9175e..363599683784 100644
llows.
[initrd][bootconfig][(pad)][size][csum]["#BOOTCONFIG\n"]
Signed-off-by: Masami Hiramatsu
---
Changes in v5:
- Sort the local variables by length.
- Remove if from padding size calculation (alignment should be power of two)
- Cleanup footer setup code.
- Fix a bug if wr
-by: Linus Torvalds
Signed-off-by: Masami Hiramatsu
---
Changes in v5:
- Return -ENOSPC for partial write.
---
tools/bootconfig/main.c | 30 ++
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/ma
Fix not to refer the errno variable as the result of previous libc
functions after printf() because printf() can change the errno.
Fixes: 85c46b78da58 ("bootconfig: Add bootconfig magic word for indicating
bootconfig explicitly")
Signed-off-by: Masami Hiramatsu
---
tools/bootcon
ls/bootconfig/main.c | 121 +++
tools/bootconfig/test-bootconfig.sh |6 +-
2 files changed, 85 insertions(+), 42 deletions(-)
--
Masami Hiramatsu (Linaro)
On Thu, 19 Nov 2020 00:35:35 +0900
Masami Hiramatsu wrote:
> Fix to check the write(2) failure including partial write
> correctly and try to rollback the partial write, because
> if there is no BOOTCONFIG_MAGIC string, we can not remove it.
>
> Fixes: 85c46b78da58 ("bootco
On Wed, 18 Nov 2020 11:22:49 -0500
Steven Rostedt wrote:
> On Thu, 19 Nov 2020 00:35:44 +0900
> Masami Hiramatsu wrote:
>
> > +
> > + /* To align up the total size to BOOTCONFIG_ALIGN, get padding size */
> > + total_size = stat.st_size + size + sizeof(u32) * 2
On Wed, 18 Nov 2020 11:04:37 -0500
Steven Rostedt wrote:
> On Thu, 19 Nov 2020 00:35:35 +0900
> Masami Hiramatsu wrote:
>
> > Fix to check the write(2) failure including partial write
> > correctly and try to rollback the partial write, because
> > if there is no
To align the total file size, add padding null character when appending
the bootconfig to initrd image.
Signed-off-by: Masami Hiramatsu
---
0 files changed
diff --git a/Documentation/admin-guide/bootconfig.rst
b/Documentation/admin-guide/bootconfig.rst
index a22024f9175e..363599683784 100644
llows.
[initrd][bootconfig][(pad)][size][csum]["#BOOTCONFIG\n"]
Signed-off-by: Masami Hiramatsu
Tested-by: Chen Yu
---
Changes in v3:
- Fix patch description
- Fix a typo.
- Consolidate several write()s to 1 time write to fix/simplify
the error check.
Changes in v2:
- Fix to
-by: Linus Torvalds
Signed-off-by: Masami Hiramatsu
Tested-by: Chen Yu
---
tools/bootconfig/main.c | 27 +++
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 52eb2bbe8966..905bfaefae35 100644
-
Fix not to refer the errno variable as the result of previous libc
functions after printf() because printf() can change the errno.
Fixes: 85c46b78da58 ("bootconfig: Add bootconfig magic word for indicating
bootconfig explicitly")
Signed-off-by: Masami Hiramatsu
---
tools/bootcon
ize to 4, and U-Boot/EDK2 would not change it. So I couldn't
say what is the best size.
Anyway, I updated the documentation too, which clearly says that
the above changing points, and if the bootloader pass the wrong
size, kernel will not find bootconfig from the initrd.
Thank you,
---
From: Luo Meng
Fix a mutex_unlock() issue where before copy_from_user() is
not called mutex_locked.
Fixes: 4b1a29a7f542 ("error-injection: Support fault injection framework")
Reported-by: Hulk Robot
Acked-by: Masami Hiramatsu
Signed-off-by: Luo Meng
Signed-off-by: Masami Hiramat
Hi,
On Tue, 17 Nov 2020 20:08:08 -0800
Alexei Starovoitov wrote:
> On Wed, Nov 11, 2020 at 1:31 AM Masami Hiramatsu wrote:
> >
> > Hi Luo,
> >
> > On Tue, 10 Nov 2020 16:42:45 +0800
> > Luo Meng wrote:
> >
> > > Fix a mutex_unlock() issue w
On Tue, 17 Nov 2020 20:10:10 +0800
Chen Yu wrote:
> On Tue, Nov 17, 2020 at 5:53 PM Masami Hiramatsu wrote:
> >
> > Fix to check the write(2) failure including partial write
> > correctly and try to rollback the partial write, because
> > if there is no BOOTCONF
To align the total file size, add padding null character when appending
the bootconfig to initrd image.
Signed-off-by: Masami Hiramatsu
---
Documentation/admin-guide/bootconfig.rst | 18 +-
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin
pass the wrong
size, kernel will not find bootconfig from the initrd.
Thank you,
---
Masami Hiramatsu (3):
tools/bootconfig: Fix to check the write failure correctly
tools/bootconfig: Align the bootconfig applied initrd image size to 4
docs: bootconfig: Update file fo
llows.
[initrd][bootconfig][(pad)][size][csum]["#BOOTCONFIG\n"]
Signed-off-by: Masami Hiramatsu
---
Changes in v3:
- Fix patch description
- Fix a typo.
- Consolidate several write()s to 1 time write to fix/simplify
the error check.
Changes in v2:
- Fix to add the footer siz
-by: Linus Torvalds
Signed-off-by: Masami Hiramatsu
---
tools/bootconfig/main.c | 27 +++
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index eb92027817a7..f7b89a50404c 100644
--- a/tools/bootconfig/ma
On Mon, 16 Nov 2020 10:29:45 -0800
Linus Torvalds wrote:
> On Mon, Nov 16, 2020 at 8:22 AM Masami Hiramatsu wrote:
> >
> > /* TODO: Ensure the @path is initramfs/initrd image */
> > - ret = write(fd, data, size + 8);
> > + ret = write(fd, data, siz
and if the bootloader pass the wrong
size, kernel will not find bootconfig from the initrd.
Thank you,
---
Masami Hiramatsu (2):
tools/bootconfig: Align the bootconfig applied initrd image size to 4
Documentation: bootconfig: Update file format on initrd image
tools/bootco
Align the bootconfig applied initrd image size to 4. To pad the data,
bootconfig will use space (0x20) in front of the bootconfig data,
and expands its size and update checksum.
Signed-off-by: Masami Hiramatsu
---
Changes in v2:
- Fix to add the footer size.
---
tools/bootconfig/main.c
To align the total file size, add padding null character when appending
the bootconfig to initrd image.
Signed-off-by: Masami Hiramatsu
---
0 files changed
diff --git a/Documentation/admin-guide/bootconfig.rst
b/Documentation/admin-guide/bootconfig.rst
index a22024f9175e..363599683784 100644
On Tue, 17 Nov 2020 00:05:53 +0900
Masami Hiramatsu wrote:
> Align the bootconfig applied initrd image size to 4. To pad the data,
> bootconfig will use space (0x20) in front of the bootconfig data,
> and expands its size and update checksum.
>
> Signed-off-by: M
To align the total file size, add padding null character when appending
the bootconfig to initrd image.
Signed-off-by: Masami Hiramatsu
---
Documentation/admin-guide/bootconfig.rst | 18 +-
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin
Align the bootconfig applied initrd image size to 4. To pad the data,
bootconfig will use space (0x20) in front of the bootconfig data,
and expands its size and update checksum.
Signed-off-by: Masami Hiramatsu
---
include/linux/bootconfig.h |1 +
tools/bootconfig/main.c
ize to 4, and U-Boot/EDK2 will
not change it. So I couldn't say what is the best size.
Anyway, I updated the documentation too, which clearly says that
the above changing points, and if the bootloader pass the wrong
size, kernel will not find bootconfig from the initrd.
Thank you,
701 - 800 of 3389 matches
Mail list logo