linux-mips
[Top] [All Lists]

Re: [PATCH] Fix offset2lib issue for x86*, ARM*, PowerPC and MIPS

To: Hector Marco Gisbert <hecmargi@upv.es>
Subject: Re: [PATCH] Fix offset2lib issue for x86*, ARM*, PowerPC and MIPS
From: Ingo Molnar <mingo@kernel.org>
Date: Tue, 24 Feb 2015 08:39:06 +0100
Cc: Kees Cook <keescook@chromium.org>, Andrew Morton <akpm@linux-foundation.org>, LKML <linux-kernel@vger.kernel.org>, ismael Ripoll <iripoll@upv.es>, "x86@kernel.org" <x86@kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, Linux MIPS Mailing List <linux-mips@linux-mips.org>, linuxppc-dev@lists.ozlabs.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=xfRLyw0EOFJ0tjKSuwyTCk4Y5dPzNWLcpNcpo8hKCrU=; b=JuoDp3q9TMncxrylb0Hoo42x2DSODlcYZ9IAZcBIC2PoK9qSFgwYxNZD4NyjgIXiPj Xal/SfGe8k38hECO0xJjKFXkzAvX7eTmCZ+OR0WsgYxwunJxB+33t2biXEfxkWKCX74p UZO/UI2/k6i5bY/59NgPV1Bu4PYgTnzkz754N8sFiRfen/thhZbbLItEs8CF4J5pR1Os pKYJvshzLgCj3sjIUc0I1I0i4X0uooJcxZWsjLRh8aScFh0+vsbYlSLtR3CZjMutqxO3 pdbfZWj5okTZgfIhNXPTGfFPA95G2hNkqnjLUsBB17tMtTjt0RNWE6hwvb5bmB7cwaCn 3mhw==
In-reply-to: <20150223205436.15133mg1kpyojyik@webmail.upv.es>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <54EB735F.5030207@upv.es> <CAGXu5j+SBRcj+BGyxEwUzgKsB2fdzNiPY37Q=JTsf=-QbGwoGA@mail.gmail.com> <20150223205436.15133mg1kpyojyik@webmail.upv.es>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.23 (2014-03-12)
* Hector Marco Gisbert <hecmargi@upv.es> wrote:

> +unsigned long randomize_et_dyn(unsigned long base)
> +{
> +     unsigned long ret;
> +     if ((current->personality & ADDR_NO_RANDOMIZE) ||
> +             !(current->flags & PF_RANDOMIZE))
> +             return base;
> +     ret = base + mmap_rnd();
> +     return (ret > base) ? ret : base;
> +}

> +unsigned long randomize_et_dyn(unsigned long base)
> +{
> +     unsigned long ret;
> +     if ((current->personality & ADDR_NO_RANDOMIZE) ||
> +             !(current->flags & PF_RANDOMIZE))
> +             return base;
> +     ret = base + mmap_rnd();
> +     return (ret > base) ? ret : base;
> +}

> +unsigned long randomize_et_dyn(unsigned long base)
> +{
> +     unsigned long ret;
> +     if ((current->personality & ADDR_NO_RANDOMIZE) ||
> +             !(current->flags & PF_RANDOMIZE))
> +             return base;
> +     ret = base + brk_rnd();
> +     return (ret > base) ? ret : base;
> +}

> +unsigned long randomize_et_dyn(unsigned long base)
> +{
> +     unsigned long ret;
> +     if ((current->personality & ADDR_NO_RANDOMIZE) ||
> +             !(current->flags & PF_RANDOMIZE))
> +             return base;
> +     ret = base + mmap_rnd();
> +     return (ret > base) ? ret : base;
> +}

> +unsigned long randomize_et_dyn(unsigned long base)
> +{
> +     unsigned long ret;
> +     if ((current->personality & ADDR_NO_RANDOMIZE) ||
> +             !(current->flags & PF_RANDOMIZE))
> +             return base;
> +     ret = base + mmap_rnd();
> +     return (ret > base) ? ret : base;
> +}

That pointless repetition should be avoided.

Thanks,

        Ingo

<Prev in Thread] Current Thread [Next in Thread>