Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp599528pxj; Thu, 3 Jun 2021 14:40:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs+okT155BJ2woAawwYNXIKLdng3zq0I1Z12AlYq7IS4mYRYWaxWCKFDQmcVV+WnS8rshH X-Received: by 2002:a50:fd0a:: with SMTP id i10mr1443961eds.78.1622756400086; Thu, 03 Jun 2021 14:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622756400; cv=none; d=google.com; s=arc-20160816; b=nAr1FFJ1PGtn0x+/WOK6dAvkp0ulHuq0Nbl0Wfnv2sTSpyYq4DwYhN5CknnS31AkLY acNKLm9CEDdtmdjdGGjuq6Zlt1VAet2e/mkPPRrBCmdG6AaVZvBT0wjl1dxy/mew1q+Q QJTXjMAPfSloHW2CDTGnTgtIShcIamX104gt8oVtRRV5Cd0aOSbt+lq/rdg1H/ryQxiH o8WwTfEToi5NgptqzJZ/hfxWWColgfPwWhOWWAH/vixWsMZ0mVsY2kll3r2f2qcPgsc8 Um3czpIyLAf1qLNZydXmG7DeTIqdno1orksPVK58HrUbZcakX+5wghmZXsNg9/a3+EGk CoZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nsEYgPaJUz7EVWH3YiQYc5RaSd34Bs6YlEnQfI7OJp4=; b=teY9Eh4mNBEuA/k4vPju1I24td/bsyH36H8zZtEU3sXKJsD1w2EtVH7uk9f+PfGauK aGQitdY6X8d07EecTTIYoAEzWB4WY8dFT247LGgozEhpALsSxvLfG9vy20x8pE7ywpOK G3SSgRRyNHSbwkaAXevhLxTUX+cHJZ/fK0dWHhL73FviIzsBoeK8cJTYYVVfAlXSN6Uo UVtb1jU9Bu/R+pv6rtkrxY8PNrvsDvG0CtU3R3MNJ//4ohS+iLyNF03c2qPXWlh+ecwv /kLj7UeO6N4v/dvhxwuuzGLbh/Ntp6p26mHe3v973125pJl2GnK95m4VuQxTPQA74/Yh qNvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lgqohSGQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg8si3455235ejb.592.2021.06.03.14.39.36; Thu, 03 Jun 2021 14:40:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lgqohSGQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbhFCVjk (ORCPT + 99 others); Thu, 3 Jun 2021 17:39:40 -0400 Received: from mail-pj1-f43.google.com ([209.85.216.43]:45011 "EHLO mail-pj1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbhFCVjj (ORCPT ); Thu, 3 Jun 2021 17:39:39 -0400 Received: by mail-pj1-f43.google.com with SMTP id h12-20020a17090aa88cb029016400fd8ad8so4676668pjq.3 for ; Thu, 03 Jun 2021 14:37:41 -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=nsEYgPaJUz7EVWH3YiQYc5RaSd34Bs6YlEnQfI7OJp4=; b=lgqohSGQhZNnYBmjXtao0Tp3Vxr2xXSbjwShtaHnA9fjoJTDbK2YjdpZJDisKS0PXf jqU6r1kFH3D2lcKcefo7cXvljZB6VSolN+mDG2gmvrKAcnv/zYVsE/1qhG07FpRbCkss L+d+Gjc563pk4AF40/6tCiGL7+zVS/VdGrJaM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=nsEYgPaJUz7EVWH3YiQYc5RaSd34Bs6YlEnQfI7OJp4=; b=YXlljVYvWETWBWKZDuuJsOGW/jqXJQVzntlIt16ldyd3Kj6cN4gH21eJ6Kn5xSu5Nd qt831GZgk+6CpJ1+GwMUgUVMImovqNb3+8p78IIbFALb6duGbz4U3+XA/eBHONEXHIPh BG9VSr8atXPfbTQhK3MJGUtPodAqZRYHCLSC9jS3y/yiPh31rppCGWMLpzw1hx954EYh hF0bhuekfxe5oduN+DQQeCS0BDfrpyOSohbXTJ+1zlvzzVK94dIusXjKEuzLcKWBiEVG DSXUzTGIJf6RuiiYLNLi9aa8uor9dLitmx0WLF43DvhWE08MW8rmO5f9q57ImDMaD1i7 wJaw== X-Gm-Message-State: AOAM533oqzQT3jVrTvWQyaLhpC1SimOfLv9zPURiHM8lZkQF8I04gZGH cjg7YaSnpN98PsVHNILd7doWvQ== X-Received: by 2002:a17:90a:fa4f:: with SMTP id dt15mr8964966pjb.30.1622756201319; Thu, 03 Jun 2021 14:36:41 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z28sm35373pfr.76.2021.06.03.14.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 14:36:40 -0700 (PDT) Date: Thu, 3 Jun 2021 14:36:39 -0700 From: Kees Cook To: Nathan Chancellor Cc: Jarmo Tiitto , Sami Tolvanen , Bill Wendling , Nick Desaulniers , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, morbo@google.com Subject: Re: [PATCH v2 1/1] pgo: Fix allocate_node() v2 Message-ID: <202106031436.132E0ED9A@keescook> References: <20210603133853.5383-1-jarmo.tiitto@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 03, 2021 at 02:14:24PM -0700, Nathan Chancellor wrote: > On 6/3/2021 6:38 AM, Jarmo Tiitto wrote: > > Based on Kees and others feedback here is v2 patch > > that clarifies why the current checks in allocate_node() > > are flawed. I did fair amount of KGDB time on it. > > > > When clang instrumentation eventually calls allocate_node() > > the struct llvm_prf_data *p argument tells us from what section > > we should reserve the vnode: It either points into vmlinux's > > core __llvm_prf_data section or some loaded module's > > __llvm_prf_data section. > > > > But since we don't have access to corresponding > > __llvm_prf_vnds section(s) for any module, the function > > should return just NULL and ignore any profiling attempts > > from modules for now. > > > > Signed-off-by: Jarmo Tiitto > > I agree with Nick on the comments about the commit message. A few more small > nits below, not sure they necessitate a v3, up to you. Thank you for the > patch! It would make my life easier to get a v3. :) I agree with all of Nathan's suggestions. :) Thanks! -Kees -- Kees Cook