From patchwork Mon Nov 25 21:16:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885278 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 88C8C29CF0; Mon, 25 Nov 2024 21:16:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569384; cv=none; b=TYr9ent2/1BXBi4wdSHOtntmSCzFvVV7zErKX8UaH1uar5+2KUopUC+3mJQjOU2ZgOiAeo+LBpUYMH/cd8uGEbe5qwKebGviiRGycq8PmxaWs9cHwqPjac1UQInruLTX5aPu1qX/lqMG1xnZ2DvLKpB4bThgR9394EkYGRtCPsE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569384; c=relaxed/simple; bh=cyBeaQMPDUmjguYiw+l5uyptd3ou1PYxJOynjAFQjc8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GC46QKOGJr4AamYdOP6MX0IKNaUgWomFuhgvFlvR1okQeqTxLKELCcizbq21VLiGvT5fUVdQfGKI8EIc4CexdMOKxLvNcxRfQkcX4vfPWJSyHUovOjmS740bLMxnX9F7ckDHDz/zoCMsPmfLIes2oFuHdTv4N2d+O2195hqGaCs= 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=YjR9IFTz; arc=none smtp.client-ip=209.85.128.49 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="YjR9IFTz" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-434a1fe2b43so7702525e9.2; Mon, 25 Nov 2024 13:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569380; x=1733174180; 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=ADRD2BHODBZiky8Gh1dqilnT9fbY5WGuqoJtO3/r8Kc=; b=YjR9IFTz0axPlXtqSie5l8jp91VDwHoBhX1exLxn5zUMZzL9rFkjwDvCILyq/fX99v 4dt6sEQGkGxrAyZi93Oe8yBCAIdyPCMUr7Bxkc7xjAr4DKN0Cd+tevMJwOGREnWgPooY 8tnTuT0dLraQdgruogMBSwgHnqi2qCw8dblgLRIcp13AItd9iSPsig+YYWQn0tqDbYnq DqVDy8034ny0biB1LBUjDblpjnuUfGRiNAxZSxJhxLNJLNneWeD0R6AmJ/JFwB3nEqtN UkzIRM/fOrycyF9GOhCZYvg+m/w+5ThQiIykvpDLhJ8uN0MLPpFZ7dF74PrgdIgVCbQn ljIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569380; x=1733174180; 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=ADRD2BHODBZiky8Gh1dqilnT9fbY5WGuqoJtO3/r8Kc=; b=SEeqqLxmMTt4LjSSKwvinnmBjyymYcPW5Rgw6rtXS4sSD+TiAVPqimA7Z7RRqWd1EU DyRFI4zkU9JMt0HWIUhlTmqx3AkjGE3cpVR1MLr9JN2hlJMyAvqt7qADmcJyb422pGEd hRZ7hGHePLvYUT+wK4Adqjm9VwhfgJ1amgGMqus7U7O9HlhXK+MTjR9qHc6kFPnqTKyy S5mpeVJOUGzlBjLkcjjkTu3Y8v1mTd6fB4lheIR2KKnPPkxNEEtdu2z3LUHr2g4OzqHk bj3y3v9kMhsFmjkNkB9gHocnyzZfdOu627RnhfeHrnDa/0WXydONefEDE/fvgty3nZt1 EPZA== X-Forwarded-Encrypted: i=1; AJvYcCU80LE9VscD3HsFF/RPAfBzM1xCRg2l7HVwrCkRS1zGou/BjSgEKTxWK8BU540t7vRm6qBVI2Rqrafjl9LJ@vger.kernel.org, AJvYcCUM2nk75UHVkY7/tJAFP/JRp7M2LDEAO9tX8EpuyODRBiUlg2GyWWsAq/RGI2djcDWIx4BcII7I0aU=@vger.kernel.org, AJvYcCXbbzxWSeWEPlmRfmwcpuL5fN186XrHl5Iu6dAG7JZsx6eyuOVersOPj9up8sOTuEr7Pa3bwalK@vger.kernel.org X-Gm-Message-State: AOJu0YyW80buuAe4rKV+Zmadox5+HntX8PqFwKrZXJOsguaoSdzW67l6 WnghBI7eDcAkXMLF9F5A7oTKTP73Tyz3+suDovNqYrZggAG5KINwl3d5+g== X-Gm-Gg: ASbGncs0rB0BAXNR+ANGzr5quUdCK6hBTf3nh/nDriWd9lE3LAfpslHxYDPFMyTblmy QJq+MauYHkz/9TYM18opAxkp0y8k/igpdn2QMRhk/zCrjJEYQnLKlN/DuKVoKb7MxW4BeHfR/vd wzBQdl1xCvlT6pbePuc1zpesrWv94W/lOv9KVCIQ6Aq3Yi48HxJjaHoEM+k6ZnOyNlgmXVsMte/ 39EXXvXLjDB6Y/iZO3nCdp8y0xSwWK6oG7JTYXTMQaY+tOBokp0Y+sVbudXdF+DjfN6uVtO7IOe a9k4T/B2s/M5JYb65NXhYkgJYOUB9+tkIjcN+q/YrS2kxYOnygaQV7bvppnZnmU2EHvz/58d X-Google-Smtp-Source: AGHT+IEcDypKkBqPDRoZTI1jTSyHl7AVBhnZb/1/cxO6Xbs2UhO+OUiLKARF3j1G66fIgJxJOq/ocg== X-Received: by 2002:a5d:6d08:0:b0:382:4a66:f517 with SMTP id ffacd0b85a97d-38260b452e2mr11624365f8f.4.1732569380364; Mon, 25 Nov 2024 13:16:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:19 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:09 +0100 Subject: [PATCH 01/11] iio: temperature: tmp006: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-1-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1016; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=cyBeaQMPDUmjguYiw+l5uyptd3ou1PYxJOynjAFQjc8=; b=NjMGye2yswzQcRCrPFe9LSzYJ6tjwQN6IMBFPZg96P9HqIfwoUPeiHgDqXAcS4d1q83uhYfE/ uv6FnYNIZ8VAfxG/Q3LRntserIXym31W6+33pTOoLQybn7fpxDcyCrK X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'scan' local struct is used to push data to user space from a triggered buffer, but it has a hole between the two 16-bit data channels and the timestamp. This hole is never initialized. Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: 91f75ccf9f03 ("iio: temperature: tmp006: add triggered buffer support") Signed-off-by: Javier Carrasco --- drivers/iio/temperature/tmp006.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c index 0c844137d7aa..02b27f471baa 100644 --- a/drivers/iio/temperature/tmp006.c +++ b/drivers/iio/temperature/tmp006.c @@ -252,6 +252,8 @@ static irqreturn_t tmp006_trigger_handler(int irq, void *p) } scan; s32 ret; + memset(&scan, 0, sizeof(scan)); + ret = i2c_smbus_read_word_data(data->client, TMP006_VOBJECT); if (ret < 0) goto err; From patchwork Mon Nov 25 21:16:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885279 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 3E5BB1B87DE; Mon, 25 Nov 2024 21:16:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569385; cv=none; b=lvAfGMmCLmQkeOhjbWAyFMli9nliXm4aJmIkpc5xST49EnqtScW/AxkXezDNQaEaySWLbtnGDTA0R4xuK0UA2pSc/eaejiU/cfGPh+AivwbaqTZgt9XziR/ittRyeXSsB8yZ9HzMWZXE8YPTkPketj+a+R8iHQtg4LaVnDZSONc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569385; c=relaxed/simple; bh=4X4x3q7FZNx502nxm7s26D+sOlmBbszT1dfj9EmuXt4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oOl98hPpniLORWltT+FeH3Jmj5yFqX4TG+ns92jOCGDp2668ibBnNfzqaQ1QaA7XmNCGo6ZrI/aM/ogKlD0fiKVNMDpfhZYMx8nlW2/Nkn37q6V9mPqEPzKNZXdoCTZN+HFG0aMaxS2nZVHWDOZjHNwgiMOvhdki5XqOHja8JTE= 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=WK4c0M4T; arc=none smtp.client-ip=209.85.221.41 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="WK4c0M4T" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-382411ea5eeso2787184f8f.0; Mon, 25 Nov 2024 13:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569382; x=1733174182; 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=G6J94mRhaR0bTMOB+SdMX1VKM7f3jssSX2qY9c9Hjqo=; b=WK4c0M4TXg7XMMhfhkCn4w1UM3u0LDkn40fJI5mfAz9WfL36Ch5PYCMigFDamWil66 LPjOZERyR9hJ+U+2RluSHSzgbk79JT94DkRjnf2z44nHq1WjjCXKe/I9erO/1JJtxX72 PY/i8ZNFXxPHZnPyKEex3rAlWG5wqYd6CV9fDtACo99tZsrOim3PrYG6IRoTy9/rDOzz uBsBudiPG+X/BFIUHddQLoGQuZ12jMVzJHKs8xSOWCQUMVA1wHiQLOVEt8V6f1PUcJv9 z1zdLFl2Cxetni9uLa+GyUVBYi1xUjhpS0uiJlvnonIgrZjI1xVXa+VCCtLzj9iq72f8 pZAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569382; x=1733174182; 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=G6J94mRhaR0bTMOB+SdMX1VKM7f3jssSX2qY9c9Hjqo=; b=hziW82ddJyN43YMyN9dW2kJP+qVlABqCjPcNset9rYLdXNmPQSmwMIY0+SL8jcxeVm gXZoN0hqJGuYvguuFODUQoyuz4eyUk+pYxIky4rN5eYTxFaiN5nglDC6ebMug4pS7apT eSi2wvHkr1SS9lu0IIet4tK0vL5mQfGMG+Pp3OI4KKV2hA4Mb3nVxB8C8tMf3pOQ3n8P jjgbrdffcnr7HSrhhS6TfqaI5t2BN+U8CNLR3t2E/hjYtm3qfv0Jg698Q4uO7yTGSN2g VNp6lBuwWZE9vFtIazq9of17OhF7oHDQiYZA7a+fARGPJQOLc6CoFYAf4cQ5inAJFohH B+gw== X-Forwarded-Encrypted: i=1; AJvYcCVN9Cu4QC0asq3AFeq/4sTFmTs/VR5nSsI4W+naoOdjcchMfDMhGzhBHF5YXuimrA27b+suXSUw@vger.kernel.org, AJvYcCVe3kMCtnBK64ghwBfgJLW8BCk6Yziu/4ZfXEgAOncL4U77W7qu7TSW9U+OqTiSTZ8Y7bjFPXf+8fk=@vger.kernel.org, AJvYcCVrgdV2QULCsKL+ow6eOfJmi+a81SuFTAtRCbQyyyFIxb8rES6OlszQQby7hN4tpio6q7GeM51jTmB1HZVP@vger.kernel.org X-Gm-Message-State: AOJu0Yysn8RtGDOc/HqFuwO4rYDa0gzpPnnNRwgsRgn3GCIgfpkAnpne OIQUQ2K7gZ6Y2d4jpazp6RA9wm0KWprWaxChN3gY7o29+VemcTCj710NAA== X-Gm-Gg: ASbGncuZobqplGNjNsK1fapt1qpumf4TK6ThtXT/0TG7SwIef82fbJF1vdYh2/Cuz1B PG4TCvTZv0x5LIzoh9X+gNVtGzdyP3/jDtnp9Mc91EH9/N7ladlD+cWqhSfNmIw4srGm5iuuOLb o7VL6MMmsT9HeKUNE3gMgEpt6ffMtZXPgEeIk6LW2/Vgrk1s8zeneKpO5+XGmeIJgN7fELt+ivg Myvu+EdRKXTSV1dq3XlHF3+Z3Gopttrse5GsCUYgH8xnwwO/PSlOetq7SN32PHyyRk7Z52jjEmT pIuiUm0fpbZdCeo6QEfKxpMr873x3wY3os99sglLrEX9ZDc8HHmOlnMjlb3ilqHh8sWh6Jst X-Google-Smtp-Source: AGHT+IFT12uVSCCAWkgAl4GS+z0y2451loFILgsF2SZnv69V28ljASoB9jrjNKXLWcU5duZH34tNpg== X-Received: by 2002:a05:6000:1ac8:b0:37d:3b31:7a9d with SMTP id ffacd0b85a97d-385bfb14bbemr820879f8f.23.1732569382214; Mon, 25 Nov 2024 13:16:22 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:21 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:10 +0100 Subject: [PATCH 02/11] iio: adc: ti-ads1119: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-2-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1040; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=4X4x3q7FZNx502nxm7s26D+sOlmBbszT1dfj9EmuXt4=; b=9hTH3B6nj8K6TTD8NVnbqQez5IriunG2L4qgRAHhIb2EfgxwqqYU1ZL+oN89IAQv3P/gz/JcR PXhNbMxrbXiAWOpAOfF+HkdKPZnrgfUfe1OedAIeCpL5bh44PZv8PYG X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'scan' local struct is used to push data to user space from a triggered buffer, but it has a hole between the sample (unsigned int) and the timestamp. This hole is never initialized. Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: a9306887eba4 ("iio: adc: ti-ads1119: Add driver") Signed-off-by: Javier Carrasco Reviewed-by: Francesco Dolcini --- drivers/iio/adc/ti-ads1119.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c index e9d9d4d46d38..2615a275acb3 100644 --- a/drivers/iio/adc/ti-ads1119.c +++ b/drivers/iio/adc/ti-ads1119.c @@ -506,6 +506,8 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private) unsigned int index; int ret; + memset(&scan, 0, sizeof(scan)); + if (!iio_trigger_using_own(indio_dev)) { index = find_first_bit(indio_dev->active_scan_mask, iio_get_masklength(indio_dev)); From patchwork Mon Nov 25 21:16:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885280 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 EC5751CD215; Mon, 25 Nov 2024 21:16:26 +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=1732569389; cv=none; b=dw5YZr4/JXWPh/43mwNTfkVHim65mGOkLkg5Zq5bvwuTU8RH0SovAy1BKE0SWUX38Ij27Rkp/MZdaIoa2uUpaugPPuOU27wzYvmdKOddZd8nDJtyV7ZW8+Ud02V7e9hcBkDlBaMYrHSTzZVNSHIEPLNWeeAeBAN6J9BQmGxF+S4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569389; c=relaxed/simple; bh=ZQJA+VLURMBGAdorLGZr3GynZ4Vpg5VPwIUKA3mZWZE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kQUJeFnBkj4Gsu2FUbAYHYf6qWj1qxHmBA3lgGnajWK/Hzbc42jypSSeUa/fj3tynLW0B+hU6Qi2Kux308LrdrO4HL9UBUyzkJZDAAJ63j1Hnbpra/miTG/SuBcMqKjsrI/dqRVyNHXW2UN/KevTGZ//3udyX3sK0uJhqblKvOo= 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=c8DdotXm; 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="c8DdotXm" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43162cf1eaaso61927465e9.0; Mon, 25 Nov 2024 13:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569385; x=1733174185; 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=+3RK5b8spIwxpFrRxaAWCFkLvJ3+B+yqb9aqjOjmHyo=; b=c8DdotXmEoHSxFulV5ZYPLKhPoVTtiopa3GP5tIa162qiWWnw0zepvGuO32/KG56eO GElQ1vG9BamoBo90Z2owblajZBq1hGb0S7QRlYZi7c9Ks6N5LutLD1FaxQo+H6ckS0dl Ac10mjet+/Kfv6VOzzu7oOlJoRhztT2bFs+T0AIw/IqBY2+2hP3kqB5b/AG25kVimsdC SKeRknJH66xdbx4uFxF24IAGXH+4SP753rT2jsTtppV2whCVG3iBh2+HlMK5bXLvz9d2 YE2zysIIJQmF36Gr5HldFnJyobBmvVWxDDySf4ALOfdwUFVHqKqS7rOVxtRLS+GKCb/c ARyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569385; x=1733174185; 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=+3RK5b8spIwxpFrRxaAWCFkLvJ3+B+yqb9aqjOjmHyo=; b=TKUc3u5NJmLsrMm16MLgU7IDXgpJKchb7AtQzVhwM0oZujkx3wUHBwutcrPRishFUh RNepU3ZtaGBtkrBgZ/IwbfaK5vAZ45gTTA56vlp+AQuYNWjLg7PXgN5U5L0kYFqZ1fm6 SFbvyaTNRYHqpuJ5e0NPBREN1jJixk726Lwm7tZ8JZTTcALCI0X+qXyh51RoEntn4LIZ BVnfDA4YOmHClLPgTSmHG1364+cwfA3F9mS0mod+Hthr7t19gcdWXWnnt80CdxHFbBEa 1Sfr927QpfMgLxMseRxuorymaEqZsRcdjSk/63vQ4F0oAYxQSgwzAPeJSDryjuuRDCP+ ph7Q== X-Forwarded-Encrypted: i=1; AJvYcCV4KI5/lxPB1bP070DsS7Qbr0Ma4BLBn27+joTPwrzBn6i5kFT6DopE8qFOFDh22SSknBO5czxnYUPOes19@vger.kernel.org, AJvYcCVzp/JtNXoTTJg2NpUYmOVvB8NoVRX/2IhNnoZG0MNi1q9Vm1Bsndq159q5xW+MeH3gS/juLhSYEdY=@vger.kernel.org, AJvYcCX2FmM+Y7pi+TsL7RMa3XDpijWlJqJn3glQ5PI6M4DtSf3Z8NBLVSQDtL0wM+ZtmU3RieV0ear9@vger.kernel.org X-Gm-Message-State: AOJu0Yw7AtUYA2+p0CXx6HfLiINcyfvByBjnioEtDQHGVoWFC+QELRvL p1C9Y9rBTMNPyFB1kFKClD+PCEXVkpY1rqmFv3EtokdZwZ8oEWEFWj8++A== X-Gm-Gg: ASbGnctmBSDd7g89OvFM7PcVLg1x2jvS9UKdn9fg+qbPs0qICQQXJZ7/iDm3CN/C2lu mDh/rsaJkv3vWQzUwrK2X5kyzqOXomuYIV4MdQ1bg6F2mprQ50Ti9itjKaoTmEQzhCAwgXblj9C 3UIGPimZxe6Qss3ngEoWZ9vB1A2xTWO2q1eT7wQcgefCpO/mCTtoZYeiQsvxZD0GHq+9shyfK2l MQp6bmGiIYiYHpwBouApxU5NyLDRMNnL9hYWR75N4RGDH5hAB4q2XpbMtrXTdi2q5tIvVcUk9JI BoaGvhiJzWtw3GxYIElimCzseSc8b/NeLrhySDDkkBKLAzIAkv0s97tjMSPLC/hXECBZZR1C X-Google-Smtp-Source: AGHT+IHmoubDW9P2ETjDqsC7K3qF3hmFXHw9SUkYHnL5xErfM6jx1YI+AHtMsN6kaEW6V2VQEqXHUQ== X-Received: by 2002:a05:600c:1381:b0:431:557e:b40c with SMTP id 5b1f17b1804b1-433ce4ab227mr146124715e9.27.1732569384715; Mon, 25 Nov 2024 13:16:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:23 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:11 +0100 Subject: [PATCH 03/11] iio: pressure: zpa2326: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-3-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1140; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=ZQJA+VLURMBGAdorLGZr3GynZ4Vpg5VPwIUKA3mZWZE=; b=9/hfzbRch6K4vfgRHsXMjdh9zovBJWpiH1nMqqsxXysG/ftsJn9XywxJCRiuWrA/sDCkCj2z7 AJkzWm52iy/DoSLL0pNPxmsoKtcS9YCI7rW3CaU0pAxCNBP/0GXGkqD X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'sample' local struct is used to push data to user space from a triggered buffer, but it has a hole between the temperature and the timestamp (u32 pressure, u16 temperature, GAP, u64 timestamp). This hole is never initialized. Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support") Signed-off-by: Javier Carrasco --- drivers/iio/pressure/zpa2326.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c index 950f8dee2b26..b4c6c7c47256 100644 --- a/drivers/iio/pressure/zpa2326.c +++ b/drivers/iio/pressure/zpa2326.c @@ -586,6 +586,8 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev, } sample; int err; + memset(&sample, 0, sizeof(sample)); + if (test_bit(0, indio_dev->active_scan_mask)) { /* Get current pressure from hardware FIFO. */ err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure); From patchwork Mon Nov 25 21:16:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885281 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+AfClmNsok8bOmgEhQAIgOC6Hm8F6SqrPttQgDkuKxGcp3IM4PppDdg79PGjb6fs+h7 nYJqo5CxtlQQTow8uYMnPVl8LByA3D7Tr1SYPOs75uyTT2OAfTcTv4rY0PlFcI+WFpl5 WYodwR3rt0L7Xk8k6pG2WEiLTVUD/B8zdw/7SzrI5x/eHCZbfEhIZJ6jgpOq/1fozeIo ewig== X-Forwarded-Encrypted: i=1; AJvYcCWWOmkD/851TJHJNQB3HSbyKr+KAaevgVPIwWvGqjw0jV3LLtspBE2VMFJAVzgpZ4sVC2CjpGaUzJSTwblO@vger.kernel.org, AJvYcCXXiwlNujLyI2iVCnZ8bXe3v0PacykfKEOPk/h7d4GcROhUj4PqYgGdh6rEbKUd8Lq3ZjxTR3Yq@vger.kernel.org, AJvYcCXXwdAtEUalh3t2K6gcqN0xXVZZkAg/Q0N5Z98dlfQniLA5/qYjKfHWSlgo0shBhREnrJcxf57c+oo=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0cTB98SSp1Kdn/gB6+ko7otCiDW9Winm0wSkmJpdBzzgy1w1d bY6DZ81sop379OmMQDn1ztT2rhmoBvmJi3G/53UtTX2w7bfxVPQ7Sgg1fQ== X-Gm-Gg: ASbGnct/+iEpaeB+lPgx9YTquPUCvpR8XL6MAQAAtlCwanLpAoj8zIon4g7m9uSQwFA ZWPXHlY/NkLi57GCU1vod3bClU2qYWCxiReCgAf/XaVtHE0KeoGYBhWwHjbeBotQth2TNhFIKRi j1END27KbDhD0Q6VkgSWsTZ/w3X/yvnwWB7cmcVv+eDAfXbqRFCk+KcPFgmck2Dix46o7HPGHDA 6qi2z6phLrid8Y0/QHdQHalgf9dj2UYr/H4visfoMU4G+ddbtc9NTHKZW6R6mOXrMB42KZwDRYg xm5OqG9UiVms6Xt79Ymzply+JpuabmyiNnrOGHQOwvn9PV8D1O7keUDZ3aTnqghbau45TYvh X-Google-Smtp-Source: AGHT+IGXvo6/HesWOJo8z8xBQeH4nF3NPR3rw/5EfVOfeXRbHMQBm0koGCBH4J6+3xyx01TCHHWWKw== 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 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , 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= 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 --- drivers/iio/adc/rockchip_saradc.c | 2 ++ 1 file changed, 2 insertions(+) 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) { From patchwork Mon Nov 25 21:16:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885282 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 7ED7A1CDA2D; Mon, 25 Nov 2024 21:16:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569392; cv=none; b=Ha/TMULZhhdY3Q2VuovRfnMY/O57/ElAqxSwkA+AqjM1M+XRYm95u4PV3aWT/DCF2yhkREBQYriMpTSZXe3upXBHt6D8ClevPd1KtgFPF+Eb2ypUdJHIp/4Qs/TEj3a8iCr/7odR+s8Pk4Tw6EZJqKwBqEDH09QM21eKSzF5K5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569392; c=relaxed/simple; bh=yUgCJvosTa4JOZODZtxR8uq+My9nqpZdZPNK1vA9kuc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nFChq90Yasfr1BK+wMtcCqVH69d7Wiz4GOJ3Czi4nG61YfnhbBYeKgMXPpjOSUmvN2TKJ1kjbyX0VJoeX9Q/+OGh+5g9IoLlBPrDgV/dPmPvlvkoawHlXeHDpkKGM/fCPEGuoL6+MQozGqVF8yRHXW/XkwQ6u7yDdjG77J3QzSU= 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=CNqWj3PH; arc=none smtp.client-ip=209.85.221.44 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="CNqWj3PH" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-382588b7a5cso3137878f8f.3; Mon, 25 Nov 2024 13:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569388; x=1733174188; 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=YPd0y2aeGCf0Rzl84ovn0S6mhX5mrN9n6+Wgz6aaJgY=; b=CNqWj3PHouelqB62Zp6qAyIS+mlXbnCx0E8ioqFQvT4WhfYEHS9jISYHeAE8ZciT7H AHZBx4cw9ysRbvkED/xj6j7rEgphxBXVR+ROqVCYMOCQ+Lj8rRwKW2JIenemxj2oUsxo Tl5s+E33lI4KLT3XwHFQuo8Hy0NUqUWt4eBGbnVlLH6OkL5gfEbmgZuyDvXJtK03wkC/ 4iBS+aRjcPURNWP3Bqdmy7egWsg2sW06AnNtFL2Yf6h8Q160zd1+eElo94gc0mRtNvN0 pvO8FVvWLePoiocbo6qVYkRY0b4xxCrstOMCN95pTSC/wongAdWN190hZoO5wOalrpA8 Q+Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569388; x=1733174188; 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=YPd0y2aeGCf0Rzl84ovn0S6mhX5mrN9n6+Wgz6aaJgY=; b=dePqaS7VNgifeB50aoVcNwBqlbPDAs6AGNgnO8lDsu/aG5rgc3mQh0B45TJHpiWyMD /VxscGElN1ylsDfUywIrVeuvOdhHEhrvfv6jFtVj9n/7/9v5VbrxOKejbTwNZTph9eQM 9b2TdgZfraXXNfO7yLPDffRaytI6BVcXC049tZOnS9a8BE3lLqfKxZKutZhRnBjMiiGh ou4wtZqr0MoOdnwJqo15YQIP7ecysINPpN7yzfrvC7ptyIa3rbAySOBsAc7hyOcIkacU hp4SPEBfxEjC8NPBhZqQy4Xsy/kk6kigCQZTjxfGj8gc60OOK/+aZ6AbXCbg5s+E8jx/ rqeg== X-Forwarded-Encrypted: i=1; AJvYcCUPiSbgnCbK+iOcrNm7Z/4kqFw5hT/WM3f2xEnkbG5g3sPpW2uUd82xJqBdHdzVF4rigyDejga/4TYEjCxj@vger.kernel.org, AJvYcCVdY7D/2lSWjcH8zwH19VE6HILSiYCxLGlbGj5eUamJIwlTaQ6EMqA4aIln6XnNX+c/7dPA3z9gXN4=@vger.kernel.org, AJvYcCXgShbAjDy6cNtvkPgfYyyXNsGtTffw7FyzfwOXqnlanP7yeFK0tLzM/8q71caLyQB41288SWRw@vger.kernel.org X-Gm-Message-State: AOJu0YwczwjnXp7klwIedGG/HMTXfNHu3OZ7f3SJXLmqd7R0/DB/WCCe seXvOljIsntT29vZqM2fyUuO6wVXTCevxshZZai7cMkJLxNvAzDt3tHmdw== X-Gm-Gg: ASbGncsKb8mcOgZi0h8pUIk4pzHO7XTHiEcUZQsKFaxUigenRTIWiBUrW9axXVlGGUl TRgV9LAhZ1xr6Dd0VRomsPEEfXC2LiSJnwjnw35fR7ZSGRQFfJj2Vvx5i/e8lbNws1/WOBxg1IR jXMtpclWD8Zt6mNsPTfcpMD6HDlWNZVeMgiqSvOdh2dnAZky9icKnuoewiD3SVPVOUCqOz3o7HU TnEGZKo3qF8jQEdTxdQWB4Tppm7epOeTIwUuu6zyZcAYAmIfWt5gpskccrh4gKEtkzWydhNi7rB FysikTG1/7yrd6w48tPsDjRV1+nrxkKRIVEOXelHWdLC51CEniR4m6dD1h+G4qwKw5K8JevW X-Google-Smtp-Source: AGHT+IE7AAOUeugLuKHibseE5VBHdkxT20Pvqrgn0609G0rezlgLj5maHRmvPZ1bFxKWh5ZMO132Nw== X-Received: by 2002:a5d:64ec:0:b0:382:5129:9f2a with SMTP id ffacd0b85a97d-38260b4d621mr11698251f8f.2.1732569388409; Mon, 25 Nov 2024 13:16:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:28 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:13 +0100 Subject: [PATCH 05/11] iio: imu: kmx61: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-5-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1044; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=yUgCJvosTa4JOZODZtxR8uq+My9nqpZdZPNK1vA9kuc=; b=d1F7D2lvMoSuwPfHrgAZ3qito5cDnDji6CWxSe1fRWwMxCZAW+DFFtvEh7O00SfYiOmPKhPvb /ZLTZAOMpXPCHI8BH4kARL11mAqhTB6FJWHILvK3wbvUa2IWK9VNrUU X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'buffer' local array 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 array to zero before using it to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: c3a23ecc0901 ("iio: imu: kmx61: Add support for data ready triggers") Signed-off-by: Javier Carrasco --- drivers/iio/imu/kmx61.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c index 324c38764656..e19c5d3137c6 100644 --- a/drivers/iio/imu/kmx61.c +++ b/drivers/iio/imu/kmx61.c @@ -1193,7 +1193,7 @@ static irqreturn_t kmx61_trigger_handler(int irq, void *p) struct kmx61_data *data = kmx61_get_data(indio_dev); int bit, ret, i = 0; u8 base; - s16 buffer[8]; + s16 buffer[8] = { }; if (indio_dev == data->acc_indio_dev) base = KMX61_ACC_XOUT_L; From patchwork Mon Nov 25 21:16:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885283 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 07CE91BDAAF; Mon, 25 Nov 2024 21:16:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569394; cv=none; b=su3mOZwSuW3zVk3oblRKONQo+Hm3qrJDIsQAc0nLbS+UVC8EfS7/su1yL/eZ4KKgOtfnqyzt+gq2pvC7eYnhILAWggJ1ddP34gwyNcll68EuAnyqi2dUgFVw9OQMYdp3R+H/+KM8weW0fG3juE26wu7wvaxOMk2rWuSgZHW29BU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569394; c=relaxed/simple; bh=ldmaC1AaPS7VUE5TDQ6XOl4U63X+5znOut0PR0QpWlE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CNIEyDQXScl/nKXVco99veQy23vbBiFLuPlmlBr7qZaD94KIu46LGtjEXuUibbhq070k76TB5C+T1ecKJ8GAAaQpg8hi/YQ9xb60qIDPm/nMEROV7NSKBCH+xdz7It0/UZZB6BM+s7NdKFAyxiuzwoo0OTEF2YV+iGppZIG4cP4= 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=eB68AS5b; arc=none smtp.client-ip=209.85.128.51 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="eB68AS5b" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43155abaf0bso45553595e9.0; Mon, 25 Nov 2024 13:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569391; x=1733174191; 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=gEfg9Xh7fWO3QvY02FKoZb33tMiR/uiIjd1V+C7lNVA=; b=eB68AS5bQ0/UmdCJoZPt2f9HOKK9cZVEr2epGzVZMqCpYgLtcqRxwQDkv1UULFFtPf hOXNu5CBiodV3JQQE783XXYJmt6mWHTifAZZZ1c1WZ0wGC8dOo93f2wE4BqPbfRif17t Ncs0f2HZFwWhZjr7ezVxpG5MhX21S01KjnQmk1O7q5N8CR9jQphQtdL79aFD/KZwtzfr t4bVuI26nW0fgf6+kncNBp/93hRq9c9L1bZvTtVlnLhR2/n7sTEmSHXmYXM3oxy1pKPA w5wSqhlNB/YObojiRmQS16DSEWXn2ieBQLKYbxGtAhwSeousrHO9o275kDtOTqcfm1MI tVoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569391; x=1733174191; 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=gEfg9Xh7fWO3QvY02FKoZb33tMiR/uiIjd1V+C7lNVA=; b=WTAzXnEsVbuL0EgH3T9/4Mf1eexSvnMZNEVyYv5O738sjkguDmzV/ystbODZEHGl+k r3kutHvNPGLXcXtjrNq+MNrg4vS6WkAnwmm3riIvWKY2pC45nkqp9hZazs+jGfJEb2zm uvN5ANfp4VcJZSt5h1FZHljCU4xnsUJ455cWluGd9raJxxsLXmHNC89kayYNulS8Ty4O 2lgPJOh9fdP6NtuA0raZXURWfDwxRfqWM3HobeTQzomnam3Eb+fl/A1dJeDc0L9BFZb4 KeWPOJiXXgeRYkaJRkJsUqag0OWAkpgX5GoRG+nwvbAVIJV1Z2vvoj598/eeIhPD0t8t PwnQ== X-Forwarded-Encrypted: i=1; AJvYcCUETsQRFC3gjYjq2jzvHtieKZrx1G+81ivNChFSuUlPQ+fKDUGyrS4C3RlsPldmya6PSxqtvFdji54E2JIk@vger.kernel.org, AJvYcCUUiYnb4l5uTQIxZsFTpQdqNvKs3skNba3fGs+m1LWwzRZoxy+GB8UNDVw3S4Fpdklk20OAwN0UIJQ=@vger.kernel.org, AJvYcCV5VTMQMuXNFf4JVqJyCZf6silPK3h4uqndxXpO5gziHHriPrnWB0YAqNiFwuxRsP8HIUt1svMx@vger.kernel.org X-Gm-Message-State: AOJu0YzxiGuW2DVWO5yqkpvN/2q35S7HVFKGUP/xzO1zOBhjHkBqBD6v TOxSySp9JvR/IyipS1Lyhl45gPzj90+svHh+njTavokG17cLtaIR/NFiOQ== X-Gm-Gg: ASbGncuiaHmoZ2uTo7IfnrTL31AHFQbeUVuNixAjO8aHt8PYoLkO32oUzqH1xcMxaq4 0vRl9mDQx2Fj/jFo9Z2leLSFGV90qLS3tlTNKlrCPEIPnkwJC2Pn8+uH+pgrMlepRC7CHl3HIyo HGuK0e/U+LN1qihl7EiQ5KCYOKQBk8g16d7ODdi1MEAT0mB7km1YHLnpnh1OUe6KWMIGC7/tHRs A1zY6FNjA/OuzQNjhqi80vI7c8/LKFkMK/7GM+Isjqq4+/GqYFLZLNhR2n9OM4BJf/KNRDqxJV0 FjcMO2WUkEiK7FKqXkgyeLr+g+NlvyuEDFheRXJDiUOyf+8/Bb3EDBakwdZklwYd+HmFubEe X-Google-Smtp-Source: AGHT+IGihIgvKakj2kd3HraoKzj41H+QGMaEpHFUd1DnXNAHZ7SDNk1bhVlwFbvAeK0VIXrOJtPtVQ== X-Received: by 2002:a05:600c:1f8d:b0:426:616e:db8d with SMTP id 5b1f17b1804b1-433ce428f89mr140833505e9.15.1732569390669; Mon, 25 Nov 2024 13:16:30 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:30 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:14 +0100 Subject: [PATCH 06/11] iio: light: vcnl4035: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-6-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1370; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=ldmaC1AaPS7VUE5TDQ6XOl4U63X+5znOut0PR0QpWlE=; b=AQ3FGOpdUSCJnkM1OMJ4NlDa+CCQ7GYAakX9ehZTX4rmx5AM540NDBVqj/POAChWHrUeVpwZo +zUI9lwr6w/Cyx6ME/D1kW1447JQIvwLXOcdDzD0H+pXovYUL+W64J4 X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'buffer' local array is used to push data to userspace from a triggered buffer, but it does not set an initial value for the single data element, which is an u16 aligned to 8 bytes. That leaves at least 4 bytes uninitialized even after writing an integer value with regmap_read(). Initialize the array to zero before using it to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: ec90b52c07c0 ("iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()") Signed-off-by: Javier Carrasco --- drivers/iio/light/vcnl4035.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c index 337a1332c2c6..67c94be02018 100644 --- a/drivers/iio/light/vcnl4035.c +++ b/drivers/iio/light/vcnl4035.c @@ -105,7 +105,7 @@ static irqreturn_t vcnl4035_trigger_consumer_handler(int irq, void *p) struct iio_dev *indio_dev = pf->indio_dev; struct vcnl4035_data *data = iio_priv(indio_dev); /* Ensure naturally aligned timestamp */ - u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)] __aligned(8); + u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)] __aligned(8) = { }; int ret; ret = regmap_read(data->regmap, VCNL4035_ALS_DATA, (int *)buffer); From patchwork Mon Nov 25 21:16:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885284 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 04C201CFEB5; Mon, 25 Nov 2024 21:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569398; cv=none; b=pZp1722myIn6TZRRJdhAWDpqzLDA6f2lMxlSk+t/ocIjx3NXP/db8VeSlTiZPTMYGmYynXvCp31HAWKHWJIDLtoZ3XX9FmcIuChzqLvf5n9y49HtKMix4P0+9GITlEw5bNbV3w5kSUaGlc+Q6tWfK3vOzBmIpHo3lqiPwcL2tZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569398; c=relaxed/simple; bh=hSZ9D42DCXdNXSk9Db3zxAJgqStCJbsDMwY5Zoj7h1g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cgz2NiaTDLh02XWqLMsXzknqlIP8Aw5YquhEzE1zSr3LkHbkVy7QqmaYcMVtjgKf1Sn1gcRQBcQIAhFYHTuMAQU/cdUyaosIXRI62cRhGPBs4+AnDf8nSeAIPHyGDWApy4vZvQzaLjROapaVE2YGNPzzPD574E109HZ7O2+cy1Y= 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=Iix7l8OF; arc=none smtp.client-ip=209.85.128.51 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="Iix7l8OF" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-432d866f70fso45572165e9.2; Mon, 25 Nov 2024 13:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569394; x=1733174194; 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=L6u1xUoxT7/ttVgdl3+avnneACc+sS9I57AHCvaI6dY=; b=Iix7l8OFvjt89KUU8NIb/w32R6qreHx4AB7BQggD0BkFey1GSuRlGYH5akDlkyyfOj NhFgUJfJJ2OrK07PU7V8EdPJoe9lEJfn100h6iTJw0gwdESl/I3RHWAd6SHqUatB70Ju GutWLUktI220jQHjPEOt5swPfdRw+Dypx3hGVbAyewXxFdpCeDXRuqQPfiV/M6kYYp1x QZ05+tUvg7zoT0bLpSZTGYoU6BmyQl+mvTwHQcBeWC+8WJOYOXwLsiJY/V17NvoI7LQb /j9nbBBofSWcI7ijZn2yWKJ4WsgcrblKVYXZrP8UdS5C8GuUeYyMNusdmcFxttYfmiIM b8aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569394; x=1733174194; 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=L6u1xUoxT7/ttVgdl3+avnneACc+sS9I57AHCvaI6dY=; b=qIzpgbjaBchVX4GgXSyRicSdXSCk9qCc6C1FIc4H6zrV8xKWFvUhYC0vc+krpm3wF+ BeCrTVSJXO9lhSIkdgkNIch9PrbWsme9j4vRPxVsI8DpG3+4bG/G/W8XTPwaQiEMpyuu M9OHQirBlkwfpfFJq2gKMS8PjjA+ipcKCJXq9wnR7ge6zwyTjQHRO1x6xCEnTlPmgtJj nLpr+I0BuNjkGSXCidZB+NQ2NKP5ZKKjOnmjG4EmxQ76gvXQt9Nxsyga4ZnOA5KY0LN8 6G7PW+hnBXzL9YPFPADdQu7Q8x7mPEgT0jbEv5A+JiCbTjIJrv0FqhDS/EwPXNnk98zA 4k7w== X-Forwarded-Encrypted: i=1; AJvYcCV/UVGqxQYd+oH4l2MDc7Olyw7xrsExsG3FZOHTqlDMFU+CTA6j/Jjt+bM1ggYOvPkIGeUX7EmLNnc=@vger.kernel.org, AJvYcCWdM6DxTzUNAo9W/CoLOxHEiz+nv0Yjq2NC0YBQNLzl2gA9neXmBDUEFaIhThcvA7oG5kt8oAFSzq1vl+X5@vger.kernel.org, AJvYcCWv2NbfZPjr861zmOJtHnhyizEyT5LD+E6jNQ1vzuLQd4NsZQOtRQVHywh3sTH6C2eUgnvDM4NX@vger.kernel.org X-Gm-Message-State: AOJu0Ywm6g1wTgXj+o5LtMVzuK88oxHs68+fsFEZkiYLfxL36/AW9e9J BWFhTC2MfMwtE5aj8RrEKcRNX3t7QnxLnCXaEJ/cUOklcwAwDk+xuE8XhQ== X-Gm-Gg: ASbGncuCDhygANcS2xMqgCvNUc8SxARNh5sZn642uKnptylhNhrKjrdMlmgHyYaZNHv NFg5tTi70j4F53ZtYBqaVly/VPMFTkrmyAh/WXp/vYwFh3yjd9bcDGfE3SWZ80gV+LDytzbxDTP kPaVULkjS5rh42itw0mTvFWqdO8fqVSDU1W+9SwzrTxPjVvL8oUc8772Ne455x+5Kpoq6qBhmmO PQoEE4NK/Low/Oc+15YaTHjlYzBooE3kwB8dACs91KjN00FzSV9I8BbCik0lbiKrG2vCN2HTIt7 SAEi2iFRCVcsYKZKiSvrae0QcldNJynLQAN2Z1sJPxjAhOmLHRpoF465zQXmUGkmgvFiD9yK X-Google-Smtp-Source: AGHT+IHXtGM2OTKff1J6AaIz33hnQz/oEeFuiMDpyooLhA2F6i/f9BsEYwTMX4bOWfhUIl22zDB1Mg== X-Received: by 2002:a05:600c:6a06:b0:434:9fb5:fe04 with SMTP id 5b1f17b1804b1-4349fb5ff09mr36454615e9.28.1732569393934; Mon, 25 Nov 2024 13:16:33 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:32 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:15 +0100 Subject: [PATCH 07/11] iio: light: bh1745: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-7-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1030; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=hSZ9D42DCXdNXSk9Db3zxAJgqStCJbsDMwY5Zoj7h1g=; b=Y9aFJiGStPlIN4TBMvX/mUUwKdt44sEwf2i5wpLeVTHVFa9XflKxxn2XHxHuDZUv40AguIyku Ufc/5GWyPA3ASKt3Z1HIye92Eeo2hJuxtfMG2VEJCVR6A8p85z9nQfb X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'scan' 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: eab35358aae7 ("iio: light: ROHM BH1745 colour sensor") Signed-off-by: Javier Carrasco --- drivers/iio/light/bh1745.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/light/bh1745.c b/drivers/iio/light/bh1745.c index 23e9f16090cc..2ffc839c7501 100644 --- a/drivers/iio/light/bh1745.c +++ b/drivers/iio/light/bh1745.c @@ -746,6 +746,8 @@ static irqreturn_t bh1745_trigger_handler(int interrupt, void *p) int i; int j = 0; + memset(&scan, 0, sizeof(scan)); + iio_for_each_active_channel(indio_dev, i) { ret = regmap_bulk_read(data->regmap, BH1745_RED_LSB + 2 * i, &value, 2); From patchwork Mon Nov 25 21:16:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885285 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 6A9F51BDAAF; Mon, 25 Nov 2024 21:16:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569400; cv=none; b=JRkP+c7uMIIq1AJx0+4Al/1CVx7rA8gdApoU8ei1994M88yVphnleYFggiUeW7mjSqo7PvaKfnrzrPWLyrmcpCr5FstovAtfvgbc+YGgx5XmgmHoCyGByTsztvw8oA5qxweXoZfxfOPHJJl95GKdld7nIvEdoPZ44W34xt3XVEU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569400; c=relaxed/simple; bh=MnJLJRBd7l+61UU+1kkKssT/cMDRYTwrBfUB9O2sPzs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dUeQ6Qbw6C2hsCs9fcRVAiDdVqrk3qZGaWe0oexP2KQJalkSmSh4xBbFMYh13dInMmbZjI4XGmonkZxmnEk7UueBmxH1aeB18e9n8i3DaWE3JGxcMmJnIy7F3yzizykMdD+6l1KKH1owCqWm4+sf5t0F0aTmFEFf4e5YG0yYnno= 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=GVbCIC1h; arc=none smtp.client-ip=209.85.128.45 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="GVbCIC1h" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-434a2033562so7358045e9.1; Mon, 25 Nov 2024 13:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569396; x=1733174196; 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=P9X4xpOgGPYzYDpEftMUld8E8Sy48bF/slktKFCfPG0=; b=GVbCIC1hcZG9GoM02tG2WGbCtIOpLMjOLX7nDKwpI643vU2KHFa/NRdNTD4W0KDONo i+h6dbgzD0JFQMSyZvi5uCDZs8tpcYk/I2msIlpibGPVYKgsVQYt5p/4Gy4tEBy7WeDo 6dNoP5O9DoqCugsDR7T5dpTpj3qNZtLYBNagWEt7S7Vgclhwx0/2/hfSVNaFCF1u5MbH zHykYrbPcrXCcRPoBBRImffElUgX95UNlX1FabOR+vrewpKeAWkJ3gEposkKr00zcs5R IPUQ3kojjyQaI6PzpFb1eK7a1ebppkxtdlwQXxSdJWXV1258c8agK1a4tLE5h4aUTdMC 9uLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569396; x=1733174196; 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=P9X4xpOgGPYzYDpEftMUld8E8Sy48bF/slktKFCfPG0=; b=DOzJ+kuCmf4UGdYit79+Mf6YlzH1+lM5dLFF9K+zHmS0CfvaDVqxn4Ra7ii1dJUbIz c4J5Sz3ssioxGmVe0uWEZkxVTHQf9XUDP88jbuWIkUkj848pJyXbSppBbXNIjSB0a6by xXHNAJVApPeqWJDRZa+iCJd2hMhBSUYrhqXB8z0Pw4gKnd0gIEYjZXrHlkP63RfVlnLC WwpWhKnKK76q3Or+SuCbUIlrQWuc8Qr1IHLgyvRy5KzWNU4dY2WKXaQ+/IxeagEum8mL 6QGIDyjoRcdzIJ65VYUENjg8O+arwbFxxTnsksJa6mcqIFrbBe8YSBCj4gQ+MU72Ulf2 klaA== X-Forwarded-Encrypted: i=1; AJvYcCU5aeXD9+ksn0qR+sjHi66cff+SnIX682I0on45ApbK1PqqBmBUu9fOfoiXqBj9fnc8+L6JebK3aOE=@vger.kernel.org, AJvYcCWXCdJ8l4Z17tngBTiDdHx74r/+b22mZc3Yh4EWwqWUoNvrny4VQH9b2nUY/TgVwfMOt29mE1Tl@vger.kernel.org, AJvYcCXKErpO4clzw6KxZfuJA30sjQHTOaSs3fMpcqDU2X8hwHOU9IL/NX0W8Yct5dWZLwjp7855F/kRz1GqPa9n@vger.kernel.org X-Gm-Message-State: AOJu0YzDdp+9bF/Ce3pZd35UPJx0lpFCIa2OWdU0ilpfQs0wGC9HZYYh kE06g4QPQX2Tx/vQ7Cj7wE7vL7vuxPfrMB7cTN/YjnhP4qa9YOE01UmhBA== X-Gm-Gg: ASbGnct5ztuCk+9K94jNEFwV82DwznT+YdauOeKzxeMcJh1OpxhNrdjXg4X0VZVSGQK RTTzc4W4pVbuZFJ+ef04E8o95NGv08mVbPdhg70V7Iha6mIQin9mGSBVxvojqZf9ee6EJ7p607a u3/ftV4yuHAQla/93a9qrlvx3zSefecif3yYQapC/UHDidnXqmWeV4H9GKpM/LfZmZv8DNZWQLf JOolrrqXmVjEc+YlEISLWV1e1ct+HgEiGBnQ34nUEezUnqPiOHRMu4VoFhe/clquBKmbultmIai 6ys4LDn2jbx2ggI9kur2EOJCGWxWkt+IpJdnq6+7z2ZMV4LsmK+5FRwHGolQnCiJwt5RE6ua X-Google-Smtp-Source: AGHT+IH85+4cYeAFSxcCPnqfbJZBrM3ZYDfEucQPDUQs50gVlOcqLQZaVbU1W0WwOcF9LJ8T9tu8dg== X-Received: by 2002:a05:6000:18ab:b0:382:5066:6f38 with SMTP id ffacd0b85a97d-38260b67c52mr11652339f8f.23.1732569396450; Mon, 25 Nov 2024 13:16:36 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:35 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:16 +0100 Subject: [PATCH 08/11] iio: adc: ti-ads8688: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-8-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1243; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=MnJLJRBd7l+61UU+1kkKssT/cMDRYTwrBfUB9O2sPzs=; b=pda3qacHR7U9b1xq5j3B+4bQ2bjGN+KtxMv99FQdm+9RGDI1Y+iwu0yTQSiK2uoysb+2PmA8E HNWWhVm0oF7CQ8Ng3ZvtiG8ytIklVGNvT2MORfpxAZCMamnbqjfqcfv X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'buffer' local array 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 array to zero before using it to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: 61fa5dfa5f52 ("iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()") Signed-off-by: Javier Carrasco --- drivers/iio/adc/ti-ads8688.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads8688.c b/drivers/iio/adc/ti-ads8688.c index 9b1814f1965a..a31658b760a4 100644 --- a/drivers/iio/adc/ti-ads8688.c +++ b/drivers/iio/adc/ti-ads8688.c @@ -381,7 +381,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p) struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; /* Ensure naturally aligned timestamp */ - u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8); + u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8) = { }; int i, j = 0; iio_for_each_active_channel(indio_dev, i) { From patchwork Mon Nov 25 21:16:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885286 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 780111D4169; Mon, 25 Nov 2024 21:16:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569404; cv=none; b=AZ8/TkIZhan4VeK8e5B2rDCpm4v//KHJSEaJ3Y2yWhy7vnZ0KtQBIyg9hhu573hKcrJkfxzGFvSodcb/M9OKFhOZ6PiFrHFaq+kXtS2uVQNLmYwLyvpSn+7l/jm49ahzg6P8kTocgetcnQlQueIfM/+T9U3IQLbyJxUg+DnPOgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569404; c=relaxed/simple; bh=A5f+hgxSFBau/J9wGch0+bL5gusNzvwM80QyMwDLN+4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hwY05tneMkOio7VW2g8TCq1jLQOQ7MfXhVawhhPAU69qdYsuB6xStF+meoDBNZ4azF6/tEO3pBDidvNb7jWQd6u3p0BafDIb7DokRRCIPLWsJts4dnMV9sFkudwB7Q3rTLbZp6137EvFhjoasRpuNJ/Ay22yihuuOc00E9iKRc0= 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=mK/RSSWn; arc=none smtp.client-ip=209.85.128.52 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="mK/RSSWn" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4349e1467fbso13700335e9.1; Mon, 25 Nov 2024 13:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569398; x=1733174198; 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=L5uJPBz6TeglXeo554KOh/VAk2n4YGIIimy93nEytGY=; b=mK/RSSWnuYm/b+MUwkqrvicvFYnKDDgQi+IKG9GN2H4EsAxEBnq/nvwhSxhrOucSDN pqlWS23INW18FwRNZMF/1Td5pbAFovFXFyzAePk0NJANGxux8FEKu/6buWJlOMF9C/DE U4hleaBS3Q7kD08JLL10CozpvUROB3uKc40rpvYwjdvgNf+mEa5rc/dEzsZJt7kJR0s9 jai2xi/0P+TcquIHorJxKX4IoQXnhpWpNzAaA28PAb/7suFENypE0X5g+Z9+gllopD83 NNFvGq33AuKJCMCQpPA5QJBS6b6zuNDBVNZWrp3XHsyCgy3P5lPeb08Btz52LFNj0ExS BaKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569398; x=1733174198; 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=L5uJPBz6TeglXeo554KOh/VAk2n4YGIIimy93nEytGY=; b=TGZAXgix0xhzW5DPvFubkR5Tza5U/BDkx8ZVsMHGjG8409dKlptcHIXOGmb7tPGIJO TcpOkD9qkCnZ1okcuLfcsOjqGeBmzdhIOWbpBe4QQog8Z/Ra8MKuCnzFSzG1LUy8dSgQ S4/THAeXPUjj9Jn3hsUAh/5H69+Atzf7BggILb1dvnWmaEcvKleQzKdz9bKYUZmWuQTq moxyTCoJVqNUjs8OHHla+YLeSc978Z+NSpyvF3ZX3/uB+0Ae3+kWbc7mPtMuqWGssSYI aFe/KJ7D+pRoTodjFeZeJ7BgyBuWuj38Jwu7L5s6++b783FRceRAkCirY/i37luDYr+X 5JJA== X-Forwarded-Encrypted: i=1; AJvYcCU7iGmTcSpQh3OYYRreVQPu7WdmvmZw7/H61cJpiidsNtLLnjagycutUeuwFNszXNeb56FoNJITyXfzQUjl@vger.kernel.org, AJvYcCXY/6qlvzIoq9j89MD2hxe17M21uAC6ZVgEr+tILn5yTc8WHRHIgkCiYWOs9kWj9RfTphwMf3o6H/M=@vger.kernel.org, AJvYcCXuXKeYpFqxHhgqp0tkYZPNY2X2CtoBxv4ELj7iSNa9DOznmLGTq10gtAlRSmjNbQKIWqFRPNH5@vger.kernel.org X-Gm-Message-State: AOJu0Ywdzo47m/Lz2SJpmqpvVW/Ml2mFOFN93ej75gnEZ2K4/Z77kvfz ZPEt43UW3aEv1U1ZVOxhgJXNITP3SYtAsFfonL4aGOezT0ldtkrDrEJgOw== X-Gm-Gg: ASbGncuHq/kh8pKvzD8ZiSoy4l0M14c0qRDWgAY0cI9lM3KNW78395c2x6DndlPN+Bs qfhjgF1YWg3rhkbcuRzH3qc9CitMzHog06xkWwtO+7B5jvJuJsK4dLVaxU/gOhK4BgxyzfEzsjt KK/svxB9Ct2p7YJVcSnoau5930ka6NS9MdwirK9cfWBvIp7e2Eq9L4PSsja6gdR/v1swL8YEZl5 B0fj6MXQLkQQf7iVzc6Z6S4lVWHLn66RFKzBRc9VRT9FDUDbhEz6Us/FVwJZQSY9pPT/iyn2YXC 2V/VogWGYH+A4QYPON9kKHQSJdQQsAfCIvDR+eWtt0yextSvGQXUHkF3KsBRfQDqLVWPYgXO X-Google-Smtp-Source: AGHT+IHyL+p8dJwHNZ6pwWMnP9g4uOpLQJodr/tba4IA/05FdQxOb+l1atdGAnpia/bOa9lKxfUeEw== X-Received: by 2002:a05:600c:3b12:b0:432:d875:c298 with SMTP id 5b1f17b1804b1-433ce426968mr126557785e9.14.1732569397764; Mon, 25 Nov 2024 13:16:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:37 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:17 +0100 Subject: [PATCH 09/11] iio: dummy: iio_simply_dummy_buffer: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-9-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1121; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=A5f+hgxSFBau/J9wGch0+bL5gusNzvwM80QyMwDLN+4=; b=60Af4gaoutFmm+7Nqj9Vb5rRrQGetXcnTt7LgdWxF5fQVaLWcwqZTvuRCYIrnmYjM3hVHgnzq 2jqtOmCyWUXATrBeCgv5wUP+LkrMvtMdhCIg4KF4lPqLvdp2zuwzCUX X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'data' array is allocated via kmalloc() and it 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. Use kzalloc for the memory allocation to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: 415f79244757 ("iio: Move IIO Dummy Driver out of staging") Signed-off-by: Javier Carrasco --- drivers/iio/dummy/iio_simple_dummy_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dummy/iio_simple_dummy_buffer.c b/drivers/iio/dummy/iio_simple_dummy_buffer.c index 4ca3f1aaff99..288880346707 100644 --- a/drivers/iio/dummy/iio_simple_dummy_buffer.c +++ b/drivers/iio/dummy/iio_simple_dummy_buffer.c @@ -48,7 +48,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p) int i = 0, j; u16 *data; - data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); + data = kzalloc(indio_dev->scan_bytes, GFP_KERNEL); if (!data) goto done; From patchwork Mon Nov 25 21:16:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885287 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 DCE4E1D416E; Mon, 25 Nov 2024 21:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569404; cv=none; b=ZBl6Huv0I1yQgholyXB4ceixmpIc5V0Rfhy+iBF8FoHw7csHW+oq0g0mX5VQk8f//nsksIiDYycLtCo3KytVCXFeqXr554FLHm/WGbJBPGhmrlKowE8dSOoT1MADylmPyGX7EYILTSsrxAZgfcLgQTEv940cFlN2Zj11RLtSWwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569404; c=relaxed/simple; bh=jtXAVyyBRdegS3Ln5CG9DMcyt51iY4DFohUa5RDJWUA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B2JWFpqxzqo7udvQizrVD2sIPN/GfxrT3dl0U4VslcjxMm9boSSfaDaO4kIQQ4mSZYZsacuX9z5uRa0PpRsBNluL5FRwKw72EENjZ06BwXV8xYg6n09jfU9cvSQKUoCu46MwztI/QpV1mnZpPcxVuPaNLkir8W1uy+f6wrUCn1s= 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=CmzpGgDv; arc=none smtp.client-ip=209.85.221.50 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="CmzpGgDv" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3823f1ed492so3308652f8f.1; Mon, 25 Nov 2024 13:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569400; x=1733174200; 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=eDpYzw8j/kTAN6No6AZGY7FwWe7q/xbx/0O05mcvG5g=; b=CmzpGgDv138HG+mrnv0KnJx3tvKZL5MEQj40hxJjemwl8z1mKefgIDl8pJuHBgfc4W hvNja/Ndm4XcG9gOkMymgnv54vpzahWGhRF06ebtwOJBXVrYH4K1TUMPV7z+aPQbZMiZ Cnwo2udjvu62QsPDoY47AJYB5UPme+UiP1hKjwDaOOWau1nW85niXeB4JdPhpVryVnkt lvvKn24J6Zm9NZKzkKib+bpjz39xc1cnyvhTMstG18LNGfUFmeYnciXhkEfXhXrL2yx7 xAO43flXPcuG80szF1LpC+d0HaMaVJ9nfutdyyhpWlrY2i2qZ6f2qYfy+lQKAtRyeOga y62w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569400; x=1733174200; 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=eDpYzw8j/kTAN6No6AZGY7FwWe7q/xbx/0O05mcvG5g=; b=IUmFZnfDYykroISESlw93iYV8cLsdGgJu3Et7oEQhElufrP/bXS9/OAnuoQqglSpDv sngbdzN/weoAbuVaUWWAc2uTFvLKrJgcgmFcQS+EQEc1yY65QeHV7kjHVtUhRQr5MM+H +5p6cS/H4AhAUKvRvWJMs4LunBWj/WViBEBUMxgcVn0VneVBtdkzjcm9TUU+20a2XSTO EG9lFcqlT1EecUkf/Aepi3f1DdkQbJ1qBGrmJb5KV4Gz+1tGzceJEhLM4qevIagx94eQ sI5IFC76RFd0OXudzr+/RT4vSBF6Ea36n3ehu5lmA6jHAMAl5aFAhKLd5iiMoVbqTaP0 ccdg== X-Forwarded-Encrypted: i=1; AJvYcCVJBU4Yf23TyzByB9ztj+KkDqPw06pBm+SaHT59+Rrq5k7hGnkQJN3bqMC0K329xIjVDKpQWEA/c3BWntiY@vger.kernel.org, AJvYcCWgXGAUN6nwkb5kO35wwXRgPOTXdLUeDLHTvYRhhoP/feLj/y2ZKAHMrEZ1SknA/Q1MFGMVdr5I@vger.kernel.org, AJvYcCXOH0/+ZLtmKIivakDzXf0xhMeA2kdLO1qnPUVLIEwpKVKrt3zANQAA6P2JyFKGcgZ4LBlk1ZLPYqs=@vger.kernel.org X-Gm-Message-State: AOJu0Yy4W2yRApG4n7Dv3QkVBYGKfYheGo8BvolxOaPaNgbpiqcA3DKv stzsiF7E1jXH0ReiH2uqyLtVzMYdh5Il1uFRyb+ENapqiM4R27Z//JlfQA== X-Gm-Gg: ASbGncteFPPNyidjZ7nTMImRY0jXLnamt9hzrh1eCEDXVmkqFjuic7f4Bes9woGWtLr kq+ipVzcLBR69Byts6/EoLv3Hlou1MUXe+gFkmffGHZe5j6uYiWtd/24KdCdmFOfyXjXtG0AnXq Sxyg55e5uhljw8tZsYLIxpKLe1J8FOuTYpk2OcvAe0Ozwd/NjeQO6X/PQeUxvQw5tTyW+KnvrGv 3YtPDk/7Tw4ie+VoYOPQMPCO1UhXs71z1/ZRMgeNniWFpdvut8lGg3s8lEdtMguj/bvt9qcf6Tk OoB+suBY2YnEpIqx5yu3T/U/xqmFrDJkC9MNp+K7bgPpMwvOsqUnHahWiKVIyaxorGXv5iQN X-Google-Smtp-Source: AGHT+IGzyx3Cw7LjdhvmIFBKwru+lK0DGhO/zbiIQucQWbr9SWMIRfIlCpPvo0ULy/gqYTOFbl6ncg== X-Received: by 2002:a5d:47a9:0:b0:37d:47eb:b586 with SMTP id ffacd0b85a97d-385bf9ee1c5mr747324f8f.4.1732569399802; Mon, 25 Nov 2024 13:16:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:38 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:18 +0100 Subject: [PATCH 10/11] iio: light: as73211: fix information leak in triggered buffer Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-10-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1066; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=jtXAVyyBRdegS3Ln5CG9DMcyt51iY4DFohUa5RDJWUA=; b=WZ1QAn5UXThH/3PVorwsqsfc+8c8tznJl6iyhPVJTfjR69q4XK13euee5HATAt3WGtSpBj0Tl PccTq5N1HMYB1+Cf6AfQYER716DInkyrcn3viEWjAAYo3Zifxt6EuuY X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= The 'scan' local struct is used to push data to userspace from a triggered buffer, but it leaves the first channel uninitialized if AS73211_SCAN_MASK_ALL is not set. That is used to optimize color channel readings. Set the temperature channel to zero if only color channels are relevant to avoid pushing uninitialized information to userspace. Cc: stable@vger.kernel.org Fixes: 403e5586b52e ("iio: light: as73211: New driver") Signed-off-by: Javier Carrasco --- drivers/iio/light/as73211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iio/light/as73211.c b/drivers/iio/light/as73211.c index be0068081ebb..99679b686146 100644 --- a/drivers/iio/light/as73211.c +++ b/drivers/iio/light/as73211.c @@ -675,6 +675,9 @@ static irqreturn_t as73211_trigger_handler(int irq __always_unused, void *p) (char *)&scan.chan[1], 3 * sizeof(scan.chan[1])); if (ret < 0) goto done; + + /* Avoid leaking uninitialized data */ + scan.chan[0] = 0; } if (data_result) { From patchwork Mon Nov 25 21:16:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13885288 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 0A4E81C8FD6; Mon, 25 Nov 2024 21:16:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569405; cv=none; b=ij3wlPCuBKGnDOd0jUipAPNgJw9GYXzVKegFcIOOcgpmcQFTDBExaz2JqSVUL2T91MtLbp7Iq6D4hok58o3mYMVB8no2gNMzHTvShyvcpnGn+c9rbNeMhi8kWah3S2kaP4stzH0RQOTUqIZ/5viKq4+jWO+x7Sn6OHKLJkeDzgU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732569405; c=relaxed/simple; bh=vADNLN/wWfKGqJvUQhd1pUc2e9QB++sN3+4D9NpumMA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ef9u841F97G7JhkwVRWQ8v+CR/UFtsDFzlIkz0gwodsW4mtDWQ79z2aUeaThM1wJ/kn9GGJiEHz3z8zushk1cFPuNuCiGme+wV0DEIQDEEy+rqLFERtBIrsnIEdE/5xpw/evk4WoAWrUkvvk9ROMQdHDUW21pw/N/rxvl1rKc9Y= 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=WiQD8U6e; arc=none smtp.client-ip=209.85.128.48 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="WiQD8U6e" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-434a1639637so8972555e9.1; Mon, 25 Nov 2024 13:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732569402; x=1733174202; 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=As5aGrkOK7DaKpc42A89d6jJu2byOcemsiDPjw3sqGE=; b=WiQD8U6emvyPlnetcqSEX7aTJFS09NQMf0+di9G9KLfHxRiz4y4MAH6Sy3BeQyq5qS FfsGslsqKml0Jx+cS5VimZAyYFbVUmg8gwGSzSWCcvzmDDgrfJ8wG1nrvABS3SUYgsX0 0xO229KI7W+3rumWNRdHROTMWxRKybTliiKz80gXPj2vxVx1beyKspU5u28LQ4EbNI9M WD5cEQ2Xs7OiPamHND45z9I4y0z5em4iqxg5soTrxWV2lpACQARUS3ULzS43mkt1RHVl hFIKl2XcYyhhpdxmRRZY+e6ym/fhk8aSbYgSAMYE6CZ5i0aZoI7TWogad3tBc7qEN6E5 miFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732569402; x=1733174202; 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=As5aGrkOK7DaKpc42A89d6jJu2byOcemsiDPjw3sqGE=; b=uVdvYXFPMAeo3wOgCpk61zJ1aSqM66y9ItCXbU+KvD8JUblDVTWVrPp/caHiSM5UAf TZIMf4ONo8ysb2cGt56tCah3Q6bpPT4EmPqnkc7t29iaBOfUXAMuNrt/emNXdbSIoFcP txYNuio7UQuHO6rRm40xhs+0do2bG7IKXa09h+BqNn3YV9ZWp7VZMBa+A9L8ja0oCHi8 IeynFXSpvIIB8nM2T+wFcChI/iNUatg99XXjC7qGfFAHIXObj39vqYcFqWB6gHPjpK9q 6Oy4/gpdTUQb13Vqfv1mIChE7tLUS+yAe0O5qASsBYtnCOVSTxeC2YsXO+Pltu2ysOZy 2eug== X-Forwarded-Encrypted: i=1; AJvYcCVvj5jXzK7A9BobKj8xdNT3Ng7oGpABLZAq3Pwrxi3R1fMJPeNZWE9bs07+yjI0p2NV/eUKDwY1Wms=@vger.kernel.org, AJvYcCW9WixQ+Xh0kMFjRG19omOAUtOM3iQiLKi4LKiZT2fZ7uu5T4A2D5KWipOT3BdGlLxP2AZnbtpq5OYyNchH@vger.kernel.org X-Gm-Message-State: AOJu0YzHiHjduNZHcTPOhifEPUbCZog3wwP0Je9PJwnz+j/MqEasuNiP y42YyDc1G8/0ysA9DhDb2zCa5wSK7UmSEwpw/V8TT15aN1p/9UrD3CapxA== X-Gm-Gg: ASbGncs4N51j145J3MhXqKBGSc6lxYjE66LsOdspNstLc9VwUMroXNWnFk6Eu6LIACY dEjLNwa3juBOqhZapkvLh1UXEKdAfhcaMMrC4olmJWpt5YPki7co5ObjcGC6NAdEQA5zOWWPS8d 07+zLcMT3vliRAXdC0R8i3pMLk0Q2mM4erTwZSCpR2T797EPauiOMo5QPxLn8F3/4AJ5yNUtNs2 5+peRRQOfrTbKGPYMrtheVm8FSXMGqbWRqw36pfkQXjynV04aV9w43s1eiDyPXuCOMEBrxzN+8H mTl43kDczjAUPdfdS57hpHmZ2CgHX0fbWUijZibTB1J+6fzLPXDiBpoc7uaJ9R0nMc77T1du X-Google-Smtp-Source: AGHT+IFCQe2WG8DRFVTvJX9L4rRafxyiHPzi/YeizB89q0StbLa8q5BTHKw3hYRSoxjtr3jp5/pqWQ== X-Received: by 2002:a5d:47ad:0:b0:382:359f:5333 with SMTP id ffacd0b85a97d-38260b690bfmr10083144f8f.22.1732569402126; Mon, 25 Nov 2024 13:16:42 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 13:16:41 -0800 (PST) From: Javier Carrasco Date: Mon, 25 Nov 2024 22:16:19 +0100 Subject: [PATCH 11/11] iio: core: fix doc reference to iio_push_to_buffers_with_ts_unaligned Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-iio_memset_scan_holes-v1-11-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 , Lars-Peter Clausen , Antoni Pokusinski , Francesco Dolcini , =?utf-8?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Gregor Boirie Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Paulo_Gon=C3=A7alves?= , Francesco Dolcini , Javier Carrasco X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1732569377; l=1058; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=vADNLN/wWfKGqJvUQhd1pUc2e9QB++sN3+4D9NpumMA=; b=Fuhif70f+6JCU6NRL4OZ9jm1XleTzwxMqu9NwKEs7A2m/kQZgS95Z04emW61s1kJkYCujfCZM fV0hM7ZvWSSCbVwAGYTLeR98ERKKkwDwECUFy9wMQQgvhw2LYdMdmLv X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= Use the right name of the function, which is defined in drivers/iio/industrialio-buffer.c Signed-off-by: Javier Carrasco --- include/linux/iio/iio-opaque.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/iio/iio-opaque.h b/include/linux/iio/iio-opaque.h index a89e7e43e441..4247497f3f8b 100644 --- a/include/linux/iio/iio-opaque.h +++ b/include/linux/iio/iio-opaque.h @@ -28,7 +28,7 @@ * @groupcounter: index of next attribute group * @legacy_scan_el_group: attribute group for legacy scan elements attribute group * @legacy_buffer_group: attribute group for legacy buffer attributes group - * @bounce_buffer: for devices that call iio_push_to_buffers_with_timestamp_unaligned() + * @bounce_buffer: for devices that call iio_push_to_buffers_with_ts_unaligned() * @bounce_buffer_size: size of currently allocate bounce buffer * @scan_index_timestamp: cache of the index to the timestamp * @clock_id: timestamping clock posix identifier