Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2832116pxv; Mon, 12 Jul 2021 03:03:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7FidC6fGVnaUSkh1+lY93UNpPl1zIydS7DiE1oB0zqB3Odmobz0lkcfjI/YJk/fSoIzz9 X-Received: by 2002:a02:6382:: with SMTP id j124mr43807834jac.72.1626084201257; Mon, 12 Jul 2021 03:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626084201; cv=none; d=google.com; s=arc-20160816; b=Q2ulDkAQlL42H2HiCpGKfffJTceAXu47yYrcQ4+paJ+Mg+xqlKwxcsn2qN0FmE6lEb mK/fd68KqbTONi4r6X15KSAQHFjuMj+/49TYqfEAMC+ogC/TPyztELIjOLKshe2sc0QE bZ5023lZJsHlh4Gbony6ATMvTpuM1ToHrLns9xZYAR4XKkIVOY6gtmwVImQ8GhkOgXbA ZgfsCwsX4oZ961nUZfIVgY1TDdWWxLVXt2ElosKlgZt/Dzmy2rj0k4x6AsV/Ne3Sqf+W 0l/zQIksA15smQFO2kk/E8d6oO72+on5jky8B4Kp1sxrvrmFPz0z31ffJTG+P3340CwU QXwQ== 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=cDZH4tfXInbB9VLSA1XAYAx3xApXbudasC7v7m6RQBs=; b=LroFycGyogGedP6yhb3u+79iMD89lV8QXqNEjPBQWYXT3vxVi2x6Zr/DDdSIBn/9WX T4MsVoH2u2yMAwNfo3IsqpUMgkDRJQtrkHag3KZEOza3ktB024oJD5Nr6qLj/Rk0Ft0p ne5GpyCPxCA52MZAxiEVzm9DXn0qtGuqnx9LOCNSuHBpOeiQidprx3+xrE9jVnuwTQ8d PojOdumw33P+XJ/3zgwaJDgeWu5RE6eKEFalQOsGizGwqEp0xuI9lb2pZJDSjefIUQhy NpspSR6jUzhzElJhRJVEWIiyQqQRUFtfyKO8WM65VWjXuRKJBydhOS0AR5HRjxj6RoSx 13iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q7i+5NH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 n12si17967505iob.27.2021.07.12.03.03.08; Mon, 12 Jul 2021 03:03:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=Q7i+5NH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S241628AbhGLHPX (ORCPT + 99 others); Mon, 12 Jul 2021 03:15:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:51186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240405AbhGLGvw (ORCPT ); Mon, 12 Jul 2021 02:51:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03B3961107; Mon, 12 Jul 2021 06:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626072530; bh=WdTOqzhsaeatgfwqF1jV34McTHBB+98HqcQjJygCbNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q7i+5NH16B17CIBloV70jGeZvrUXxnO+3BrtpxAtMaUg9eIPirxx7c/IVyBKgeUZm e5CwDglbOerCI9hwpoWE8/q3MzBEbilIqtlxPLkiEOIIHkG2ONrv3wUTN/Y/zRMz51 F9mZgabiRp52Mn6Cx+Y9ZJ5RZuobuSCNaAnTHOv0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Parthiban Nallathambi , =?UTF-8?q?Nuno=20S=C3=A1?= , Sasha Levin Subject: [PATCH 5.10 529/593] iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:29 +0200 Message-Id: <20210712060951.544659435@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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Cameron [ Upstream commit ec90b52c07c0403a6db60d752484ec08d605ead0 ] 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 potential kernel data leak, making for a less minimal fix. Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035") Signed-off-by: Jonathan Cameron Cc: Parthiban Nallathambi Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-8-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/light/vcnl4035.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c index 765c44adac57..1bd85e21fd11 100644 --- a/drivers/iio/light/vcnl4035.c +++ b/drivers/iio/light/vcnl4035.c @@ -102,7 +102,8 @@ static irqreturn_t vcnl4035_trigger_consumer_handler(int irq, void *p) struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct vcnl4035_data *data = iio_priv(indio_dev); - u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)]; + /* Ensure naturally aligned timestamp */ + u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)] __aligned(8); int ret; ret = regmap_read(data->regmap, VCNL4035_ALS_DATA, (int *)buffer); -- 2.30.2