All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: Paul Bolle <pebolle@tiscali.nl>, Nicholas Krause <xerofoify@gmail.com>
Cc: <hannes@cmpxchg.org>, <mhocko@suse.cz>,
	<akpm@linux-foundation.org>, <zlu@tilera.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] title: no lookup_page for if statement
Date: Mon, 14 Jul 2014 15:35:06 -0400	[thread overview]
Message-ID: <53C430EA.1060205@tilera.com> (raw)
In-Reply-To: <1405364357.13661.15.camel@x220>

On 7/14/2014 2:59 PM, Paul Bolle wrote:
> On Mon, 2014-07-14 at 14:49 -0400, Nicholas Krause wrote:
>> >This patch removes the if define statement for page_lookup in order
>> >to remove a fix me of this not being defined as of yet.
>> >
>> >Signed-off-by: Nicholas Krause<xerofoify@gmail.com>

Nicholas, you can't just enable this code; it will break the
build, since there is no lookup_address() symbol on tile.

I'd like to encourage you to look for more substantive kinds of
changes to submit to LKML.  This one and the last one (adding some
underscores to some obsolete symbols) both have ended up costing me
some time to look at and figure out what's actually going on, but
for no real value.  I suspect there may be "janitor" tasks that
are more useful if you are looking for small starting points
(Google for "linux kernel janitors").

That said I'm going to go ahead and check in the following change
which actually does work, now that my attention has been drawn here.

diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c
index 6c0571216a9d..7e884001ca6a 100644
--- a/arch/tile/mm/fault.c
+++ b/arch/tile/mm/fault.c
@@ -513,17 +513,14 @@ no_context:

         bust_spinlocks(1);

-       /* FIXME: no lookup_address() yet */
-#ifdef SUPPORT_LOOKUP_ADDRESS
-       if (fault_num == INT_ITLB_MISS) {
-               pte_t *pte = lookup_address(address);
+       if (fault_num == INT_ITLB_MISS && address >= PAGE_OFFSET) {
+               pte_t *pte = virt_to_kpte(address);

-               if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
-                       pr_crit("kernel tried to execute"
-                              " non-executable page - exploit attempt?"
-                              " (uid: %d)\n", current->uid);
+               if (pte && pte_present(*pte) && !pte_exec(*pte))
+                       pr_crit("kernel tried to execute non-executable page"
+                               " - exploit attempt? (uid: %d)\n",
+                               from_kuid(&init_user_ns, current_uid()));
         }
-#endif
         if (address < PAGE_SIZE)
                 pr_alert("Unable to handle kernel NULL pointer dereference\n");
         else

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


  parent reply	other threads:[~2014-07-14 19:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 18:49 [PATCH] title: no lookup_page for if statement Nicholas Krause
2014-07-14 18:59 ` Paul Bolle
2014-07-14 19:10   ` Nick Krause
2014-07-14 19:17   ` Andev
2014-07-14 19:35   ` Chris Metcalf [this message]
2014-07-17  0:50     ` Nick Krause

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=53C430EA.1060205@tilera.com \
    --to=cmetcalf@tilera.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=pebolle@tiscali.nl \
    --cc=xerofoify@gmail.com \
    --cc=zlu@tilera.com \
    /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.