From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEE51ECAAD5 for ; Mon, 5 Sep 2022 15:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237829AbiIEPPb (ORCPT ); Mon, 5 Sep 2022 11:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238328AbiIEPPP (ORCPT ); Mon, 5 Sep 2022 11:15:15 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1674CE53 for ; Mon, 5 Sep 2022 08:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=hGAWEj5ug3pAgXXAvAC/+a50JJGlY/TNhgeeuDwJHhQ=; b=WPdB6pfnNPeZo9LkVir7k8u3SQ 2RCT33N/PHUDry/162Ycgyf0Qnjp9FmYZkHgHH/qXeE3vk4Wv7oZtP3ckyXBHKYM/DR7C+Wv0kvcn KamXC7plCIgCsG+TCS704FPsiCsVkHGIappA+q5BTE5aGZH8bYMeBcY/BAszdb++62ux5HpJA5Gwa gDWDjZiuMNHv4J6zX978HQtK7Zwy2aamyMd8Nhd8Xjy9f/Y0tvlKF+VgBXNIIWYXnbbI6etruOJVJ wbHKPL7gQAsWgtsT2AuzeCMs7xxpZgm/3vDJvuGEiU9RYWxKuRPZBDM1UdJmc9jbOgA9dx1VwuJJk 317cwFhg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVDoa-009k5C-8K; Mon, 05 Sep 2022 15:15:08 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CEB70300244; Mon, 5 Sep 2022 17:15:07 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B628C2B973C23; Mon, 5 Sep 2022 17:15:07 +0200 (CEST) Date: Mon, 5 Sep 2022 17:15:07 +0200 From: Peter Zijlstra To: Masami Hiramatsu Cc: Borislav Petkov , Josh Poimboeuf , linux-kernel@vger.kernel.org, Steven Rostedt , Ingo Molnar Subject: Re: CONFIG_RETHUNK int3 filling prevents kprobes in function body Message-ID: References: <20220904230713.a461f8fe85329663226c755f@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 05, 2022 at 05:09:16PM +0200, Peter Zijlstra wrote: > On Sun, Sep 04, 2022 at 11:07:13PM +0900, Masami Hiramatsu wrote: > > Hi Peter, > > > > I found that the CONFIG_RETHUNK code (path_return) fills the unused bytes > > with int3 for padding. Unfortunately, this prevents kprobes on the function > > body after the return code (e.g. branch blocks placed behind the return.) > > Prior to that CONFIG_SLS would already use "ret; int3" FWIW, there is a compiler option pending to also stick an int3 after every unconditional jmp.