From patchwork Mon Oct 16 22:07:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 13424220 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31369381D8 for ; Mon, 16 Oct 2023 22:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G0SFAe0H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5349C433C7; Mon, 16 Oct 2023 22:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697494026; bh=KbRjPe/m0vYV7NLiB44bDbiYy0uwlThE07mcdMR+BYE=; h=Date:From:To:Cc:Subject:From; b=G0SFAe0HOZaPrCWs7giuy1vldA7AUDxIQ4C7EljfclACFsXNAA/Fo2q3M6VTSMHXX UqFxCFgfZRlXr5PZygNSIiOoLdAIkp0Lih/JF/0KIVKzGgDTt2FU1L+BFYh1Vqb8gB tj7WmqzKJL8qybTMRsl4WGwvjSuLR2UT1aGbTgnRjtE5IvORWB1zmS2MeBGSmq5Ocn jlx6HdqOGqbZiRTPEK5dvTRfYKDadWhGt0izuzu+CPdcx4SUIjG2QevWytHB7fPMbD gT1U378Zdk2rCjkyuvC3I5r/LLE3HhHQlhjjJUjZ8DinXgHghg3mE2fKxZQMGkVNdP 5TkHHrCRktu3w== Date: Mon, 16 Oct 2023 16:07:03 -0600 From: "Gustavo A. R. Silva" To: Dinh Nguyen , Michael Turquette , Stephen Boyd Cc: Kees Cook , linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH v2 0/2][next] clk: socfpga: Fix undefined behavior bug and add bounds-checking coverage Message-ID: Precedence: bulk X-Mailing-List: linux-hardening@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline This series aims to fix an undefined behavior bug in `struct stratix10_clock_data` and add bounds-checking coverage at run-time for flexible-array member `hws` in `struct clk_hw_onecell_data` when accessed throught `struct stratix10_clock_data`. Changes in v2: - Mention -Wflex-array-member-not-at-end in the changelog text. v1: - Link: https://lore.kernel.org/linux-hardening/cover.1697059539.git.gustavoars@kernel.org/ Gustavo A. R. Silva (2): clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data clk: socfpga: agilex: Add bounds-checking coverage for struct stratix10_clock_data drivers/clk/socfpga/clk-agilex.c | 12 ++++++------ drivers/clk/socfpga/clk-s10.c | 6 +++--- drivers/clk/socfpga/stratix10-clk.h | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-)