[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YOcbkagxoPS2AreG@kroah.com>
Date: Thu, 8 Jul 2021 17:36:49 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Matthew Weber <matthew.weber@...lins.com>
Cc: sashal@...nel.org, Sean Young <sean@...s.org>,
Mauro Carvalho Chehab <mchehab@...pensource.com>,
Stefani Seibold <stefani@...bold.net>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kfifo: DECLARE_KIFO_PTR(fifo, u64) does not work on arm
32 bit
On Thu, Jul 08, 2021 at 10:23:41AM -0500, Matthew Weber wrote:
> From: Sean Young <sean@...s.org>
>
> If you try to store u64 in a kfifo (or a struct with u64 members),
> then the buf member of __STRUCT_KFIFO_PTR will cause 4 bytes
> padding due to alignment (note that struct __kfifo is 20 bytes
> on 32 bit).
>
> That in turn causes the __is_kfifo_ptr() to fail, which is caught
> by kfifo_alloc(), which now returns EINVAL.
>
> So, ensure that __is_kfifo_ptr() compares to the right structure.
>
> Signed-off-by: Sean Young <sean@...s.org>
> Acked-by: Stefani Seibold <stefani@...bold.net>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@...pensource.com>
> Signed-off-by: Matthew Weber <matthew.weber@...lins.com>
> ---
>
> This patch originally made it into 4.16 as
> 8a866fee3909c49738e1c4429a8d2b9bf27e015d but is a bug on at least 4.14
> for any 32bit system(PPC/ARM/...) using kfifo with u64 datatypes.
>
> Please add to linux-4.14.y for the next LTS tag.
> (Below patch is a cherry-pick of the commit onto linux-4.14.y and was
> verified on 32bit hardware.)
Now queued up, thanks.
greg k-h
Powered by blists - more mailing lists