Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2942368ybi; Mon, 17 Jun 2019 13:11:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRN2eaKKxYHgu4CbqmfPyqOjfFoQ6VkcmkiOU+Zf9PzmvRX0s4Y2gLdJtNXi6gnVTLyxlN X-Received: by 2002:a62:e815:: with SMTP id c21mr74796579pfi.244.1560802213153; Mon, 17 Jun 2019 13:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560802213; cv=none; d=google.com; s=arc-20160816; b=qN30TgCrgIqBug54SSXObjvndGK0vgAJjmz17BNMGDzp+JyKVBkaw2DKIGBEUv5JJK PzmLjBARxhm+k2oS+syETDnAnNOxX3i7M8EmFcdMtqmljrnyHEWW2JpnNxISJsGouKic oYopB/6FTxDTmaAWQ7mS/z9LTfJkY4l+Ooy02JPsRq7tzvVO6wc5p47kdFOE7uGPa+G3 jGfSpscN2mTrPw7YAtM7LwefZBIRdbDO/SbqXbrBAbmhorXvyE6rjad5VVgNe/V7avtZ ElJbH5V+50QFGUoQmbMOsjJaCJ7eK8rXp/tuljFzNtnlUqpcV/iAh5iLBKvxCw6pG7g/ l9VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=zmogzjeNfdvyQHIHPql3oMPQQB85wlj8S3ap4Uhkqn8=; b=rTpsY7z4f6Otk8vSLXYRYeVbjg6HNHUADTvippZ0HZktOqejmf4npBje6PMrenK0K3 +ioRyP+oGVQYPumcHGrU9DOQkqn4KZb7Uy0ayNtmgCqYewK2Y5T/feGA0fReE7nl46YN VSPt+D2KuToDWMIefVQrUL2PoUZ91LWplgAK6f528cOg6MYBqvtYaG0o2yxpdSFVqp0Q a/46jLYw6Zus1ROeUd9ewjfxLeJJROjUIqveXwUVwALKjoXzzD9Yf6Z10iZmt19MsS4h It2s6sakUAGpzSkFGE+ZxzlrP70RmyAQd6IQgIUFwbIsg6OrdQhC57b2deXoJh/CuVKF 8d7A== 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 l8si164679pjq.56.2019.06.17.13.09.58; Mon, 17 Jun 2019 13:10:13 -0700 (PDT) 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 S1728958AbfFQUIW (ORCPT + 99 others); Mon, 17 Jun 2019 16:08:22 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39616 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfFQUIU (ORCPT ); Mon, 17 Jun 2019 16:08:20 -0400 Received: by mail-qt1-f195.google.com with SMTP id i34so7097299qta.6; Mon, 17 Jun 2019 13:08:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zmogzjeNfdvyQHIHPql3oMPQQB85wlj8S3ap4Uhkqn8=; b=XsFyt+CT9YA6cKZgB5FzO7KCsMonBolkQ0HF5RYA++rqoEoi/De5is9wPZT/tX1wpc 8PMXFD38FNjfEDNsdMx+6yOD6M0qkLSPouFqD+TKj6NvYZNkFm/zncKFoZ8+hJb2pjHj NNTx2zwSV6/cEhZeGv5tgAwncJVY96FfH/L7+6bUV+kiBfS4MxYDxrN8CIkSB3RA0PQM UlMf1f1LX+D/MX0H6O37ofVuB/3cmrkMHIBCDMcMrWZ/6oCDHejw53xKT2uOOUUZyg4V 3ps1ODQLukMlf6siHdIkrbjVaYYHOSZ/a7Ew/phRiQhVUcLODc9qjCXfZsZ1O21pVkY6 aJOA== X-Gm-Message-State: APjAAAUvS21xsZZy1s6rSKH3FVzV9WQVW1pp4p56uyDVgTYLnMYXOo8O +4LVb294H7G85UBFna2UM9bbX9BTAVaAo/JjcwA= X-Received: by 2002:ac8:3485:: with SMTP id w5mr18793022qtb.142.1560802099413; Mon, 17 Jun 2019 13:08:19 -0700 (PDT) MIME-Version: 1.0 References: <20190617115838.2397872-1-arnd@arndb.de> <1560786951.4072.103.camel@linux.ibm.com> <1560794826.4072.169.camel@linux.ibm.com> In-Reply-To: <1560794826.4072.169.camel@linux.ibm.com> From: Arnd Bergmann Date: Mon, 17 Jun 2019 22:08:02 +0200 Message-ID: Subject: Re: [PATCH] ima: dynamically allocate shash_desc To: Mimi Zohar Cc: Dmitry Kasatkin , James Morris , "Serge E. Hallyn" , Jarkko Sakkinen , Stefan Berger , linux-integrity@vger.kernel.org, LSM List , Linux Kernel Mailing List 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 On Mon, Jun 17, 2019 at 8:08 PM Mimi Zohar wrote: > > On Mon, 2019-06-17 at 11:55 -0400, Mimi Zohar wrote: > > On Mon, 2019-06-17 at 13:20 +0200, Arnd Bergmann wrote: > > > On 32-bit ARM, we get a warning about excessive stack usage when > > > building with clang. > > > > > > security/integrity/ima/ima_crypto.c:504:5: error: stack frame size > > > of 1152 bytes in function 'ima_calc_field_array_hash' [-Werror,- > > > Wframe-larger-than=] > > > > I'm definitely not seeing this. Is this problem a result of non > > upstreamed patches? For sha1, currently the only possible hash > > algorithm, I'm seeing 664. You won't see it with gcc, only with clang in some randconfig builds, I suppose only when KASAN is enabled. > Every time a measurement is added to the measurement list, the memory > would be allocated/freed. The frequency of new measurements is policy > dependent. For performance reasons, I'd prefer if the allocation > remains on the stack. Is there a way to preallocate the shash_desc instead? That would avoid the overhead. Arnd