From patchwork Tue Aug 12 13:33:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 35257 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 396BE20540 for ; Tue, 12 Aug 2014 13:33:43 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m1sf45218507oag.11 for ; Tue, 12 Aug 2014 06:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=pToL+oX1axCnswYIodiRn5flG1sLMEC6e0ED3Y/buug=; b=m49O6mlG/IHDTseICkBHN98WseKsY5zXgOM2IUJjpONoXvy42OcOnNM/hm9OObgdMX DSAwAwDeaefhckh2QButkO57g7TtC+DMTU8qvlgqnRA8R76eNNoPpn4eZnUPDV4Kl18k YYTuHjQJR0rC+GpbxyfX51oKpc+vo8av4/rKPFBiS08VUn4G9hP9rGSy/JTZWIVbYMm4 QDANm0YP2WATwZytvDwHaQGM7lhYVtAIHdSCy4jJg6ZFHeBTEprv6foEvRs+HAYPUnqW eYMHslOTLc+TP6ziJUODu9ZHgUzn7EBSdP6QMZseDgWR3Vr5ujrKAws17IVSo5mCT4vO X5ZA== X-Gm-Message-State: ALoCoQmoxQyhc7utcCDUiEANaP7Yid9oREM48BRIMdOmL+jnAeZT0yea2Mg03wX3oeF1SDlUvd4m X-Received: by 10.42.119.82 with SMTP id a18mr17340600icr.19.1407850422828; Tue, 12 Aug 2014 06:33:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.47 with SMTP id w44ls125987qgw.95.gmail; Tue, 12 Aug 2014 06:33:42 -0700 (PDT) X-Received: by 10.221.68.135 with SMTP id xy7mr595137vcb.65.1407850422695; Tue, 12 Aug 2014 06:33:42 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id 3si2644230vct.27.2014.08.12.06.33.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 06:33:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so13276311vcb.31 for ; Tue, 12 Aug 2014 06:33:42 -0700 (PDT) X-Received: by 10.52.120.51 with SMTP id kz19mr459195vdb.95.1407850422615; Tue, 12 Aug 2014 06:33:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp249183vcb; Tue, 12 Aug 2014 06:33:41 -0700 (PDT) X-Received: by 10.180.73.235 with SMTP id o11mr33036137wiv.41.1407850421235; Tue, 12 Aug 2014 06:33:41 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id ib3si30846197wjb.175.2014.08.12.06.33.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 06:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of ard.biesheuvel@linaro.org designates 209.85.212.172 as permitted sender) client-ip=209.85.212.172; Received: by mail-wi0-f172.google.com with SMTP id n3so5859133wiv.5 for ; Tue, 12 Aug 2014 06:33:40 -0700 (PDT) X-Received: by 10.180.84.66 with SMTP id w2mr32223177wiy.27.1407850420812; Tue, 12 Aug 2014 06:33:40 -0700 (PDT) Received: from ards-macbook-pro.local ([109.227.30.102]) by mx.google.com with ESMTPSA id kw1sm9347231wjb.19.2014.08.12.06.33.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 06:33:40 -0700 (PDT) From: Ard Biesheuvel To: matthew.garrett@nebula.com, pjones@redhat.com Cc: leif.lindholm@linaro.org, ilias.biris@linaro.org, patches@linaro.org, Ard Biesheuvel Subject: [PATCH 2/5] unhook_system_services: bail on systab == NULL Date: Tue, 12 Aug 2014 15:33:19 +0200 Message-Id: <1407850402-11193-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1407850402-11193-1-git-send-email-ard.biesheuvel@linaro.org> References: <1407850402-11193-1-git-send-email-ard.biesheuvel@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Prevent unhook_system_services() from dereferencing a NULL systab, which may occur if hook_system_services() has never been called. Signed-off-by: Ard Biesheuvel --- replacements.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/replacements.c b/replacements.c index 48dc43785e2d..5dfa35567184 100644 --- a/replacements.c +++ b/replacements.c @@ -70,6 +70,9 @@ static EFI_HANDLE last_loaded_image; void unhook_system_services(void) { + if (!systab) + return; + systab->BootServices->Exit = system_exit; systab->BootServices->LoadImage = system_load_image; systab->BootServices->StartImage = system_start_image;