mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Junjie Mao <eternal.n08@gmail.com>
Cc: Kees Cook <keescook@chromium.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86, kaslr: Prevent .bss from overlaping initrd
Date: Thu, 30 Oct 2014 23:05:41 +0800	[thread overview]
Message-ID: <20141030150541.GA17461@wfg-t540p.sh.intel.com> (raw)
In-Reply-To: <1414672901-29118-1-git-send-email-eternal.n08@gmail.com>

Hi Junjie,

I got one error with this script:

awk: arch/x86/tools/calc_reserved.awk: line 23: function strtonum never defined

Have you tried both gawk/mawk?

Thanks,
Fengguang

> diff --git a/arch/x86/tools/calc_reserved.awk b/arch/x86/tools/calc_reserved.awk
> new file mode 100644
> index 000000000000..2ca69682338a
> --- /dev/null
> +++ b/arch/x86/tools/calc_reserved.awk
> @@ -0,0 +1,21 @@
> +#!/bin/awk -f
> +#
> +# Calculate the amount of space that we have to reserve for .bss and .brk
> +# sections
> +#
> +# Usage:
> +# objdump -h a.out | awk -f calc_reserved.awk
> +
> +BEGIN {
> +	sections = "^.bss$|^.brk$"
> +	size = 0;
> +}
> +
> +/^ *[0-9]+ [a-z._]+ *[0-9a-f]+/ {
> +	if (match($2, sections))
> +		size += strtonum("0x" $3);
> +}
> +
> +END {
> +	printf("%d\n", size);
> +}
> --
> 1.9.3

  reply	other threads:[~2014-10-30 15:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 12:41 Junjie Mao
2014-10-30 15:05 ` Fengguang Wu [this message]
2014-10-30 17:25 ` Kees Cook
2014-10-30 17:27   ` Kees Cook
2014-10-31  7:20   ` Eternal
2014-10-31 16:14     ` Kees Cook
     [not found] <CAChTCPzJst_O8OSdCAHQWGpn-Zc_j4hkk_Cs5MF2xubcGoC5Fg@mail.gmail.com>
2014-10-30 19:09 ` Mika Penttilä
2014-10-31  7:25   ` Eternal

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=20141030150541.GA17461@wfg-t540p.sh.intel.com \
    --to=fengguang.wu@intel.com \
    --cc=eternal.n08@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®