From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkGYv-0001ke-Hz for qemu-devel@nongnu.org; Tue, 13 May 2014 13:32:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkGYt-0005FC-Un for qemu-devel@nongnu.org; Tue, 13 May 2014 13:32:21 -0400 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:50652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkGYt-0005F8-R6 for qemu-devel@nongnu.org; Tue, 13 May 2014 13:32:19 -0400 Received: by mail-qg0-f50.google.com with SMTP id z60so824232qgd.23 for ; Tue, 13 May 2014 10:32:19 -0700 (PDT) Sender: Richard Henderson Message-ID: <53725719.9020305@twiddle.net> Date: Tue, 13 May 2014 10:32:09 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1399356506-5609-1-git-send-email-edgar.iglesias@gmail.com> <1399356506-5609-19-git-send-email-edgar.iglesias@gmail.com> In-Reply-To: <1399356506-5609-19-git-send-email-edgar.iglesias@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 18/22] target-arm: A64: Generalize update_spsel for the various ELs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" , qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: alex.bennee@linaro.org, rob.herring@linaro.org, peter.crosthwaite@xilinx.com, john.williams@xilinx.com, agraf@suse.de On 05/05/2014 11:08 PM, Edgar E. Iglesias wrote: > - /* EL0 has no access rights to update SPSel, and this code > - * assumes we are updating SP for EL1 while running as EL1. > - */ > - assert(arm_current_pl(env) == 1); > + /* EL0 has no access rights to update SPSel. */ > + assert(cur_el >= 1 && cur_el <= 3); The old comment makes it clear that we're not supposed to get here when running as EL0. The new comment makes this look like a possible DoS attack. r~