Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1470516rdd; Wed, 10 Jan 2024 23:15:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEs5/DJgoshewXwOAwsIGRLJKvXMZCYmRv8vQjVaquGYX4kvg7PkZvCwOFDDqI7uL5QYzlr X-Received: by 2002:a05:620a:221a:b0:783:4037:1923 with SMTP id m26-20020a05620a221a00b0078340371923mr525651qkh.64.1704957355342; Wed, 10 Jan 2024 23:15:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704957355; cv=none; d=google.com; s=arc-20160816; b=V2KVtKORT85a8fxNgOYCk7O2dbfldFscJQFzrZ6Eh1e30AW1ucFV8dQddx3vIQmAPm yrlGY+xQCm1jumj1faewY0mT5EMo0rYbQEhyd9L9N/Hbb/4aazOdpogj+kpjVFSBpvaI /5/p3feCpFnLdDnJTPQ+e2L8Zoaf95GIU+CC7tivuWW45MPJvTPPTI/nOb/Rkz7/xLuG iClb/O5XnicSE9pXeiNInQ4ntwr7cOyY9JINh1tXlKop5HrMYA235Q9nz0OmcESuIo9I 3revP1kK2MOhgSOLPmHxfpIwCuJiMZPFGoDCeRM7rnOyaSb3lmfqlPEX5Lc1jh/ZLbS/ 1Qxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UX20rbF7hlnyWLHyXsogEXaIvZyHEjXlNvsR8Qs9blw=; fh=GDngMSBJti1OGF2RQrWk5fofZ6eljIej7R12Xl/hTBc=; b=TWOEh+fPRo5DNnTKux3sQ166n82610oKiWl5T8zY8Exw4f7DarNWFo97HDrMS9deWW FTFu2BKTSFCP/3ymcb6ylpH9R3fBzAIjzTkmMYhDIrt+JOlrzEuzSFag7DzZ3phOyiZt xOXeGjoaH+RAN3gb637ikagEsHo1vvigJcorAabTJ1dcpgopjXhYzdhQ7YmesozpMaCK BSxQlND9NxbETKkOaiYJFEb8Ggem30AbI5LNsHtUKgfFTx2zKHtb9D2KCGpjr2qf2ZFw wmqPNdm46dx8XiOaDx+PG6k6+xim2ehFNkhzVC80x7u9mBRw+FekjKq+uvEYwtUJmzIN 6xPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r0e41A1v; spf=pass (google.com: domain of linux-kernel+bounces-23133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v13-20020a05620a0f0d00b007832d7286efsi418184qkl.94.2024.01.10.23.15.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 23:15:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r0e41A1v; spf=pass (google.com: domain of linux-kernel+bounces-23133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1E0681C23384 for ; Thu, 11 Jan 2024 07:15:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF7F0D268; Thu, 11 Jan 2024 07:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="r0e41A1v" 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 59AD9CA6F for ; Thu, 11 Jan 2024 07:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40b5155e154so64267045e9.3 for ; Wed, 10 Jan 2024 23:15:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704957344; x=1705562144; 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=UX20rbF7hlnyWLHyXsogEXaIvZyHEjXlNvsR8Qs9blw=; b=r0e41A1vUzhV8KYDP89y4Z08jMC7CEQQfR4ANirMUE83erDaIRq7WCKXYEK55Knx1G WI8gHtgn9qGk7ZO91zsBAQYYZEiVki+liCxRmN6NbwKmO3K+eLc7YyzG/+zOJZUMhLzL Hsl1SZ81BbGW/lh1ebS8Bi+BjY5w5isG7fyPnWTMG5kcmGkYAUwJ20EdOqWTTBNrSwcR R6KIQHUUt1NEwRWfPDZxIt6P1WX+Slu5pPTlAeYaNsjiRlnfGBaXS/zdm10AkDQmtTzI QC90PSoas1QVIS1LnBleqc7AHJBPhs012ATidlDsxaR1JqbD0qmskbvwYIuy+uBcB0tQ Jrdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704957344; x=1705562144; 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=UX20rbF7hlnyWLHyXsogEXaIvZyHEjXlNvsR8Qs9blw=; b=Ox9s2s4LxIhus/awTEyFMe378K5Ibyc/TBAChdsGRzHndFrb1JGoO+38e3l++XDP+f goCLhpXoaW0aTQopSVygIFke6+5/sMeMYIgx9PFNNb0TDcbkXHSo+Gj4XkeyKJNieKnt U5BODtJACobmHN+kDNR0EeL4Cy6HWf64ypoPc+yZbJMVh521S9rdi8PbUl4BLkKGuvKL YKtTkHRDCths4U5ajaai5fH9FXQtjaKj/L3w0vKkj4+U5Be73wrRJF9iFJYk5+u1yhCY E/r+BVphGh4j66C/4ry8tnrTMTkh4TrC6Fd0gvnRqvMqB64sKtV4fGMEp0qkR2GThes9 qLGg== X-Gm-Message-State: AOJu0YyALKnXEPraYmC+Pia7TexIemRQ8E0gqZaLXgbOjKGWLOPlo/WM Jxr05K/K2CfNkXxEQFyVKzokhsYutrj6Wg== X-Received: by 2002:a05:600c:428c:b0:40e:52c3:47f9 with SMTP id v12-20020a05600c428c00b0040e52c347f9mr122255wmc.67.1704957344497; Wed, 10 Jan 2024 23:15:44 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id t5-20020a05600c450500b0040d6d755c90sm741939wmo.42.2024.01.10.23.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 23:15:44 -0800 (PST) Date: Thu, 11 Jan 2024 10:15:40 +0300 From: Dan Carpenter To: Kees Cook Cc: "Gustavo A. R. Silva" , Harshit Mogalapalli , 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, syzkaller Subject: Re: [PATCH v2 2/2] VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host() Message-ID: <8e527ade-fe49-4697-8e36-589775c63354@moroto.mountain> References: <20240105164001.2129796-1-harshit.m.mogalapalli@oracle.com> <20240105164001.2129796-2-harshit.m.mogalapalli@oracle.com> <202401081430.9DAB37B46@keescook> <9c742547-0021-464b-b7a8-7af46b0a4afa@embeddedor.com> <202401101601.30ED61A1A3@keescook> 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: <202401101601.30ED61A1A3@keescook> On Wed, Jan 10, 2024 at 04:03:28PM -0800, Kees Cook wrote: > > Oops, yes, thanks for fixing my confusion. Right, this is a direct write > across members into the flex array, not a composite destination. Yay > all the corner cases. :P Is there a document somewhere which explains what will trigger a runtime warning? For example, if you write across members but it's not into a flex array does that cause an issue? Or if you read across members? For example, this line reads from bulletin->vlan and bulletin->vlan_padding. This causes a compiler warning in Clang and GCC depending on the options but does it also trigger a runtime warning? https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c#L2655 (I wrote a patch for this a few months back but didn't send it because of the merge window. I forgot about it until now that we're in a merge window again... :P) regards, dan carpenter