From patchwork Fri May 29 17:54:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 11579441 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 490D91392 for ; Fri, 29 May 2020 17:54:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38E822073B for ; Fri, 29 May 2020 17:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbgE2RyM (ORCPT ); Fri, 29 May 2020 13:54:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:51589 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbgE2RyL (ORCPT ); Fri, 29 May 2020 13:54:11 -0400 IronPort-SDR: Wp0u2amyvwxwXM+sWANwiPMJdvxGXZlgTQAbbOFQIXY5qX54vJeeJoSVATz754zV/IzY6STv6z e/2dZ6YiUPBA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2020 10:54:08 -0700 IronPort-SDR: Oc4SX26W9PjIkh6aX5ts6cSrZR/FrvO0tUsnzDnob2Z5MhSPJvdd4CDGSfRrMnncxFQ8pCLFdY 0Mcfi4MJXI+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,449,1583222400"; d="scan'208";a="271292321" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.152]) by orsmga006.jf.intel.com with ESMTP; 29 May 2020 10:54:08 -0700 From: Sean Christopherson To: Jarkko Sakkinen Cc: linux-sgx@vger.kernel.org Subject: [PATCH for_v31 1/6] x86/sgx: Fix inadvertant early return from sgx_ioctl() Date: Fri, 29 May 2020 10:54:02 -0700 Message-Id: <20200529175407.2109-2-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200529175407.2109-1-sean.j.christopherson@intel.com> References: <20200529175407.2109-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Sender: linux-sgx-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org Set 'ret' instead of returning if the enclave is dead in sgx_ioctl(), otherwise the goto that was added doesn't take effect. Signed-off-by: Sean Christopherson --- arch/x86/kernel/cpu/sgx/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c index ec5a0f017014b..2019ee1dc0b3e 100644 --- a/arch/x86/kernel/cpu/sgx/ioctl.c +++ b/arch/x86/kernel/cpu/sgx/ioctl.c @@ -790,7 +790,7 @@ long sgx_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) return -EBUSY; if (encl_flags & SGX_ENCL_DEAD) { - return -EFAULT; + ret = -EFAULT; goto out; }