linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tirado <mtirado418@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: eBPF / seccomp globals?
Date: Thu, 10 Sep 2015 23:22:23 +0000	[thread overview]
Message-ID: <CAMkWEXMm=vRoxyzfODQsg9kvMfYs9ENw=dn+2cvPMP-i7_WzZg@mail.gmail.com> (raw)
In-Reply-To: <CAMkWEXM2pyuOx8VhGLQUQU=7jLuB4ifNydu4egK2k-HnWf6h1w@mail.gmail.com>

Sorry for spamming you guys with my ugly, poorly formatted hack.
I had to change something due to my shallow knowledge of how
multiprocessors / multiple threads sharing a filter would behave.
There may have been a possibility for the deferred integer to rollover
and ruin everything?  just in case someone tries to use it....



From: Michael R Tirado <mtirado418@gmail.com>
Date: Thu, 10 Sep 2015 23:06:55 +0000
Subject: [PATCH 2/2] changed to signed integer, due to multiprocesor
 uncertainty.

---
 kernel/seccomp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index dc2a5af..e39e8c2 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -58,7 +58,7 @@ struct seccomp_filter {
     atomic_t usage;
     struct seccomp_filter *prev;
     struct bpf_prog *prog;
-    unsigned int deferred;
+    int deferred;
 };

 /* Limit any path through the tree to 256KB worth of instructions. */
@@ -198,7 +198,7 @@ static u32 seccomp_run_filters(struct seccomp_data *sd)
      */
     for (; f; f = f->prev) {
         u32 cur_ret;
-        if (unlikely(f->deferred)) {
+        if (unlikely(f->deferred > 0)) {
             --f->deferred;
             continue;
         }
-- 
1.8.4

  reply	other threads:[~2015-09-10 23:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04  1:01 eBPF / seccomp globals? Michael Tirado
2015-09-04  3:17 ` Alexei Starovoitov
2015-09-04 14:03   ` Tycho Andersen
2015-09-04  4:01 ` Kees Cook
2015-09-04 20:29   ` Michael Tirado
2015-09-04 20:37     ` Kees Cook
2015-09-10 21:55       ` Michael Tirado
2015-09-10 23:22         ` Michael Tirado [this message]
2015-09-29 23:44         ` Kees Cook
2015-09-30  0:07           ` Andy Lutomirski
2015-10-06 16:00           ` Michael Tirado

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='CAMkWEXMm=vRoxyzfODQsg9kvMfYs9ENw=dn+2cvPMP-i7_WzZg@mail.gmail.com' \
    --to=mtirado418@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;
as well as URLs for NNTP newsgroup(s).