From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
mm-commits@vger.kernel.org, masahiroy@kernel.org,
gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array
Date: Wed, 26 Oct 2022 03:50:25 +0200 [thread overview]
Message-ID: <Y1iSYddi3BpP8gvf@zx2c4.com> (raw)
In-Reply-To: <202210201151.ECC19BC97A@keescook>
On Thu, Oct 20, 2022 at 11:57:12AM -0700, Kees Cook wrote:
> On Thu, Oct 20, 2022 at 10:42:25AM -0700, Linus Torvalds wrote:
> > On Thu, Oct 20, 2022 at 10:33 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> > >
> > > Or sometimes with objdump, I've had more success by keeping debug
> > > symbols, and then trimming offsets from jmps.
> >
> > objdump is what I'm using, and it actually seems ok on individual object files.
> >
> > Now I just need to script the "do all the object files" and see how
> > massive the end result is.
>
> For the a/b build, I start with all*config, then:
>
> # Stop painful noise
> CONFIG_KCOV=n
> CONFIG_GCOV_KERNEL=n
> CONFIG_GCC_PLUGINS=n
> CONFIG_IKHEADERS=n
> CONFIG_KASAN=n
> CONFIG_UBSAN=n
> CONFIG_KCSAN=n
> CONFIG_KMSAN=n
> # Get us source/line details
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
> CONFIG_DEBUG_INFO_REDUCED=n CONFIG_DEBUG_INFO_COMPRESSED=n
> CONFIG_DEBUG_INFO_SPLIT=n
>
> And to keep other build-time junk stabilized[1], I build with these make
> options:
>
> KBUILD_BUILD_TIMESTAMP=1970-01-01
> KBUILD_BUILD_USER=user
> KBUILD_BUILD_HOST=host
> KBUILD_BUILD_VERSION=1
The LLVM `.ll` file thing I tried turned out to be a disaster. Too much
noise, as this is too early of a stage.
The traditional objdump comparison does work, though. It produces a good
amount of noise, but still yields a manageable amount of diffs -- 882 --
which can then be paired down more with heuristics.
I've been using this script below to compare `linux-schar/` with
`linux-uchar/`, which creates a directory `linux-schar-uchar/` filled
with color diffs that I can then flip through using
`less -R linux-schar-uchar/*.diff`. Seems to work okay, so I'll post it
here in case others are curious about looking through these.
Jason
------8<--------------------------------
#!/bin/bash
asm_diff() {
objdump \
--disassemble \
--demangle \
--no-show-raw-insn \
--no-addresses \
--section=.text \
--disassembler-options=intel \
"$1" | \
sed \
-e 's/[0-9a-f]\+ \(<[a-zA-Z0-9_+-]\+>\)/?? \1/g' \
-e 's/<\([a-zA-Z0-9_-]\+\)+0x[a-f0-9]\+>/<\1>/g' \
-e '/\/[a-zA-Z0-9._-]\+\.o:/d'
}
A=linux-schar
B=linux-uchar
C=linux-schar-uchar
rm -rf "$C"
mkdir -p "$C"
while read -r obj_a; do
obj_b="$B/${obj_a#$A/}"
diff_c="${obj_a#$A/}"
diff_c="$C/${diff_c//\//--}.diff"
[[ -f $obj_b ]] || { echo "ERROR: $obj_b is missing" >&2; exit 1; }
echo "${obj_a#$A/}" >&2
diff --color=always --text --unified=10 \
<(asm_diff "$obj_a") <(asm_diff "$obj_b") > "$diff_c" && \
rm -f "$diff_c"
done < <(exec find "$A" -name '*.o')
next prev parent reply other threads:[~2022-10-26 1:50 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221020000356.177CDC433C1@smtp.kernel.org>
2022-10-20 9:43 ` + kbuild-treat-char-as-always-unsigned.patch added to mm-nonmm-unstable branch Alexey Dobriyan
2022-10-20 9:49 ` [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array Alexey Dobriyan
2022-10-20 9:56 ` [PATCH -mm] -funsigned-char, namei: delete cast in lookup_one_common() Alexey Dobriyan
2022-10-20 16:28 ` [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array Jason A. Donenfeld
2022-10-20 17:14 ` Linus Torvalds
2022-10-20 17:33 ` Jason A. Donenfeld
2022-10-20 17:42 ` Linus Torvalds
2022-10-20 18:57 ` Kees Cook
2022-10-20 19:39 ` Linus Torvalds
2022-10-20 20:17 ` Linus Torvalds
2022-10-20 21:34 ` Andy Shevchenko
2022-10-20 22:46 ` Jason A. Donenfeld
2022-10-21 6:48 ` Greg KH
2022-10-21 7:24 ` Jason A. Donenfeld
2022-10-21 7:36 ` Greg KH
2022-10-26 1:50 ` Jason A. Donenfeld [this message]
2022-10-26 12:58 ` Jason A. Donenfeld
2022-10-26 13:17 ` Andy Shevchenko
2022-11-02 17:17 ` [cocci] " Julia Lawall
2022-11-03 0:08 ` Jason A. Donenfeld
2022-11-03 6:31 ` Julia Lawall
2022-11-03 12:45 ` Julia Lawall
2022-11-03 12:47 ` Jason A. Donenfeld
2022-11-03 12:57 ` Julia Lawall
2022-11-03 14:07 ` Jason A. Donenfeld
2022-10-24 15:44 ` Jason A. Donenfeld
2022-10-21 5:59 ` Alexey Dobriyan
2022-10-21 17:11 ` Linus Torvalds
2022-10-21 17:23 ` Linus Torvalds
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=Y1iSYddi3BpP8gvf@zx2c4.com \
--to=jason@zx2c4.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox