Message ID | 20201109125028.902266505@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1743415ilc; Mon, 9 Nov 2020 05:41:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJb5pUEeEjgASNVRQeTh8mkRTznoxVIiWGz8Mv2jxo3XcZ3bxmcBh5WgZHe63hsph6qEOP X-Received: by 2002:a05:6402:1701:: with SMTP id y1mr11029874edu.209.1604929269604; Mon, 09 Nov 2020 05:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929269; cv=none; d=google.com; s=arc-20160816; b=pzhFsUWTJcMhdWwpSuRcUm2RqThZ/AxBgmZgM6FGCV3WSgM90Mq0Tmo1brPvcsZssj CxqyY6tynNMknDjzKXOEo7q6X8w0fqbTTQYMDzB4NV0visp7Jwhrr2USCYVmNqg/e+oD mrNkKMdYBKDPv0dXho6RFupyiIvSiy4ck5gI1UBuSP2P9pAVJQBe7RR+aqYtwZ7UKEuO ZepdGAT7w9Tj5K6TYfyfpcWZD3t0ydFXrx5rzarFJaifQhUtxLaTKNqrc6eVWdKsi2TN vvwJIRrf59qyX/ZMIKhYsdysFZXGiR3goo2oKkr1cK2jfh6/szoaij9+1hpEiJHxt2SM Ri3g== 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=YWinaq5EOm0XklRHwf+9L3zMVnVbwTk0ga7+Qq/NsGM=; b=uA9gavSy+Ekuin9AIYlZExRLwYaTqyIrXy8rOTs3sainsqUlDLouqgOW+V1y7lA4O+ avv6FUhG7QDP7aV2yfNR5HJUsgmAKZXJMSTmhROq+TOJ9eTG33b9HYPF4NljpCfN/OB7 X585/HRhDwTrFoeacXhsJ9I67TI+rhFJQ8OWnpU9DQhy6MjAZa6625l7dNnp40yjtGRC 9/pndnYaLdkEbctNx8rcSw4PcJ9lq21bb/nZjyb54S5TsDQemtQWMQj2ghSjZWuJ11/u TCFcAyaaKmA6/4Uq3Ll3sh+7D+RBrBJAsUx/RLbOUwxNEGXCOpLgl//WmgjTeLO3DCww +X4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iu9o33Sx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: <stable-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si6737606ejf.269.2020.11.09.05.41.09; Mon, 09 Nov 2020 05:41:09 -0800 (PST) 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=@kernel.org header.s=default header.b=iu9o33Sx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729174AbgKINjM (ORCPT <rfc822;semen.protsenko@linaro.org> + 15 others); Mon, 9 Nov 2020 08:39:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:56244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730670AbgKINDk (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 9 Nov 2020 08:03:40 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A480E22202; Mon, 9 Nov 2020 13:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926977; bh=/y7H92Kxy/9wo+t0QSJYuIYPw2TgRjpkBGgOFB+T/No=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iu9o33Sx1m5JquLxP2nBc//Lj8AGQrEy+IpauGD3IOF2e0mJJTzDTqkjzKfdlQaFp 0slAdUIFZ0x+TLEyTopoLCS3N6/RZynLGe7rn3i7l7wT7LSQkptpI6y1CxeTunEQri WMXKe6ElMrbcJlI9MUTcsNHCj1qQI+UXptJlsSKg= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Andy Shevchenko <andy.shevchenko@gmail.com>, Stable@vger.kernel.org Subject: [PATCH 4.9 068/117] iio:gyro:itg3200: Fix timestamp alignment and prevent data leak. Date: Mon, 9 Nov 2020 13:54:54 +0100 Message-Id: <20201109125028.902266505@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@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: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/drivers/iio/gyro/itg3200_buffer.c +++ b/drivers/iio/gyro/itg3200_buffer.c @@ -49,13 +49,20 @@ static irqreturn_t itg3200_trigger_handl struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct itg3200 *st = iio_priv(indio_dev); - __be16 buf[ITG3200_SCAN_ELEMENTS + sizeof(s64)/sizeof(u16)]; + /* + * Ensure correct alignment and padding including for the + * timestamp that may be inserted. + */ + struct { + __be16 buf[ITG3200_SCAN_ELEMENTS]; + s64 ts __aligned(8); + } scan; - int ret = itg3200_read_all_channels(st->i2c, buf); + int ret = itg3200_read_all_channels(st->i2c, scan.buf); if (ret < 0) goto error_ret; - iio_push_to_buffers_with_timestamp(indio_dev, buf, pf->timestamp); + iio_push_to_buffers_with_timestamp(indio_dev, &scan, pf->timestamp); iio_trigger_notify_done(indio_dev->trig);