Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbcLLW2b (ORCPT ); Mon, 12 Dec 2016 17:28:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52116 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbcLLW2a (ORCPT ); Mon, 12 Dec 2016 17:28:30 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <8c273c9c41f51b34bb3115086f1d776895580637.1481575835.git.luto@kernel.org> To: Andy Lutomirski Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, keyrings@vger.kernel.org, Eric Biggers , linux-crypto@vger.kernel.org, Herbert Xu , Stephan Mueller Subject: Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5943.1481581706.1@warthog.procyon.org.uk> Date: Mon, 12 Dec 2016 22:28:26 +0000 Message-ID: <5944.1481581706@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 12 Dec 2016 22:28:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 376 Lines: 14 Andy Lutomirski wrote: > +static const char zero_pad[16] = {0}; Isn't there a global page of zeros or something that we can share? Also, you shouldn't explicitly initialise it so that it stays in .bss. > - sg_set_buf(&sg_out[1], pad, sizeof pad); > + sg_set_buf(&sg_out[1], zero_pad, sizeof zero_pad); Can you put brackets on the sizeof? Thanks, David