Message ID | 20241125-iio_memset_scan_holes-v1-4-0cb6e98d895c@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A1561B87DE; Mon, 25 Nov 2024 21:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569391; cv=none; b=floTp0Hji4EUIcpCcwr0G90XJuj+5m8o+i81k/HTenLOjQA+58V/hLL77mYOAljRZ1GHhrkjj0bb6MAT76Xi2/tSzGZguw/qadI4HaWQnSriV/PTf0rpdVIsEK/5epvqrm/FZO1eang7PCnaiGZJMSXtrvAfAimhbPC+vl8BltM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569391; c=relaxed/simple; bh=mky5t6OVnnN5KSTL+/knjrhqywJ9YZ/nDMA6VraN55o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B1TqcJ56wx7na5Pp/l7NsoiivtAoJWKX7Mx6ONNjjanyi7Z5bUI7PiAJ9ETrNHmySUQhvnjIpgUy4NAb0dl6A/uE2i6J0ktSmxWJcBV5qaqQHrdeHhO0iZR6g1Nk0ZcvncLqTUqRXOCCMx93FJd+Xc253yV3Zyu2pXGuDk3SQOE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HjEOWQvh; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HjEOWQvh" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-434a0fd9778so10002655e9.0; Mon, 25 Nov 2024 13:16:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569387; x=1733174187; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cPJKlEpy09f5A3MUO4c7FtHTuEX/b1bW7cXIwya/EYY=; b=HjEOWQvhXXVtA5GzNQEsOFN+dX8TTAjyTB9Xd64fl7K3QGqBc8OAMpu6Qf4nwOqqY1 xbN4p1qJzWlHbvkA4bkbNybviuoQb/crpMff20YPSflfVt0jHkFbrNIIZDNtJ/0D2DQm GSRJtH0maV3awsvZa2cWNrq8NIsIXZs29WWpObEuVR2IfhiJdfqXAfVwMb8dE1dtwoWn 65W/4uBY7cR4CqFzAc31x8wrAGB5x95SEtO4VgIl/k/hB1MvQsbojF26qLzanW4gxMGP DYklqVH6pIxyAsbMFEcmQJJE+pkq1ouLrd/nCcJQUR61/6XuCTZspW6O1ft2lQNw4zu7 oKYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569387; x=1733174187; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cPJKlEpy09f5A3MUO4c7FtHTuEX/b1bW7cXIwya/EYY=; b=YLd91wKkiBbeLzwum9IDlVrAwdjw+Y49NZNVFeRpVk22hE3c83HAMcuGXPKI+SciIY z9h/4hR0NbfSByp33qSffQV9fCfWhMBC077WrfAJhevfm6Qb4AWVN6ZyRIY1vWmwL9Qe l+AfClmNsok8bOmgEhQAIgOC6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xyx01TCHHWWKw== X-Received: by 2002:a05:600c:5102:b0:434:a1e7:27b2 with SMTP id 5b1f17b1804b1-434a1e72a53mr24819125e9.7.1732569387109; Mon, 25 Nov 2024 13:16:27 -0800 (PST) Received: from [127.0.1.1] (2a02-8389-41cf-e200-eff8-ad65-1bf6-3f21.cable.dynamic.v6.surfer.at. [2a02:8389:41cf:e200:eff8:ad65:1bf6:3f21]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4349ca82957sm75236295e9.33.2024.11.25.13.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:25 -0800 (PST) From: Javier Carrasco <javier.carrasco.cruz@gmail.com> Date: Mon, 25 Nov 2024 22:16:12 +0100 Subject: [PATCH 04/11] iio: adc: rockchip_saradc: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: <linux-iio.vger.kernel.org> List-Subscribe: <mailto:linux-iio+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-iio+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20241125-iio_memset_scan_holes-v1-4-0cb6e98d895c@gmail.com> References: <20241125-iio_memset_scan_holes-v1-0-0cb6e98d895c@gmail.com> In-Reply-To: <20241125-iio_memset_scan_holes-v1-0-0cb6e98d895c@gmail.com> To: Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Antoni Pokusinski <apokusinski01@gmail.com>, Francesco Dolcini <francesco@dolcini.it>, =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= <jpaulo.silvagoncalves@gmail.com>, Gregor Boirie <gregor.boirie@parrot.com> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= <joao.goncalves@toradex.com>, Francesco Dolcini <francesco.dolcini@toradex.com>, Javier Carrasco <javier.carrasco.cruz@gmail.com>, stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1023; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=mky5t6OVnnN5KSTL+/knjrhqywJ9YZ/nDMA6VraN55o=; b=6PKyUN/+3xEMCqT2IYN8asZlTio7xMSNP8ixqekU/MLeVDxNEUjrR8zco16lBsIaKdv2lVf1J NaFiPm62e5HCPbjbd2jOpYcfkA7lgpdbBBoIE/Aw33DoJ1ald9m3CGM X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= |
Series |
iio: fix information leaks in triggered buffers
|
expand
|
diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index 240cfa391674..dfd47a6e1f4a 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -368,6 +368,8 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p) int ret; int i, j = 0; + memset(&data, 0, sizeof(data)); + mutex_lock(&info->lock); iio_for_each_active_channel(i_dev, i) {
The 'data' local struct is used to push data to user space from a triggered buffer, but it does not set values for inactive channels, as it only uses iio_for_each_active_channel() to assign new values. Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: 4e130dc7b413 ("iio: adc: rockchip_saradc: Add support iio buffers") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> --- drivers/iio/adc/rockchip_saradc.c | 2 ++ 1 file changed, 2 insertions(+)