Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4666705ybb; Tue, 7 Apr 2020 11:56:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJCeOyFczaQK/2e4SwlGGeBNuzqM6PcdXCQlGJHgoCLfgqGacvM/nJ2NawrP+uH/decwZzP X-Received: by 2002:a4a:95a9:: with SMTP id o38mr3121364ooi.76.1586285816290; Tue, 07 Apr 2020 11:56:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586285816; cv=pass; d=google.com; s=arc-20160816; b=mu8ISyCXamilf/gWm4l5M73iIHLDm3S/vxUY8TC7C2FhuyZZ98C5tgtxJf41o2Zava LBy04SuF2m5uAteksxudgFglAz5gDXJHQopceqnhXxiZgg7pZQH3/AprKij0jtcvbXqk S5gKABq3TNZAMEo6YUqRaB0dhlRASTTEhmFokeHBzL8iowCVdBlMfFEwytuOrK3Tct5I 0aFtI5uCvtprKSb9rPZ2sAeeMlzlrC9eqqehsZb/3RHuE45/TBT12Y7ep2fwUpJGSInV TwHSz85x22AFhBUCFBRAG6bbtyUmw/NEfohLDzACqHiewVFc4m86uCEt7mprgZaJ5IzO 5EwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=7WuO9sdzmjuaGXvuSNzNJLVbOF6TRNvf4DembhgZDCY=; b=lQIGdKKQH/9bJ+D+EKVXf8pitnBEv3xbtYWPksqIWKAsQfi4EspTHaqibKAskdXCoV dVMY6xXF+bLuWytLeDyLaiv0nYBbVdc1XQuZ5fZfIvf5RXPYlqQVtSUBF3lZYuaOTUo5 cpZdWaWTy7qoPcNT8zm65ijncPmnj3pzWJeDMK0NB7DuebR4WyS7IbKrJkxucxR7B7m7 ssjs2ghEcBDLphjFtFYDyJgu03P+jacwPQE7ixwtmhUm1FluxzXMpcbuVX/hpQyImQbw ByIQyO0HvBkSI3eHC5A9rZ+mtNSxshLqDO/jbQp/GvDBJDV1KWnfpYN/5MQMr8Evsnyq +w9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DNOK2pf+; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f184si1025834oib.124.2020.04.07.11.56.32; Tue, 07 Apr 2020 11:56:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DNOK2pf+; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbgDGS4F (ORCPT + 99 others); Tue, 7 Apr 2020 14:56:05 -0400 Received: from mail-vi1eur05on2064.outbound.protection.outlook.com ([40.107.21.64]:6053 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726339AbgDGS4F (ORCPT ); Tue, 7 Apr 2020 14:56:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mIadzEamwwws7A+nKNumsSCtoV/N0REGB4nYpQOPTteaXd4o4KVotNRVvRQO7mpZQVNuYq74GX58Nx9fvd5JenBOa0HXiTFihBAInjghMV0A7uUjyCpVGxGzz3nEQIPV5K9q3fNn3sA0wqoEYLjO/NvvfiHxb3+ofKYg+w6rXjXSzP3zwnuhI0LYXbX0s7umvYrRQo58KCTxirHPxxYhVAYjVZNZlIoYSXHjNoFh4BxqK43XkAdix1RxY9hUfMnG8JYWB3NgnV1VT+7oRXwJxSrysP+VzNfBpjdFHettXP3qCy8l6Vzu7BuaefFE+iEO+veKWg7T5ZSJoJZlruRWBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7WuO9sdzmjuaGXvuSNzNJLVbOF6TRNvf4DembhgZDCY=; b=LTIkpVJuX0QErt7QkbvkmUkzyUqSXo0wFgrEksO+rIpnv0x+DUoX+sKbBCJ4B+Lph8yrRQd8kG0Kpf0DKkOzORyD9gz9gZZU604CtZPYKpzybnifc4B59ULBLr+ARJe1vbq4Ivupl2hMLR4eyXVuNStGZn8RsbjXU+z+1Qb1/1H/63EfU4vqY4dPzx7g5bkVc7ffofUDxQeryiyE6WXCswZwwsJ1zsAFtuUoIFCL3JelpoinSjiJd1H8/otURLnUg8AGaAldVqb7ddYzB+o4xcRkQgjKFrphZ7fis5CuzEG8kZvSPGspeGlq4gg2L/sw8k2rlDrD8i+mV9pdEnzw+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7WuO9sdzmjuaGXvuSNzNJLVbOF6TRNvf4DembhgZDCY=; b=DNOK2pf+WfayazeMfUHYOHxgFOnXQF2990oTku5Yvi3OdxXTAp1LAUWcwBjWdkkS51yiLqjCjuh9nkVddRJ542PXXMiTntWgYr/CRRnP+i9kmKXTqIbS/0fIDbIjEb+1MVnzFvkDpYG8Z1uoLh3ATSVuYb7ySXilxn/SkyxVF28= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=horia.geanta@nxp.com; Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com (2603:10a6:803:7::25) by VI1PR0402MB3469.eurprd04.prod.outlook.com (2603:10a6:803:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.16; Tue, 7 Apr 2020 18:55:59 +0000 Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::751e:7e8d:ed4:ef5f]) by VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::751e:7e8d:ed4:ef5f%7]) with mapi id 15.20.2878.021; Tue, 7 Apr 2020 18:55:59 +0000 Subject: Re: [PATCH] crypto: caam - fix the address of the last entry of S/G To: Iuliana Prodan , Herbert Xu , Aymen Sghaier Cc: "David S. Miller" , Silvano Di Ninno , Franck Lenormand , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx References: <1586275125-20571-1-git-send-email-iuliana.prodan@nxp.com> From: =?UTF-8?Q?Horia_Geant=c4=83?= Message-ID: <023d6704-557f-d701-a19b-2edcb002bf6c@nxp.com> Date: Tue, 7 Apr 2020 21:55:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 In-Reply-To: <1586275125-20571-1-git-send-email-iuliana.prodan@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM3PR03CA0066.eurprd03.prod.outlook.com (2603:10a6:207:5::24) To VI1PR0402MB3485.eurprd04.prod.outlook.com (2603:10a6:803:7::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.129] (84.117.251.185) by AM3PR03CA0066.eurprd03.prod.outlook.com (2603:10a6:207:5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.16 via Frontend Transport; Tue, 7 Apr 2020 18:55:58 +0000 X-Originating-IP: [84.117.251.185] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8ce690f5-18ec-44bc-96e6-08d7db254fa2 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3469:|VI1PR0402MB3469: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 036614DD9C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR0402MB3485.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(136003)(346002)(396003)(39850400004)(366004)(376002)(4744005)(81166006)(66556008)(16526019)(26005)(2906002)(66946007)(5660300002)(6666004)(110136005)(54906003)(8676002)(186003)(316002)(52116002)(8936002)(478600001)(16576012)(66476007)(6486002)(4326008)(86362001)(2616005)(31696002)(53546011)(31686004)(6636002)(36756003)(956004)(81156014)(966005);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZBVNi/+9wG5hZjQh5GR/EJD+XoR/PhGTNPzw4JKcrb9RTcrNw1Ji/b8wuCFbVDSpsrkC8i1lIn+xP75qMXPJ5GNczcjFqr+q7ubrjfHvpM+oQFEz117ryr/Mmhs4yYfpPPoPeg/vdmMcZrUFDghazHcb9oVOgSZ0O5o++nhUaRvjbC1M7atFT6dpsvgvZ5ZZnqq7lwr7tVAC7iFqz3plCiBXE49FpGlzNPc/GD/pPqcZJR27YLVkzZboponodkIyxU31gYTC+dsKiTMiL7vcHX6wIPb2TAYwNsBDkMeH26Zm8cZxNaMWLxuVr8iw1kujJraWF1+vkWBKbMv4pPTDRkVTjrZ4Y7t0h+X/NCpR8i7CiOkgaRSV1NjvPO/zdNt4uvb3ZuamY9lAywBJAfBRazZualGw1V6AOzrOVinC8g4F0GBF5NkQ+bJEGUDT5xGW1G8e7NzB+5hsy32wvH6StUX3pnCGFquh4ytnTtn2Oz7Kw8KZTXIqOEMJ6IqhmgSv//TqFrTESzrvkUDRyQS+/w== X-MS-Exchange-AntiSpam-MessageData: eZ+1ECNTfiJ1R4jwOuuuDDYDYQGfxvbSnWbkUyPoNjSdC1/9Ej3jtoK0qem+6Tuu8AGI2t4LAPcZ7XSjmqSHWnm6tS6soHH0yXuOna8YIfjcBWSXIXfSCBTBuFSO8gdh7qvey5NedsB9KUJzhxBlHw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ce690f5-18ec-44bc-96e6-08d7db254fa2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2020 18:55:59.4851 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PHAt1TdqcBA3JpbgR819IOKuuqV/D+qsygIQ4m6iMBrUbsWNuPh71NF3QI+OywHIe8Am5b4lxOEApHeLX8R45g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3469 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 4/7/2020 6:59 PM, Iuliana Prodan wrote: > For skcipher algorithms, the input, output HW S/G tables > look like this: [IV, src][dst, IV] > Now, we can have 2 conditions here: > - there is no IV; > - src and dst are equal (in-place encryption) and scattered > and the error is an "off-by-one" in the HW S/G table. > > This issue was seen with KASAN: > BUG: KASAN: slab-out-of-bounds in skcipher_edesc_alloc+0x95c/0x1018 > > Read of size 4 at addr ffff000022a02958 by task cryptomgr_test/321 > > CPU: 2 PID: 321 Comm: cryptomgr_test Not tainted > 5.6.0-rc1-00165-ge4ef8383-dirty #4 Non-public SHA1, dirty tree. Probably it's not reproducible without applying previous fixes? https://patchwork.kernel.org/project/linux-crypto/list/?series=266561 > Fixes: 334d37c9e263 ("crypto: caam - update IV using HW support") > Cc: # v5.3+ > Signed-off-by: Iuliana Prodan Reviewed-by: Horia Geantă Thanks, Horia