Received: by 10.223.164.202 with SMTP id h10csp211665wrb; Mon, 13 Nov 2017 05:21:04 -0800 (PST) X-Google-Smtp-Source: AGs4zMaG45I0SzGA+g5XG0zZyLBAy772J9pCCrsnoKblEI1FimcGqNb1DFzr96r5ucalSGyOiyg6 X-Received: by 10.98.62.17 with SMTP id l17mr8485175pfa.83.1510579264525; Mon, 13 Nov 2017 05:21:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510579264; cv=none; d=google.com; s=arc-20160816; b=cazOmXcs6K13bfsLwj5JNDwGwBV+AkhQ6KTlLlpe+2tZV/U2+Mop/bfGHZbC2KqcQ7 aiWyw5b/Fjfm1ig+tvCNA8YMse449uu/YOrVt2LLDxo6j+FTw7gduK4LN3ABntJJQOoo pfnJWYxXdJ0p5fMcYenbuadcq8z4DgYzxuGohJjmNETtmG8oxskcDTNKPoieb1LP9GAE pSssQgQ1AYQMDRfEU7luyX6QuE6qFHiTWKHyJQQAMMlSEBVjNNpt3o0PYWAr/l+wnaKD EdEnCjHIGp3jSc8gSUmfHTNg6fcPWz0qEAAC3o80NmN0BhXTIq6zKy6oEc5U7C/2dDuI 5eog== 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=khuZ3eKC1vUjd1tjqSd/b8zVywU9l5NKXcbbzDmXvCk=; b=X6B+etbqPkcKrLa0PUbUIySt+5VHNVdDk4VZy+yIc7u8ak5g0sUchkC48KOeisuZ4B vqOgNfocuKdyd71oaHGkB7HUBN8kGNm9XDyMcaKMWUKIHN9+/ugsVF3SXK/4nxByIU2q 2Qw2VUAfroiudzLQOaVK9wVEOsbxp2cq3XBltOISh9bUlCvMAVzzn1ZGzG6Nr5ERYpT9 pdH4Q2nwTgbCjdF7JKuDVUatZDEYsgxvOu7L3yVsqEU3ZmbrFkkQKBho7/pncyBYY97g 3wTfOCBUhI80MTgK1u9q+/JE6fr8Y4Pz6BrotT6KlEa9zLyK/vh2ppiRrn2ZMQr7vuQ2 EkWw== 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 p20si3400421pgc.387.2017.11.13.05.20.51; Mon, 13 Nov 2017 05:21:04 -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 S1754780AbdKMNCF (ORCPT + 95 others); Mon, 13 Nov 2017 08:02:05 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50432 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754768AbdKMNB7 (ORCPT ); Mon, 13 Nov 2017 08:01:59 -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 CDA6DAB5; Mon, 13 Nov 2017 13:01:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Ryabinin , Herbert Xu Subject: [PATCH 4.9 58/87] crypto: x86/sha1-mb - fix panic due to unaligned access Date: Mon, 13 Nov 2017 13:56:15 +0100 Message-Id: <20171113125620.689163026@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: Andrey Ryabinin commit d041b557792c85677f17e08eee535eafbd6b9aa2 upstream. struct sha1_ctx_mgr allocated in sha1_mb_mod_init() via kzalloc() and later passed in sha1_mb_flusher_mgr_flush_avx2() function where instructions vmovdqa used to access the struct. vmovdqa requires 16-bytes aligned argument, but nothing guarantees that struct sha1_ctx_mgr will have that alignment. Unaligned vmovdqa will generate GP fault. Fix this by replacing vmovdqa with vmovdqu which doesn't have alignment requirements. Fixes: 2249cbb53ead ("crypto: sha-mb - SHA1 multibuffer submit and flush routines for AVX2") Signed-off-by: Andrey Ryabinin Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S +++ b/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S @@ -157,8 +157,8 @@ LABEL skip_ %I .endr # Find min length - vmovdqa _lens+0*16(state), %xmm0 - vmovdqa _lens+1*16(state), %xmm1 + vmovdqu _lens+0*16(state), %xmm0 + vmovdqu _lens+1*16(state), %xmm1 vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A} vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C} @@ -178,8 +178,8 @@ LABEL skip_ %I vpsubd %xmm2, %xmm0, %xmm0 vpsubd %xmm2, %xmm1, %xmm1 - vmovdqa %xmm0, _lens+0*16(state) - vmovdqa %xmm1, _lens+1*16(state) + vmovdqu %xmm0, _lens+0*16(state) + vmovdqu %xmm1, _lens+1*16(state) # "state" and "args" are the same address, arg1 # len is arg2 @@ -235,8 +235,8 @@ ENTRY(sha1_mb_mgr_get_comp_job_avx2) jc .return_null # Find min length - vmovdqa _lens(state), %xmm0 - vmovdqa _lens+1*16(state), %xmm1 + vmovdqu _lens(state), %xmm0 + vmovdqu _lens+1*16(state), %xmm1 vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A} vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C} From 1583956325774625594@xxx Mon Nov 13 13:07:46 +0000 2017 X-GM-THRID: 1583956325774625594 X-Gmail-Labels: Inbox,Category Updates,HistoricalUnread