From patchwork Mon Jul 12 06:11:53 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: 472997 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2687451jao; Mon, 12 Jul 2021 00:30:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP40i907WA4aIWMmVXTWa1sXQChs4gZrdAIFLNrDJ+s9mALDfIIIPnHXc2Q3RLibLHtfGt X-Received: by 2002:a05:6402:1057:: with SMTP id e23mr64777708edu.352.1626075042578; Mon, 12 Jul 2021 00:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626075042; cv=none; d=google.com; s=arc-20160816; b=c9n+FxWT+qtnoAviFfdhSW3j+IjBFlv2BnZwDqGVR1kxDugNnCelv0kAhBKeefd+Zb OB+NyN+oc05XUc03m/bG4Eq69p3NLfDehTEvibvj6sTXPrSxDn20j3atRkxJZ9UkKCcJ 9qTTTpH59Z4zRbNWyEd9uKuG+r6P4V5atOvgQ9N4c2S6GsTXKtmRJ0rNtpAzUQi+xpdv eg8aSXFnCK8XwN0RV33ml0Tvdr/nhynOsv0DjwDJ0Ulo554tmJMVZQq2ERnfPix0ZpAK 0KT0BENRsaUwuGEh3jiRJRfu3hIIPSMEj7WBlaRwGoit/CGAyOElmD/BTOyIRjZMEuGC imgQ== 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=URhc9y0JTbW13221WTbEj03HmYAXiwQKqRC5IAKwesc=; b=KRrh86rTMIZwQYCGiUudzN95BRNwD443Kce++INc+7BsHFoOdcBaJsQXbrrcNx/2Fc pgGsmJs3/wVIkpzvZ28xE2brwGECJXRFEeBtgptVhFuKae6KbtvLPLeXjIGbc5Dg/ISW a6J8X/Vo6jsbGT4OPnpyNVClovrfwhZ7qZr3e6HZ3wXmh3zEIL59xq81w56MtU7zLbiC JK31OqCSAyqW0LEChSdgAZsL+Wd6TQYuYRY1uIHC7fkBzb5FM2nwphG2gGUyq16ZaqDb ePHLgG1MGjpyB3/hyuDCvxz7YjVwWrSyBTAtFRqdlihMciKTHebgAD7Se1Sxm/184gjU eL4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DUJn+qLq; 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 e9si16596658edv.146.2021.07.12.00.30.42; Mon, 12 Jul 2021 00:30:42 -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=DUJn+qLq; 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 S243135AbhGLHbq (ORCPT + 12 others); Mon, 12 Jul 2021 03:31:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344428AbhGLH3c (ORCPT ); Mon, 12 Jul 2021 03:29:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 002EA6144C; Mon, 12 Jul 2021 07:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074716; bh=GwE8RPq5pMt2EPWshQUKIzJE5UeMVqs9MYiF1KNprCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DUJn+qLq/tHTKd7c+f4F9GZwcREm2qlt7Myo2tNl26kwNrXblh9KJ6GnngjdmwdR6 51r8/DynW6ZWHvHuBS+LYJZq16bN9gVJiFCbHMJAFYVivfKVJem+aGrV7f7HKv1X+d NipngDg6S5bxqPdvd6C3vM3epwnrAjxfzusdGt3U= 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 630/700] iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:53 +0200 Message-Id: <20210712061042.879276504@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 92babc9938ebbf4050f2fba774836f7edc16a570 ] 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. Fixes: 1c28799257bc ("iio: light: isl29501: Add support for the ISL29501 ToF sensor.") Signed-off-by: Jonathan Cameron Cc: Mathieu Othacehe Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-9-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/proximity/isl29501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/iio/proximity/isl29501.c b/drivers/iio/proximity/isl29501.c index 90e76451c972..5b6ea783795d 100644 --- a/drivers/iio/proximity/isl29501.c +++ b/drivers/iio/proximity/isl29501.c @@ -938,7 +938,7 @@ static irqreturn_t isl29501_trigger_handler(int irq, void *p) struct iio_dev *indio_dev = pf->indio_dev; struct isl29501_private *isl29501 = iio_priv(indio_dev); const unsigned long *active_mask = indio_dev->active_scan_mask; - u32 buffer[4] = {}; /* 1x16-bit + ts */ + u32 buffer[4] __aligned(8) = {}; /* 1x16-bit + naturally aligned ts */ if (test_bit(ISL29501_DISTANCE_SCAN_INDEX, active_mask)) isl29501_register_read(isl29501, REG_DISTANCE, buffer);