Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651264

Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are not RWX

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Heiko Carstens <heiko.carstens@de.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are not RWX
Date Fri, 26 May 2017 11:40:02 +0200
Message-ID <tLjSW-490-15@gated-at.bofh.it> (permalink)
References <tKEPN-2YG-33@gated-at.bofh.it> <tKIA3-5m6-43@gated-at.bofh.it> <tKJZ8-6lc-13@gated-at.bofh.it> <tKMWZ-8aU-5@gated-at.bofh.it> <tKUrw-4D7-3@gated-at.bofh.it> <tKWMG-5YF-15@gated-at.bofh.it> <tL53z-2KJ-7@gated-at.bofh.it> <tL75o-40J-7@gated-at.bofh.it> <tLhxL-2Oy-3@gated-at.bofh.it>
X-Original-To Thomas Gleixner <tglx@linutronix.de>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.24 (2015-08-30)
X-Tm-As-Gconf 00
X-Cbid 17052609-0040-0000-0000-000003B79843
X-Ibm-Av-Detection SAVI=unused REMOTE=unused XFE=unused
X-Cbparentid 17052609-0041-0000-0000-00002046E214
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:,, definitions=2017-05-26_06:,, signatures=0
X-Proofpoint-Spam-Details rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705260173
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 15
Organization linux.* mail to news gateway
X-Original-Cc Kees Cook <keescook@chromium.org>, "Luis R. Rodriguez" <mcgrof@kernel.org>, Steven Rostedt <rostedt@goodmis.org>, LKML <linux-kernel@vger.kernel.org>, "x86@kernel.org" <x86@kernel.org>, Masami Hiramatsu <mhiramat@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Michael Ellerman <mpe@ellerman.id.au>
X-Original-Date Fri, 26 May 2017 11:27:16 +0200
X-Original-Message-ID <20170526092716.GA14849@osiris>
X-Original-References <alpine.DEB.2.20.1705241459480.2201@nanos> <20170524134728.61a896c9@vmware.local.home> <alpine.DEB.2.20.1705242112210.2283@nanos> <20170524182547.5c085dc7@vmware.local.home> <alpine.DEB.2.20.1705250813190.2329@nanos> <alpine.DEB.2.20.1705251056410.1862@nanos> <20170525174604.GY8951@wotan.suse.de> <CAGXu5j+=-3Po0SoO8N=LMzSTEA1y6sFnMQwq71Nwiw4dAXeABA@mail.gmail.com> <alpine.DEB.2.20.1705260859290.1902@nanos>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1651264

Show key headers only | View raw


On Fri, May 26, 2017 at 09:03:13AM +0200, Thomas Gleixner wrote:
> > It seems like it really should. That would put it in a single place
> > and avoid this mistake again in the future. Does module_memfree() have
> > access to the allocation size, or does that need to get plumbed?
> 
> No, it doesn't. But the number of instances is pretty limited.
> 
> Btw, looking at BPF. It allocates memory via module_alloc() which means
> it's RWX. There is nothing in that BPF code which changes the permissions
> afterwards ....

For BPF you're probably referring to bpf_jit_binary_alloc()? Permissions
are changed with bpf_jit_binary_lock_ro() within each architecure backend.

Well, except for powerpc (cc'ed Michael).

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] x86/ftrace: Make sure that ftrace trampolines are not  RWX Thomas Gleixner <tglx@linutronix.de> - 2017-05-25 08:30 +0200
  [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are not  RWX Thomas Gleixner <tglx@linutronix.de> - 2017-05-25 11:00 +0200
    Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are  not RWX Steven Rostedt <rostedt@goodmis.org> - 2017-05-25 17:20 +0200
    Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are not  RWX "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-05-25 19:50 +0200
      Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are not RWX Kees Cook <keescook@chromium.org> - 2017-05-25 22:00 +0200
        Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are  not RWX Thomas Gleixner <tglx@linutronix.de> - 2017-05-26 09:10 +0200
          Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are not  RWX Heiko Carstens <heiko.carstens@de.ibm.com> - 2017-05-26 11:40 +0200
            Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are  not RWX Thomas Gleixner <tglx@linutronix.de> - 2017-05-26 12:00 +0200
            Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are not RWX Michael Ellerman <mpe@ellerman.id.au> - 2017-05-26 13:50 +0200
        Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are  not RWX Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-26 11:50 +0200
    Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are  not RWX Steven Rostedt <rostedt@goodmis.org> - 2017-05-26 15:40 +0200
      Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are  not RWX Steven Rostedt <rostedt@goodmis.org> - 2017-05-26 16:00 +0200
      Re: [PATCH V2] x86/ftrace: Make sure that ftrace trampolines are  not RWX Thomas Gleixner <tglx@linutronix.de> - 2017-05-26 16:00 +0200

csiph-web