From patchwork Mon Jul 12 06:11:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472979 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2683815jao; Mon, 12 Jul 2021 00:24:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWBJJJS4LDQ8oLtDNa/kqwJBjUtx1+AqRIOxTvTcaLqLIp24ModP/gQr1ASoYW9tu6Kyus X-Received: by 2002:a05:6402:27ce:: with SMTP id c14mr63542788ede.333.1626074679681; Mon, 12 Jul 2021 00:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626074679; cv=none; d=google.com; s=arc-20160816; b=MSHmfFBT8yg3X8sBZVlTm4fiYpSwkyk+wbCMPBL36ooLK3+Je38kuWjqt0chVZPL0X 7bzMpnDX+OfeCP4EDOiZtDWFTHSGyGpJ1MzaYuQC1kTq5M8/1CViRs3zCsghtebugotC V0CXmxi2OeW3/lhhA9jfZj4FrOhM2P1fQ/6QmrrCZGILh7c54wAXVYZMAnd6gnm5lKk7 IIf89v6I7Eb117+ZJ/USDsbLF6M+nHOh36VMD2AxueRNLc3yghyciZwKI9SYF0PaiH2x JDVcnfsanQZJM00GTBf/vgdqJC0Gr478bQI6cSgA+OSWqpoCN7GIJD7YQdM2U0+YlH7r ehSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2QfDQrTBeMvwxb9uBOQKWVrV9IyRTDwTapY+nHwYFl0=; b=qYx1LF3cz00n0BYF8AqDMg05XqFFGNqW4us/ikArTSKw7uo/dl5PTbzvdlaMJ6mlm2 2UEf9A0nbRp0RhcrUZrjGhfpiLOZMn9YXfW6sQDaiJp98nPlH/HLQ5ftmdzELdmDEAR6 gdYWCUSRIrL7+ESArLHoHAnHGRBZPo4honwEQHv9+HNISjVZcNvxc6KAv/nZ3nGN+C+A +p7LLn7OB9iY5DCPYhhnzZ4Y4v7Z+r4jmJxYh3NoHoYym1sJcaI+sQlQaksrFhkfQ8AY 7Q3TvVikkJN2GmgcK4AP9262hBLp1SBQTfJf2mF3JY9pHqDbEByzW5ZZFWKxSPeVrA24 +HZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uLglfNtn; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si16909677edq.169.2021.07.12.00.24.39; Mon, 12 Jul 2021 00:24:39 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uLglfNtn; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245624AbhGLH1S (ORCPT + 12 others); Mon, 12 Jul 2021 03:27:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:36898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345396AbhGLHZ1 (ORCPT ); Mon, 12 Jul 2021 03:25:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5DDA3611AF; Mon, 12 Jul 2021 07:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074559; bh=CO02HGpR4gwSOc93xPDJUXZ4YgGAb9nP2Ad9BgTe4B0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uLglfNtngbEqUGfKAiij62J/M+GPL3UaTSqHOoRnHPrwnKB2g5XEtUY/XGXntlIHp Ix0AKs+zScW6Oi3dyhsIn/gTa+EX4nDAGmOySiF2F0Qf6SVaQTDaN9hVVZejYJf4Zz Mcx5IO3Sx3lKEx7DF4uAMZ5vbq3EETrTCmuU23Ho= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Mathieu Othacehe , =?utf-8?q?Nuno_S=C3=A1?= , Sasha Levin Subject: [PATCH 5.12 618/700] iio: light: vcnl4000: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:41 +0200 Message-Id: <20210712061041.614826553@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Cameron [ Upstream commit dce793c0ab00c35039028fdcd5ce123805a01361 ] Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted. Here an explicit structure is not used, because the holes would necessitate the addition of an explict memset(), to avoid a kernel data leak, making for a less minimal fix. Found during an audit of all callers of iio_push_to_buffers_with_timestamp() Fixes: 8fe78d5261e7 ("iio: vcnl4000: Add buffer support for VCNL4010/20.") Signed-off-by: Jonathan Cameron Cc: Mathieu Othacehe Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-7-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/light/vcnl4000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index fff4b36b8b58..f4feb44903b3 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -910,7 +910,7 @@ static irqreturn_t vcnl4010_trigger_handler(int irq, void *p) struct iio_dev *indio_dev = pf->indio_dev; struct vcnl4000_data *data = iio_priv(indio_dev); const unsigned long *active_scan_mask = indio_dev->active_scan_mask; - u16 buffer[8] = {0}; /* 1x16-bit + ts */ + u16 buffer[8] __aligned(8) = {0}; /* 1x16-bit + naturally aligned ts */ bool data_read = false; unsigned long isr; int val = 0;