Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1104943pxk; Fri, 25 Sep 2020 06:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcmu3C1tQXk4S9idE4eRTPWh8Aln8DKwMEvUEL+Z5yLobL3hAVse5M7xTry14Cb/u29yhl X-Received: by 2002:a17:906:cd0d:: with SMTP id oz13mr2676756ejb.212.1601040391650; Fri, 25 Sep 2020 06:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601040391; cv=none; d=google.com; s=arc-20160816; b=JwYbpk2UqbdoJD+SOKy8+18JDABSFnl3cM9IPHvVGkMKCLfgBtLfs9u8mUuPMcUe4D f2cgAKcRQsXQKQw5NsDrOZ5tbhaDjbLB+KIRp6rr9QorfVZJU1t74LTuyq+3KNO9nBhY /zQDmD7I0/RFmaxsPLS2TW0jUvjUWlseIMgQl9FSySlIU88E1x9IroqvKTd2O4rE8lAm qp7Sv2io3wkqxNw46d0xDFXpTpAl8mlo0+LT+y6ce6fdYKaig2r737Qwjl95cnkM7BeT 5xK++MgceyKh5saEdOSfZPRuxlacYkKXwd4NQRh3uYUsl1Smr6PyY238OE5FRw1zrqhG s4Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=cCxWca88tZUsyEhEHqBKJp0wv8mvOmhQ0OndQBEYp4A=; b=h4XKWZJU4id79qCFNySkesiCTwQuH4QIvGrYDt9y9WL34oz2IPHaDqjwxBWzafjePt 4GSYJjdy3QrId4DONiGmi0UWESzEiMg7c0FPLO2FCnxYO3UG5b5hQSTsNEkvQYFlWJCJ BoAzHeNUf8xYMuk1akjOCfF09IYtjNdciPmVt5S8oe5Epp+O+p2LIJ2XuNEnDDsMRxJ5 W/ak8q3J1dtnb+pY/oeBLbBoNOzM1Cz+T/IAdZj1xWnXuZjwqkJ4Enwgd3dY+2SXL1VD 8DeCseoiO3PKOAB4zUGca/gxMUa2SJLhr9plMWr4kLDwIf2vH6os2diJgD2qHH7gQ5ez tSsg== ARC-Authentication-Results: i=1; mx.google.com; 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 a3si1753132ejt.659.2020.09.25.06.26.08; Fri, 25 Sep 2020 06:26:31 -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; 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 S1728922AbgIYNXp (ORCPT + 99 others); Fri, 25 Sep 2020 09:23:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:44704 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728643AbgIYNXo (ORCPT ); Fri, 25 Sep 2020 09:23:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6B7F9B509; Fri, 25 Sep 2020 13:07:01 +0000 (UTC) Date: Fri, 25 Sep 2020 15:06:55 +0200 (CEST) From: Miroslav Benes To: Kristen Carlson Accardi cc: keescook@chromium.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, arjan@linux.intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, rick.p.edgecombe@intel.com, live-patching@vger.kernel.org Subject: Re: [PATCH v5 00/10] Function Granular KASLR In-Reply-To: <20200923173905.11219-1-kristen@linux.intel.com> Message-ID: References: <20200923173905.11219-1-kristen@linux.intel.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kristen, On Wed, 23 Sep 2020, Kristen Carlson Accardi wrote: > Function Granular Kernel Address Space Layout Randomization (fgkaslr) > --------------------------------------------------------------------- > > This patch set is an implementation of finer grained kernel address space > randomization. It rearranges your kernel code at load time > on a per-function level granularity, with only around a second added to > boot time. I ran live patching kernel selftests on the patch set and everything passed fine. However, we also use not-yet-upstream set of tests at SUSE for testing live patching [1] and one of them, klp_tc_12.sh, is failing. You should be able to run the set on upstream as is. The test uninterruptedly sleeps in a kretprobed function called by a patched one. The current master without fgkaslr patch set reports the stack of the sleeping task as unreliable and live patching fails. The situation is different with fgkaslr (even with nofgkaslr on the command line). The stack is returned as reliable. It looks something like [<0>] __schedule+0x465/0xa40 [<0>] schedule+0x55/0xd0 [<0>] orig_do_sleep+0xb1/0x110 [klp_test_support_mod] [<0>] swap_pages+0x7f/0x7f where the last entry is not reliable. I've seen kretprobe_trampoline+0x0/0x4a and some other symbols there too. Since the patched function (orig_sleep_uninterruptible_set) is not on the stack, live patching succeeds, which is not intended. With kprobe setting removed, all works as expected. So I wonder if there is still some issue with ORC somewhere as you mentioned in v4 thread. I'll investigate more next week, but wanted to report early. Regards Miroslav [1] https://github.com/lpechacek/qa_test_klp