All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Richard Weinberger <richard@nod.at>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	Kees Cook <keescook@chromium.org>, Cong Ding <dinggnu@gmail.com>,
	Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mathias Krause <minipli@googlemail.com>,
	Michael Davidson <md@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Subject: Re: [GIT PULL] x86/kaslr for v3.14
Date: Tue, 28 Jan 2014 20:48:23 +0100	[thread overview]
Message-ID: <20140128194823.GA18702@gmail.com> (raw)
In-Reply-To: <CA+55aFw_xs1tUteDrXz21QZB7BFk5p+F5NZ-SpV=CUVjeFwapA@mail.gmail.com>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, Jan 28, 2014 at 9:05 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > Well, I often use the hex numbers to look them up and disassemble them
> > in a vmlinux via gdb and 'list *0x1234123412341234' - where the
> > vmlinux has no debuginfo. (Debuginfo takes longer to build so I
> > generally build without it.)
> 
> Why the heck wouldn't you do that? Just do
> 
>    list schedule+0x45
> 
> instead.
> 
> > AFAICS this won't work in a symbol-less vmlinux. Is there some trick
> > to do it with gdb?
> 
> Why would you have a symbol-less vmlinux? The only reason to strip 
> vmlinux is because you were crazy enough to build with 

I don't think I ever stripped a vmlinux in my life, and I definitely 
didn't strip this one:

  phoenix:~/linux/linux> file vmlinux
  vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=0x239d56b40bb654ddd2dd704e6b585d5c90de4e12, not stripped

> CONFIG_DEBUG_INFO and the damn debug info is so large that it won't 
> fit on your root partition. But dammit, if you build with debug_info 
> and then strip the end result, you're just insane. [...]

So, to quote myself from 2 sentences ago:

> > vmlinux has no debuginfo. (Debuginfo takes longer to build so I 
> > generally build without it.)

I really meant it when I said I build without debuginfo! :)

So, when I build a kernel, such as with a regular 'make defconfig', 
the following happens in gdb:

  Reading symbols from /home/mingo/tip/vmlinux...(no debugging symbols found)...done.
  (gdb) list schedule+0x45
  No symbol table is loaded.  Use the "file" command.

Is there a way to resolve schedule+0x45 in a regular vmlinux? It was 
an honest question.

> [...] You made your build take ten times longer, use ten times more 
> diskspace, and then you throw it all away. Crazy.

It's so crazy that I in fact try to force off debuginfo for all my 
builds, even randconfig ones:

  config DEBUG_INFO
        bool "Compile the kernel with debug info"
        depends on DEBUG_KERNEL
        # too slow build in QA
        depends on 0

> So I don't think the symbol-less version is worth even worrying 
> about. You do want to build with KALLSYMS (or whatever the config 
> option is called), so that the symbolic name is worth something, but 
> once you have the symbolc name, you're good unless you did something 
> terminally stupid.

Hm, I have kallsyms on - it's a regular 'make defconfig':

  phoenix:~/linux/linux> grep KALL .config
  CONFIG_KALLSYMS=y

I might be doing something terminally stupid.

> Btw, we should make it harder to enable CONFIG_DEBUG_INFO. [...]

It's really not set:

  phoenix:~/linux/linux> grep DEBUG_INFO .config
  # CONFIG_DEBUG_INFO is not set

> [...] It's a f*cking pain. It's particularly nasty when you do "make 
> allmodconfig" and it enables debug-info and makes the build take 
> forever and waste diskspace - but nobody sane actually *boots* the 
> end result, so that debug info is all pointless.

I actually boot (almost-)allmod and allyesconfigs - still I disable 
DEBUG_INFO because it's such a strain on our planet's climate.

Thanks,

	Ingo

  parent reply	other threads:[~2014-01-28 19:48 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 16:47 [GIT PULL] x86/kaslr for v3.14 H. Peter Anvin
2014-01-20 22:54 ` Linus Torvalds
2014-01-20 23:00   ` H. Peter Anvin
2014-01-20 23:12   ` Linus Torvalds
2014-01-20 23:13     ` H. Peter Anvin
2014-01-21  9:00       ` Peter Zijlstra
2014-01-21 14:20         ` H. Peter Anvin
2014-01-21 14:39           ` Ingo Molnar
2014-01-21 14:51             ` H. Peter Anvin
2014-01-21 14:56               ` Ingo Molnar
2014-01-21 18:37           ` Kees Cook
2014-01-21 10:27     ` Ingo Molnar
2014-01-21 13:55       ` H. Peter Anvin
2014-01-21 14:03         ` Ingo Molnar
2014-01-21 14:05           ` H. Peter Anvin
2014-01-21 14:14             ` Ingo Molnar
2014-01-21 14:17               ` H. Peter Anvin
2014-01-21  5:18   ` Kees Cook
2014-01-23  9:39   ` Pavel Machek
2014-01-26 10:16 ` Richard Weinberger
2014-01-27  5:33   ` H. Peter Anvin
2014-01-27  6:49     ` Richard Weinberger
2014-01-27  6:51       ` H. Peter Anvin
2014-01-27  7:38         ` Ingo Molnar
2014-01-27  7:43           ` Ingo Molnar
2014-01-27  7:59           ` Richard Weinberger
2014-01-30 22:07         ` Vivek Goyal
2014-01-31 16:57           ` Kees Cook
2014-02-07 14:49             ` Vivek Goyal
2014-02-07 16:04               ` H. Peter Anvin
2014-02-07 16:24                 ` Vivek Goyal
2014-02-07 16:24                   ` Vivek Goyal
2014-02-07 23:16                   ` Dave Young
2014-02-07 23:16                     ` Dave Young
2014-02-07 23:20                     ` H. Peter Anvin
2014-02-07 23:20                       ` H. Peter Anvin
2014-02-07 23:28                       ` Dave Young
2014-02-07 23:28                         ` Dave Young
2014-02-07 19:07               ` H. Peter Anvin
2014-02-07 19:44                 ` Kees Cook
2014-02-07 19:44                   ` Kees Cook
2014-01-27  6:52       ` H. Peter Anvin
2014-01-27  7:34         ` Richard Weinberger
2014-01-27 17:05       ` Kees Cook
2014-01-27 17:20         ` Richard Weinberger
2014-01-27 17:24           ` Kees Cook
2014-01-28  6:28             ` Ingo Molnar
2014-01-28  8:25               ` Richard Weinberger
2014-01-28 15:55                 ` H. Peter Anvin
2014-01-28 16:25                   ` Richard Weinberger
2014-01-28 16:30                     ` H. Peter Anvin
2014-01-28 16:51                       ` Linus Torvalds
2014-01-28 17:05                         ` Ingo Molnar
2014-01-28 17:12                           ` Linus Torvalds
2014-01-28 17:24                             ` Richard Weinberger
2014-01-28 17:35                               ` Linus Torvalds
2014-01-28 17:52                                 ` Richard Weinberger
2014-01-28 17:56                                   ` Linus Torvalds
2014-01-28 18:54                                     ` Richard Weinberger
2014-01-28 19:48                             ` Ingo Molnar [this message]
2014-01-28 20:07                               ` Linus Torvalds
2014-01-28 20:15                                 ` Borislav Petkov
2014-01-28 20:25                                   ` Linus Torvalds
2014-01-28 20:28                                     ` Richard Weinberger
2014-01-28 20:38                                       ` H. Peter Anvin
2014-01-29  8:25                                         ` Ingo Molnar
2014-01-29 10:40                                           ` Borislav Petkov
2014-01-28 20:49                                     ` Borislav Petkov
2014-01-28 23:37                                       ` Borislav Petkov
2014-01-28 21:08                                     ` Dave Jones
2014-01-29  6:36                                       ` Mike Galbraith
2014-01-29  8:11                                 ` Ingo Molnar
2014-01-29  8:27                                   ` Mathias Krause
2014-01-30  9:23                                     ` Ingo Molnar
2014-01-30 18:15                                       ` 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=20140128194823.GA18702@gmail.com \
    --to=mingo@kernel.org \
    --cc=dinggnu@gmail.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=md@google.com \
    --cc=mingo@elte.hu \
    --cc=minipli@googlemail.com \
    --cc=richard@nod.at \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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.