Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4084864imj; Tue, 19 Feb 2019 15:08:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IaRjCLjnkr7Yt6voQ35/Xz9YaqmDKIlK81uBr/29gCVwpieB9SaqtLF3cnpHXr/0guGLlQx X-Received: by 2002:a17:902:12e:: with SMTP id 43mr33688265plb.31.1550617720128; Tue, 19 Feb 2019 15:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550617720; cv=none; d=google.com; s=arc-20160816; b=pi6GWGWJD/le3OfYRR2uV727j1LN1Xyko+PX/9bHsISRyBAlL1vYGaZ7gn4PnjV56W KVNe4G4ULeLNChz/cwNxlznOwyPgD4BfIkMGRAjB4VbpBAPe62tTkFdLeEJVnMpxyFBB xDI2rfFD4VybIY2NU0aghgD6D/RwWR6YY1hNxoHGCT6WlvxB1w7OlujLd3zSrJ6D3sBL ojqawLIojGN/YDdK4aNX7+yqNvEPrcBuodKhTD2n6FErgAcz6c4cnYe246rhAFm5Qpub iE1ijhotP4ig7ur4vuw9/3KeAb2UHXy+ORNbsquA0Y5fg84t4hUtl0wF8iQqCmSbf8U8 LYWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=P/fs6zOyXe9JFd5l3fQsMv+t2oZhxBGrBStbE8DaYMM=; b=imyFUqgG0/QDNIhiKmecVeqiIp9l2iNjvPU6GbADCLa1VIwiVJYpouo4xv+TjckITJ zk3khlTjR8G9dprymDPOEZRminWOvhRF3688kzzXNFY3wy1u9IObFbVUe66pSn+TBUDg d8MNx7ScAitd/RFfsbslpUVE98BQYx5oCr3dA2fPqiaWxeDLLp/TqLq+yHgQEUUKHQaQ UGj87Z9MeEi8rx9h6r9OdfkDj7uNW/TUa+IwgLFixEZCLLz8Gg25ZKkT43MU5dgZumtt 7ipsyWGBh2xTdc1tttkSLA/p87jYLSu5djxlrllEWlPD2lC5RPUZY/d7gjEYJwju8Nu3 Krmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RH5fyMYH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cs11si6994657plb.248.2019.02.19.15.08.24; Tue, 19 Feb 2019 15:08:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=RH5fyMYH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729873AbfBSXIE (ORCPT + 99 others); Tue, 19 Feb 2019 18:08:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:57360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbfBSXID (ORCPT ); Tue, 19 Feb 2019 18:08:03 -0500 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB42121479; Tue, 19 Feb 2019 23:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550617683; bh=HnR5xQVtBx1xF0ZwtokCVAfpmgoYis4uL2z6+a4uiHA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RH5fyMYH6A/OLCVyeceKHkpqCYPq8zoG7IdnIpVw283g6hiJk2eWapys8+fWK9lQU ZCN4ikh8JvcBiWH5piOdFkg964nPKGv6PdZXYhM1LFEuU7J/hvsn3NrhEKdvoVKHCs lm/0gCCgn7ZGDXr71YFPs8Sgk+IqSSqCoiJDltw4= Date: Tue, 19 Feb 2019 15:08:01 -0800 From: Eric Biggers To: keyrings@vger.kernel.org, David Howells Cc: Aaro Koskinen , linux-fscrypt@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KEYS: user: Align the payload buffer Message-ID: <20190219230800.GD12177@gmail.com> References: <20190115033716.18380-1-ebiggers@kernel.org> <20190207233509.GA125156@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190207233509.GA125156@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 07, 2019 at 03:35:09PM -0800, Eric Biggers wrote: > On Mon, Jan 14, 2019 at 07:37:16PM -0800, Eric Biggers wrote: > > From: Eric Biggers > > > > Align the payload of "user" and "logon" keys so that users of the > > keyrings service can access it as a struct that requires more than > > 2-byte alignment. fscrypt currently does this which results in the read > > of fscrypt_key::size being misaligned as it needs 4-byte alignment. > > > > Align to __alignof__(u64) rather than __alignof__(long) since in the > > future it's conceivable that people would use structs beginning with > > u64, which on some platforms would require more than 'long' alignment. > > > > Reported-by: Aaro Koskinen > > Fixes: 2aa349f6e37c ("[PATCH] Keys: Export user-defined keyring operations") > > Fixes: 88bd6ccdcdd6 ("ext4 crypto: add encryption key management facilities") > > Cc: stable@vger.kernel.org > > Signed-off-by: Eric Biggers > > --- > > include/keys/user-type.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/keys/user-type.h b/include/keys/user-type.h > > index e098cbe27db54..12babe9915944 100644 > > --- a/include/keys/user-type.h > > +++ b/include/keys/user-type.h > > @@ -31,7 +31,7 @@ > > struct user_key_payload { > > struct rcu_head rcu; /* RCU destructor */ > > unsigned short datalen; /* length of this data */ > > - char data[0]; /* actual data */ > > + char data[0] __aligned(__alignof__(u64)); /* actual data */ > > }; > > > > extern struct key_type key_type_user; > > -- > > 2.20.1 > > > > Ping. David, are you planning to apply this? > > - Eric Ping.