From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756711AbcE0Wvm (ORCPT ); Fri, 27 May 2016 18:51:42 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:36453 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753979AbcE0Wvl (ORCPT ); Fri, 27 May 2016 18:51:41 -0400 Date: Fri, 27 May 2016 15:51:37 -0700 (PDT) Message-Id: <20160527.155137.1489438133864702237.davem@davemloft.net> To: nix@esperi.org.uk Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, fweimer@redhat.com Subject: Re: [4.1.x -- 4.6.x and probably HEAD] Reproducible unprivileged panic/TLB BUG on sparc via a stack-protected rt_sigaction() ka_restorer, courtesy of the glibc testsuite From: David Miller In-Reply-To: <8760tz2n1j.fsf@esperi.org.uk> References: <87twhj3ag0.fsf@esperi.org.uk> <20160527.123731.2105286005500436503.davem@davemloft.net> <8760tz2n1j.fsf@esperi.org.uk> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 27 May 2016 15:51:39 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Alcock Date: Fri, 27 May 2016 22:44:56 +0100 > Good move. Segfaulting the process is fine! :) Any process that does > this sort of thing is clearly either terminally buggy, written by an > idiot who doesn't know what he's doing (i.e. my original patch) or > malicious. These all deserve SEGVs. > > (I still don't understand why this leads to spurious TLB faults, though. > Filling the userland CPU registers with garbage is bad, but should still > be reasonably harmless to the kernel, surely?) I'm trying to figure out the same thing myself. Even the unaligned stack pointer should be gracefully handled by the kernel, so I think it has to be some other element of the register state restore sequence. The one area that deserves auditing is %tstate. This is a privileged register which we treat partially as non-privileged. Specifically we allow the user to modify the condition codes and the %asi register which is encoded into here. But I just went over that a few times. We are really careful to mask and only change those specific fields. I'll keep plugging away at this and also play with your patches to reproduce the bug.