From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f46.google.com (mail-yx1-f46.google.com [74.125.224.46]) (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 D739038F623 for ; Mon, 18 May 2026 19:08:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779131282; cv=none; b=ARlxcjEMvTEzeTlj6BqCul2KjDq7QUrKXMwSeYBUCh/OyK5sMPVIKhPDocqW5mgp7x4TLHynrPm0c2a1q7itRHZQ4kgr1C29hIVTU9JC6gho5/R028TGyUihy7bk59HBJSuLr4x/8GfSN35O3F9PZ0VusW87RHJj3BuiojCq11s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779131282; c=relaxed/simple; bh=O58YtyLftv/aSr8x9baMQzWxATwo2ioj8rHnKr5cmYk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ah8Fi7CIzOOBqsImlCOaE0k6N+C+sN2wEw4Qslr3rqKbL2NTDXX5e3H35f/YrWqG4s4EIch2nxQ1UUOf/5tl4vixuZyJa3PppSCYo/JBiPTbpCfDFbVMKs1IFlu+Tv5OZCm+nc2zB+WVRNh5lb6R7ROr55vY3fijwhumEsl/XlY= 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=cH1paVhG; arc=none smtp.client-ip=74.125.224.46 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="cH1paVhG" Received: by mail-yx1-f46.google.com with SMTP id 956f58d0204a3-65318dafbcbso2621803d50.2 for ; Mon, 18 May 2026 12:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779131280; x=1779736080; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=q6OJAQsGwoFPD7r4LZcpMPocelNw4jhWQiyjjqAx5Pk=; b=cH1paVhGmz0GxWCAmIOMsuxpBG0wRPkxxuY84eDhul0lgXgrj7nVGH7W/cT2+Rob+w vaswy6lDAye+1ZpzRjwCR1k0/U4MHFhAy3IKQPHXBK0C7+5PxDnsrfhQ+9D+6SqZeIA5 dEMkQZFg1HSdNrUkHTCtgMQPQUAjRL0wEIyVsMj/lnOggXDuuCh8UFcFPeJgRc0fJsU/ 7v8UpjY3RGJ6ldYGLC0BWMqhyw5A0v5xfVj1BdjSu9jMiplie+cfJ3mOBWsrnAedVbYY WE679QfLk0xqGXmEsfPoEeVkEX+G4UimkeI+Py+5x9FvHgr64aljsjILYFKKOOs4PVlF BCnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779131280; x=1779736080; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=q6OJAQsGwoFPD7r4LZcpMPocelNw4jhWQiyjjqAx5Pk=; b=lZizFxdbKeOtuReD2c45W9SBnzjhLTh3G0DrF/mXS7uuN3cZ3+P2m7vPmrIcOCOs93 r4t7tE7fyhbpGaUQrm6/QLuLnEwd/2p1FC5aNsCeBI/WbnwgTmHXfX5CNb6anqzJgXIz rnUfQY86mq8mGAm/WnpGBjkPVQpjMU8/ZwSg976PFiK9fnuoGdPIo2/qVWnPB0AXg+zf kirrRpOCfQO/oY3lErGBEjTYfUm9cJP1K+GCX2ZqNO3joBLDjZRRtHj/lJdKR26UYXJH QQR9DjbauvJpHL6Pb9D7URsIMmDQsuOEdbgA2qCZidJ5g5m9Glb9uXEwJ7VnGoXNaMya 6PWA== X-Forwarded-Encrypted: i=1; AFNElJ8KKH+lZtM4jT9HpLIgwE9XkKR6tPnVSQ6ND2uYAwHQGMdMq8hco8p4lLNHr6MMZxIdYDPIbjiZTd7w/p0=@vger.kernel.org X-Gm-Message-State: AOJu0YwEXRmwxVroziUWzE2m7Hq1RhMw3ArksWIVM2Nxlo9RTiRLve7M /iah9cjFsM4j6ofm/18gmgnF6u6DIM5QSjO7oj10M1EJINSYireikiCb X-Gm-Gg: Acq92OEzNW+dZ2GZqL04Iu22tS+VPAGFGFINfHvu+BcfyUJJ3o+3tOXZlFpNqwfb5Zy 9Gits9vfpKUvj0G69SqgvUDW2vrx61lCo2906NhrZLKutABCHMmFmWEzxBCf6J976c4Vqks02fT aEp5XDX+pZ7gMylHcpeLMMb8IjsH+yB6wQKIotFu1ZqVCmC18V5K2WgeQZXDKYQEuwws+OkJxNA 7VuX112B/O92JYDLr1yD2MeG5TgXpvs1B77Zfrqq9AUqvx3KY4TYqRHr1VDuiX2M66+VwyKQ/+n SS4K+cvcBruMw7Hdmjfu9/eyRzh8mHItnsAzqWWzUMhi4xXyhJT+CIAqG45xaIiNP0/S3VW62Hy Lz/gpzOlWqplWWgjkUB4U62K2/2EmBOwXkTTiWORiuyN14P2oKYOdChWDb125T5Z8iMknY10IJk ZLTmRB5EaYVwuuKqGhQgtry3C7GIjHVqU2Ve1VQy988wdgG8/uUJdlSu4/+f7rZc6rka2eQw4o9 46FdfaQ3BEV0qeu0uABTgO6FGI= X-Received: by 2002:a05:690e:4086:b0:65e:5955:2e44 with SMTP id 956f58d0204a3-65e59554694mr5535194d50.47.1779131279841; Mon, 18 May 2026 12:07:59 -0700 (PDT) Received: from localhost.localdomain ([186.151.100.108]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-65e0db0b11esm6766160d50.11.2026.05.18.12.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 12:07:59 -0700 (PDT) From: Sebastian Alba Vives To: yilun.xu@linux.intel.com, gregkh@linuxfoundation.org Cc: linux-fpga@vger.kernel.org, conor.dooley@microchip.com, mdf@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sebastian Alba Vives Subject: [PATCH v8 0/3] fpga: bounds checks and input validation fixes Date: Mon, 18 May 2026 13:07:39 -0600 Message-ID: <20260518190742.61426-1-sebasjosue84@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series adds three defensive fixes to FPGA drivers: Patch 1/3 fixes dfh_get_param_size() in the DFL driver where the loop bounds check is evaluated before incrementing size, potentially returning an inflated size that exceeds the feature region boundary. Patch 2/3 validates the DMA mapping length in afu_ioctl_dma_map() at the ioctl entry point before passing it down the call chain, preventing implicit integer truncation in pin_user_pages_fast(). Patch 3/3 fixes mpf_ops_parse_header() in the Microchip SPI FPGA manager where a zero header_size from the bitstream causes a one-byte read before the buffer start. Sebastian Alba Vives (3): fpga: dfl: add bounds check in dfh_get_param_size() fpga: dfl-afu: validate DMA mapping length in afu_dma_map_region() fpga: microchip-spi: fix zero header_size OOB read in mpf_ops_parse_header() drivers/fpga/dfl-afu-main.c | 3 +++ drivers/fpga/dfl.c | 2 ++ drivers/fpga/microchip-spi.c | 3 +++ 3 files changed, 8 insertions(+) -- 2.43.0