From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 1F9BE53811 for ; Mon, 8 Jan 2024 22:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Yb8RtHfE" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-5ca29c131ebso1809685a12.0 for ; Mon, 08 Jan 2024 14:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704752912; x=1705357712; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XIz5GdX77lFb9OhsM/0GWdi8bxP1o8+l8qU3iYNTkSE=; b=Yb8RtHfEoYjzjdKO1D/wsgNTBukl8fQvr4jlvb9SNUSDR1jtZ+4NKxCf+MlzSqax3f sGKOiq2ndM5uL2102g2cFSftnInPGvEjhgAXgyXrSW69x4RhVQ9YUo+bigRpSBKdVdQP niCZJwFjvD7rs9DOVDhPTPQZP4okiebXlM9Ng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704752912; x=1705357712; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XIz5GdX77lFb9OhsM/0GWdi8bxP1o8+l8qU3iYNTkSE=; b=MLag60/IHpk5NPcA8d34hhrdxS7EaNdx8MFHpeMF8iRcuVAUmawyy/zllbM20bQXJQ BpgxHFX4mobJBBEzF46vqEFV8kexIFpK0Ev57h74XOZBhR2yLoVhdqSMPYvdhXkKg72A k+YruDumn4m2oLTnWptgOkmxNwZ2KQPCwK9MnzDR2hnkCjOhCmNLx5fSRejjwLLueabd TPjpultOxXtbW1RTbnt0WclxZqt4VJFZHooN3iWKZIXpPJH0v95Yo5Qv3P/ksbWeTZuS Rcy2pIZUqWSJb6iEbow+l0jCeyi6ps4UTRBw52MC+tq0wFWSjFTAKUObGwci1R/rbbMI +yeQ== X-Gm-Message-State: AOJu0Yzs1PMm/EZO+KrARrrbO3MkPAw89QipKJYGNApWWwjaEsAu1RZp 0th8oBDt0uhKSYaI/dTUVNT5mxsI+TYe X-Google-Smtp-Source: AGHT+IFtKmKYgClXz3t7LX7s+lUEissTL9t51VE4k00tztjPyrp7lFr66tearov/dGpx4eZr9Vy+dA== X-Received: by 2002:a05:6a20:2589:b0:199:dd55:1459 with SMTP id k9-20020a056a20258900b00199dd551459mr934233pzd.81.1704752912438; Mon, 08 Jan 2024 14:28:32 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id q17-20020a62ae11000000b006d9361fcfc8sm367358pff.177.2024.01.08.14.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 14:28:31 -0800 (PST) Date: Mon, 8 Jan 2024 14:28:30 -0800 From: Kees Cook To: Harshit Mogalapalli Cc: linux-hardening@vger.kernel.org, error27@gmail.com, gustavoars@kernel.org, Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, vegard.nossum@oracle.com, darren.kenny@oracle.com Subject: Re: [PATCH v2 1/2] VMCI: Use struct_size() in kmalloc() Message-ID: <202401081428.F7A80008D2@keescook> References: <20240105164001.2129796-1-harshit.m.mogalapalli@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240105164001.2129796-1-harshit.m.mogalapalli@oracle.com> On Fri, Jan 05, 2024 at 08:39:59AM -0800, Harshit Mogalapalli wrote: > Use struct_size() instead of open coding. > > Suggested-by: Gustavo A. R. Silva > Signed-off-by: Harshit Mogalapalli Yeah, clear replacement. Reviewed-by: Kees Cook -- Kees Cook