From patchwork Mon Jul 12 06:11:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 472859 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2647932jao; Sun, 11 Jul 2021 23:29:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwasnJ3gpnhh98pxSEN8wub7H62HKu6I/n5UgmZFFA3fuIbykO8fh6CWhXOSsre0br3YLEG X-Received: by 2002:a05:6402:138c:: with SMTP id b12mr63686433edv.268.1626071399020; Sun, 11 Jul 2021 23:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626071399; cv=none; d=google.com; s=arc-20160816; b=LTfy6c3iZVlarXubTGgto7xR3ZixpQPhC1r97oXOZzbu7tSbuEj7pKVpEKNtcfrKLq C3WQQnTdG+Sh1TrYnuZUPQvQZHJPotnSLVpsrnYo+SUhTGrxrat6NCNeXsDpT4rYh08u ZoHo1qWsi80AaCSxXWIt2wgBHvYfuW58kkvsKRtRnjFmGhSA/WPdMZizzkmXn7PjlezD OipoeAEVMv4MuOG/j+qcpJLNFvduNVAQ7p6aq9X9b6tEJA4IhaktHT2dbv03YjmDgRwu lxkBrSu+Rk7AIkqztn2WhYMe/D98gJSNIvtXWPM6zPR3BszVZ+umPZHr98HsmsaR2iyq 2+Lw== 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=xXBSvYZ+lseWMFtqnSgDG50OXDYT6qOLEVJ1CodB9tg=; b=RzC0YNMm+mO9WfE692a6NLZ3K8ZfowNggUM1DMksaqtN9YPCFBrlp1QD5BZ0jAT/MV v0Kjzo7RmWdFxtGwgprcXlq3B/foKVA2byX+5QZGK58sXnLAdlkB7DLfgAHsLebeeMm9 2o12fOridcmuIo9u8srtjGn+AQQhNGmkXU415wZibpOVmOmnYoxxrCAULZuncP7QYPO2 3tTuX/bm6Tsdy2JCadiiJ3T84RWabBKKVRdBTlV1AAiFBquZo/IRnCOzqBw2+A/ltnNt FxPJQ6yXj1oZuDyF815Io9GZWxGEMQyX+I/jHcMyyI73lYBdcZudTrWcMwNZ957ya5wg s5ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nDE2sylC; 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 bz6si16420285ejc.610.2021.07.11.23.29.58; Sun, 11 Jul 2021 23:29:59 -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=nDE2sylC; 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 S235472AbhGLGcg (ORCPT + 12 others); Mon, 12 Jul 2021 02:32:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:46026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236060AbhGLG3n (ORCPT ); Mon, 12 Jul 2021 02:29:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5AF94601FC; Mon, 12 Jul 2021 06:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071209; bh=q3I87XHRh+u13df3LCsYehA6LEWAHR7F7GQF0rtkrQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nDE2sylCnfl6/mNSKD3zYK4qajJuhRDuDJF0LdUnhDUYyQyoAx+Urusso1ycE2CJd YjHgGKLOJ2iqu+0chjZ5y1IKHwa+Kh+ZCJuJt1NZMjLkndfDZMa8jocGo/94ZH/uWS Kq66ay2M/lS6jFDm3xXUqFUjzDNpIX+ztSsmGnl8= 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.4 321/348] iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:45 +0200 Message-Id: <20210712060746.607884585@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@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 5ae549075b27..56d6e9f927f4 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);