From patchwork Mon Jul 12 06:11:20 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: 472925 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2662089jao; Sun, 11 Jul 2021 23:52:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygZ2Fbfq0tR4C7ibSNQ5L7LdvPStgKSt/TPuYSgWpuT5AdLeiDkY0JgcniSpeum51Gh4RR X-Received: by 2002:a05:6402:26ca:: with SMTP id x10mr308757edd.319.1626072679822; Sun, 11 Jul 2021 23:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626072679; cv=none; d=google.com; s=arc-20160816; b=c6yjJgn2i6wKlVex1ylM0U3GSMye9v8dWSd3F5yiStjr0b1vGWgVI1vA5bdZsGGgLr cEEKyuK8IXhzffi1tculLG12I97gHlatmLDBleu1sPLgWO7hFy4IWaouG17xw5cU136G 4qkvxKow2O7IL05QAQ6PVDAIOJvn7pa5MYZVQ/dcGTQtAhBIVuX09kLJO0h8UL+/tzhZ Gpya4vr2SoynzAQJiZ3OvthaKWLve8F53hgOZVdOTu2DQIIVkmmYxsVZ+649EWECa7p1 qN1xE2vbgA1GOXRk3ZP4qCzkZppexY+CNe78xf4oTTCHKXpe43m2BbnIrw4RTx5k1xez v71w== 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=0AZ3BMLPnkW7ZpjR0EIFhND24xOqM5XBnUzPU0OLb/q8o8jNlyAnpnlbXPhaQ/MdEV oYvyAfGAMjXvCsUCJLsbM5VInfSfVWpPgLNP0lNLiwdKVDIanMVqEVXv6G493bLiefKb kp1CIzeS1TUxBZ0twsiICAUODOFFhBAfx956JCRHvuZhOKWbe4jofDuyJea+now+AU9l folaDTotIcv2rQDbpP2KQMLnSV7Q6BU+RO7xWzS6DrkBimC1eLXtRc6F+u91wv6d948M jcA0Gs34hVIotJYmeOFk7CIvm7TUG5wyGjhBv6dnQlV5y/02NKE4nUaieAvyFIN7RgYg 5FIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pFHpeNrv; 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 r25si3440466edp.437.2021.07.11.23.51.19; Sun, 11 Jul 2021 23:51:19 -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=pFHpeNrv; 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 S240303AbhGLGx2 (ORCPT + 12 others); Mon, 12 Jul 2021 02:53:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:51188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240417AbhGLGvw (ORCPT ); Mon, 12 Jul 2021 02:51:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24BBE610FA; Mon, 12 Jul 2021 06:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626072527; bh=CO02HGpR4gwSOc93xPDJUXZ4YgGAb9nP2Ad9BgTe4B0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFHpeNrvmXexG78zmbeQrnCoVZdHFfnvMQutbQ0ppw4Ga4Wm/MbecqC6qWRuWtXXm QgPkqOWpbbCXl5d1QUhyp8+5w2R0Yi+fHvFQbXb1NCL8sksGHCya1fLX1qBzjFeS8K DvZOrrg31Budb+NfEjB47KjX5aOazxhizCSbPfKA= 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.10 520/593] iio: light: vcnl4000: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:20 +0200 Message-Id: <20210712060949.739546936@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060843.180606720@linuxfoundation.org> References: <20210712060843.180606720@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;