Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2345608ybh; Fri, 24 Jul 2020 10:25:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/V4NgApS8Y9B/HtSmYR31ZLPICNtyPuQKuWI51fVXUNIVacvWLKFEQzOtfc+r+p4kNNsf X-Received: by 2002:a17:906:b15:: with SMTP id u21mr10395985ejg.520.1595611521780; Fri, 24 Jul 2020 10:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595611521; cv=none; d=google.com; s=arc-20160816; b=mRSlgPZnv2jXcyUMZPjxHZwPMQmf87lw0LBFT+0AxuTiuLvzcZzEnD2ny4933Abi9i 5GKxy3NzvAbetLaGSLCabq8dtSGh2KtlMrKc4pzwYhh+HivozAj7z5GuXlMb9M61Ko/s ULQaA/d7dzzp/zeYcLjScCdJsO429Bsyq6tZ+kcJWCFElfPqQmtpmrjHFcraPISWKAE4 gHX+IgSy7VED1oxBIEBrF5WGEm/SQELDZFBWX+HG26RAp+JUMGvAMhbS+9BoSQNMZFFi u23p5Q1uvrHGHlmqzrtVsos5zZGr+5u0XRcTY8vLKSifqayo6RnvwYiA0WzoYyZwDEhO leHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature; bh=CKyR8EMqxeOXVY/iOMNddyLu0IDddolO4j2t8BjxTkY=; b=xjvHnxPqh1vNP3Fs1q+Yj5MXPH+xwPRHwkthXvAQg1cltW3w5HQCqMGL8c6XjCD+yL 1lzdtRcG9pantUahlY4UqEa0Ys967czwEIJdvu9Z5hbYAX4Fs6HpA5vs99bTqHnzxoUL 1CUnjeV3OjMSaYnuacBqZfprffuwh7lJkDsQyQOe0ZsVjD0p5Fc7bamgpA6yaeqxY9N/ 0Wvv+MmsntEFTzU+QpeOGaLGcqUnND+H4DIKkHr8mfoj6q+6OAAGKbq/lNZX743SjyHn 8HOztCDtfxAeuphwAz7myLmvX3wPsWpw+vgEgviYYjWZdx9i/V3Dw4pR4WpRJpldxMCV qQzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=PwH8YjZt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si959120ejb.374.2020.07.24.10.25.00; Fri, 24 Jul 2020 10:25:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=PwH8YjZt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbgGXRYt (ORCPT + 99 others); Fri, 24 Jul 2020 13:24:49 -0400 Received: from mout.gmx.net ([212.227.15.18]:52945 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726625AbgGXRYs (ORCPT ); Fri, 24 Jul 2020 13:24:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1595611445; bh=CKyR8EMqxeOXVY/iOMNddyLu0IDddolO4j2t8BjxTkY=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=PwH8YjZtZl0FG2VXzt0NRxkf+yHG8ZnJjsMFJCDcy5drJtOK7YzmvviUy9Xn4/Pcm 8ggOSOCFIGbBxdeO1yAbqZn5gaO2/LSnjWgtkFsoFqpL0jF8UXpE/lssCVtoRQZKxK yB0agzD+BrpSYEokV1+zZnRwQ1iG48XY0JeQicAI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ubuntu ([79.150.73.70]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MmlXA-1khkQd24RS-00jpgg; Fri, 24 Jul 2020 19:24:05 +0200 Date: Fri, 24 Jul 2020 19:24:03 +0200 From: Oscar Carter To: Steven Rostedt Cc: Oscar Carter , Ingo Molnar , Kees Cook , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Jann Horn Subject: Re: [PATCH v2 2/2] kernel/trace: Remove function callback casts Message-ID: <20200724172403.GC3123@ubuntu> References: <20200719155033.24201-1-oscar.carter@gmx.com> <20200719155033.24201-3-oscar.carter@gmx.com> <20200721140545.445f0258@oasis.local.home> <20200724161921.GA3123@ubuntu> <20200724123528.36ea9c9e@oasis.local.home> <20200724171418.GB3123@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200724171418.GB3123@ubuntu> User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: V03:K1:f286teVwMCObcAo1c+vNRctWHP3RuMXVbuBShTSuZg/kMkr9sgf g/pnMennfIcHSP/WROtDP9H8l+xTgIFdWyxKHjkmZZvCOxWoi6ZimtXAhPf/zD6IF/oAO3L fyBvqTR0VXVtNDH6ZXvqbq052+qrDnmzEnTryU6nEuQV21jpn8uRB9RYUb2/DAQ/z2gleAu fMG0/Ba93qgZ4tYsit/zw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:3l9mO4VbPNw=:K+2uWVyPPAP91pFroHuFd8 yjNMolsXRIXRWhIXSkKHuSVAwI7pZ7ZUHJMuslnlJCluECZWYeCjujLJsWOgjIMuRVdxQ2o+0 Qhk0yDqDbLK4dvciHEDYJ13up+TJbl9iW30utK4lrlMIYQr+TLpWTWssL/pYR4t/xApbazcjl rxtJU/N2Yjs12g8Oo9TDqKAv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IlfJao+McrfL7NqcKW7Tnw== Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steven, On Fri, Jul 24, 2020 at 07:14:18PM +0200, Oscar Carter wrote: > On Fri, Jul 24, 2020 at 12:35:28PM -0400, Steven Rostedt wrote: > > On Fri, 24 Jul 2020 18:19:21 +0200 > > Oscar Carter wrote: > > > > > > The linker trick is far less intrusive, and I believe less error p= rone. > > > > > > If we use the linker trick, the warning -Wcast-function-type dissape= ars, > > > but in a way that makes impossible to the compiler to get the necess= ary > > > info about function prototypes to insert the commented check. As far= I > > > know, this linker trick (redirection of a function) is hidden for th= e > > > CFI build. > > > > > > So, in my opinion, the linker trick is not suitable if we want to pr= otect > > > the function pointers of the ftrace subsystem against an attack that > > > modifiy the normal flow of the kernel. > > > > The linker trick should only affect architectures that don't implement > > the needed features. I can make it so the linker trick is only applied > > to those archs, and other archs that want more protection only need to > > add these features to their architectures. > > > > It's much less intrusive than this patch. > > Sorry, but I don't understand your proposal. What features an arch need = to > add if want the CFI protection? Typo correction. Sorry, but I don't understand your proposal. What features does an arch ne= ed to add if want the CFI protection? > > > > > -- Steve > Thanks, Oscar Carter