From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AC5BC433F5 for ; Thu, 30 Sep 2021 18:03:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D28F6619F6 for ; Thu, 30 Sep 2021 18:03:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D28F6619F6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K3F9bdkZ45wk3PxdEHBINOr4m1BMTuMAx3yMgei8yWE=; b=ukQ6NnHFK/va5/ IRSKiwn65pEGBObeq1j5mphN0kqHw48f7YK4wm3rdD+7gUqVdnaBpkcj7kGWTShUhetQJT3wf/Eyq G673+JA0dVoaX3G4y4/mG3tbWfCJGxuev2SVRFMlRUUTAdbm3v2BD8DccQBz1gQa5tal83fEBK7uY W7nvomCNHphCM2ycvJH/UnNwH6qidVUiebCr6rfUfvBJpGoivPAMxx0uk2KXLaTs2BfNYplYmVE3G rvZ0smMlAuUhhU5F+P3OxZXbkP2omuqG56KGZIyIdHdOJ7VxaP/HFGG+/OFNQ19iNek+EopfKruJs pgCT3tnmG657b8RA+qNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mW0Ma-00FR3H-Es; Thu, 30 Sep 2021 18:00:56 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mW0MW-00FR24-Jw for linux-arm-kernel@lists.infradead.org; Thu, 30 Sep 2021 18:00:54 +0000 Received: by mail-pj1-x102c.google.com with SMTP id il14-20020a17090b164e00b0019c7a7c362dso2269023pjb.0 for ; Thu, 30 Sep 2021 11:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=GvInsCJfgVIdu+bTl+EZcCSDBMnOYdIPFiEnPSEGWq8=; b=C+AhbK8OmIghCqB38Es9+sqV5ZiplbGylDANFPGzeGsstzb+vKsJgLrMKcqsXrj+Ls E51vKRIr5y+WbmZvxZVTas6LticTYRZPHvE3mTOcmA5do+nsSSV1iTn7ls4F2BlhqLym CVjOo2cReN5XP3kuUARBo3Iiap96FHW4NnrJM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GvInsCJfgVIdu+bTl+EZcCSDBMnOYdIPFiEnPSEGWq8=; b=d2j8Blekg6yBz7NdCENUy5vHgRRGM47on3OfOiw/w5YUn+WRpEBzyjbn/3MWKeX9mG QdkmZJD2tgF4FY0XyLoh5RTti1ybKTXst0UVdDCpV3wn2FxmuXMjvssTyrOCwcdvPz9C ti9m9/bsXrCAnjcuTVSUq1FjOyDKsBfgtOUOd7aGndXJ43j7NGrdMciXZr+UA9N6cfEg /NEDqGwTXhjNVUimkPNP8obugY9bypNKoWupwyH1gm/DCy+NP3tvtZFo4xK2zP5mxNg4 M2JYCrR+tIiEa0U5Pi7Iwek4V9MJD+/GhCfMAIzv1GGzDSB+Mh35OWMFoXi0VcBrQ/RO 2Z8Q== X-Gm-Message-State: AOAM532nL3CHOsT9W3kAmONmeNzNRfg708gEt9AisjyRUbAAf6QdVqZf 5LXNWfUOIi6JoKrZYPwj2um/GQ== X-Google-Smtp-Source: ABdhPJw1x/cuO9mw2pkpxFtvuHlojDjhxrcg02FFcSXPI1A/yf4JspLL4WFzVx/lrn2zgGEudX2AQw== X-Received: by 2002:a17:902:6ac7:b0:13e:1fec:2bbc with SMTP id i7-20020a1709026ac700b0013e1fec2bbcmr5413917plt.82.1633024851430; Thu, 30 Sep 2021 11:00:51 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k9sm3628222pfi.86.2021.09.30.11.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 11:00:50 -0700 (PDT) Date: Thu, 30 Sep 2021 11:00:49 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Vinod Koul , Maxime Coquelin , Alexandre Torgue , dmaengine@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] dmaengine: stm32-mdma: Use struct_size() helper in devm_kzalloc() Message-ID: <202109301100.2BB00DE96A@keescook> References: <20210929222922.GA357509@embeddedor> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210929222922.GA357509@embeddedor> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210930_110052_688732_7D37E0B0 X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 29, 2021 at 05:29:22PM -0500, Gustavo A. R. Silva wrote: > Make use of the struct_size() helper instead of an open-coded version, > in order to avoid any potential type mistakes or integer overflows that, > in the worse scenario, could lead to heap overflows. > > Link: https://github.com/KSPP/linux/issues/160 > Signed-off-by: Gustavo A. R. Silva Looks right to me. Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel