Received: by 10.223.164.202 with SMTP id h10csp189997wrb; Mon, 13 Nov 2017 05:01:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMa2uuj6sKay/zRiJ0PvgGCMxJzO83wjrIzz0ZpM6LxuydeCd4vNr2F0L5/3sx6reTCSMKia X-Received: by 10.101.100.216 with SMTP id t24mr8396485pgv.439.1510578118504; Mon, 13 Nov 2017 05:01:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510578118; cv=none; d=google.com; s=arc-20160816; b=drHvHTjMTcAohc4GVFrOOKlrOfHThZIzD3I5cKJKtbx7eWlL6U7UDHHHIRrYTKZT4K fqG4bBWgeijxoDD6xQ+EUIU3s5LDzNPIz7e8i8AneGjGvA+tMaCAe1qYBNy8r/jDnGlx dasJ++ZMsuj7atwIj81EVR+2uUxF+H90tqbtE5hrMf06Mk9sJJD2a43WVS5F9VuiM3Od mM6FnwL3FtmTJJjulxiZia0AwTMJqBN9CSFxU0lLJm0UY8BiyG3KjIrJSBhXYWO1bp50 y3acG/uzOcGuozSOlhGjllCmdIEUTA5eBedb2vaZapGAiOCy4NxUCvF3NVW/yjMmANAz 9V6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=eRabeMSNpI1shwc4P6NpIvitUVeEQQMzngU84mpJgws=; b=vDip53W67MtDZFPVErZYDWiO29n5F4pJIKMiUEVcqkqg25GrBmiisaPOCHgfeAAZGb jNzu3HHSeiY8gr2/eYk1T4JbLvI7A5CQZ+njR34nHIZPzAOt1AYTwua3dd78bumj5lGA TyhqckSgqLfjCeH7jFMTj+08EDzEeEljGaRpWB1H5lD3zfQyguxgLeUMlFtjlL/G69op Nh9MGTDG62YZtYF5X90ufKQFOCr63HrWakBJyeOZuaCUnDVetNQg1QgjDORCdYfwV449 ujRrID6xiy6BNXmhnGF7xvtY8i5j6BE9N17CXmxgjuhASennGDpOHFcT2fiTyoxBLxtF uGYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si13696610pgr.323.2017.11.13.05.01.45; Mon, 13 Nov 2017 05:01:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754538AbdKMNBA (ORCPT + 95 others); Mon, 13 Nov 2017 08:01:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50080 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbdKMNA4 (ORCPT ); Mon, 13 Nov 2017 08:00:56 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A1B499C; Mon, 13 Nov 2017 13:00:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gilad Ben-Yossef , Steffen Klassert , Sasha Levin Subject: [PATCH 4.9 35/87] IPsec: do not ignore crypto err in ah4 input Date: Mon, 13 Nov 2017 13:55:52 +0100 Message-Id: <20171113125618.514768556@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gilad Ben-Yossef [ Upstream commit ebd89a2d0675f1325c2be5b7576fd8cb7e8defd0 ] ah4 input processing uses the asynchronous hash crypto API which supplies an error code as part of the operation completion but the error code was being ignored. Treat a crypto API error indication as a verification failure. While a crypto API reported error would almost certainly result in a memcpy of the digest failing anyway and thus the security risk seems minor, performing a memory compare on what might be uninitialized memory is wrong. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ah4.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -270,6 +270,9 @@ static void ah_input_done(struct crypto_ int ihl = ip_hdrlen(skb); int ah_hlen = (ah->hdrlen + 2) << 2; + if (err) + goto out; + work_iph = AH_SKB_CB(skb)->tmp; auth_data = ah_tmp_auth(work_iph, ihl); icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); From 1583962726746367734@xxx Mon Nov 13 14:49:30 +0000 2017 X-GM-THRID: 1583962726746367734 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread