All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	llvm@lists.linux.dev, patches@lists.linux.dev
Subject: Re: [PATCH] drm/i915: Fix CFI violations in gt_sysfs
Date: Sat, 24 Sep 2022 21:39:30 -0700	[thread overview]
Message-ID: <Yy/bglnYjnFfjDDI@dev-arch.thelio-3990X> (raw)
In-Reply-To: <202209232143.172BCCDC4@keescook>

On Fri, Sep 23, 2022 at 09:57:47PM -0700, Kees Cook wrote:
> On Thu, Sep 22, 2022 at 12:51:27PM -0700, Nathan Chancellor wrote:
> > [...]
> > To make everything work properly, adjust certain functions to match the
> > type of the ->show() and ->store() members in 'struct kobj_attribute'.
> > Add a macro to generate functions for that can be called via both
> > dev_attr_{show,store}() or kobj_attr_{show,store}() so that they can be
> > called through both kobject locations without violating kCFI and adjust
> > the attribute groups to account for this.
> 
> This was quite a roller coaster! I think the solution looks good, even
> if I'm suspicious of the original design that has the same stuff
> available twice in different places. (I have a dim memory of rdma
> needing a refactoring like this too?)

Right, I noticed this comment in intel_gt_sysfs_register() once I fully
saw what was going on:

	/*
	 * We need to make things right with the
	 * ABI compatibility. The files were originally
	 * generated under the parent directory.
	 *
	 * We generate the files only for gt 0
	 * to avoid duplicates.
	 */

Makes it seem like there will be userspace breakage if these files do
not exist? I figured this was the cleanest solution within those
parameters.

> Reviewed-by: Kees Cook <keescook@chromium.org>

Thanks for looking it over!

Cheers,
Nathan

WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <nathan@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	llvm@lists.linux.dev, Tom Rix <trix@redhat.com>,
	intel-gfx@lists.freedesktop.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	patches@lists.linux.dev, dri-devel@lists.freedesktop.org,
	Sami Tolvanen <samitolvanen@google.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915: Fix CFI violations in gt_sysfs
Date: Sat, 24 Sep 2022 21:39:30 -0700	[thread overview]
Message-ID: <Yy/bglnYjnFfjDDI@dev-arch.thelio-3990X> (raw)
In-Reply-To: <202209232143.172BCCDC4@keescook>

On Fri, Sep 23, 2022 at 09:57:47PM -0700, Kees Cook wrote:
> On Thu, Sep 22, 2022 at 12:51:27PM -0700, Nathan Chancellor wrote:
> > [...]
> > To make everything work properly, adjust certain functions to match the
> > type of the ->show() and ->store() members in 'struct kobj_attribute'.
> > Add a macro to generate functions for that can be called via both
> > dev_attr_{show,store}() or kobj_attr_{show,store}() so that they can be
> > called through both kobject locations without violating kCFI and adjust
> > the attribute groups to account for this.
> 
> This was quite a roller coaster! I think the solution looks good, even
> if I'm suspicious of the original design that has the same stuff
> available twice in different places. (I have a dim memory of rdma
> needing a refactoring like this too?)

Right, I noticed this comment in intel_gt_sysfs_register() once I fully
saw what was going on:

	/*
	 * We need to make things right with the
	 * ABI compatibility. The files were originally
	 * generated under the parent directory.
	 *
	 * We generate the files only for gt 0
	 * to avoid duplicates.
	 */

Makes it seem like there will be userspace breakage if these files do
not exist? I figured this was the cleanest solution within those
parameters.

> Reviewed-by: Kees Cook <keescook@chromium.org>

Thanks for looking it over!

Cheers,
Nathan

WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <nathan@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: llvm@lists.linux.dev, Tom Rix <trix@redhat.com>,
	intel-gfx@lists.freedesktop.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	patches@lists.linux.dev, dri-devel@lists.freedesktop.org,
	Sami Tolvanen <samitolvanen@google.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix CFI violations in gt_sysfs
Date: Sat, 24 Sep 2022 21:39:30 -0700	[thread overview]
Message-ID: <Yy/bglnYjnFfjDDI@dev-arch.thelio-3990X> (raw)
In-Reply-To: <202209232143.172BCCDC4@keescook>

On Fri, Sep 23, 2022 at 09:57:47PM -0700, Kees Cook wrote:
> On Thu, Sep 22, 2022 at 12:51:27PM -0700, Nathan Chancellor wrote:
> > [...]
> > To make everything work properly, adjust certain functions to match the
> > type of the ->show() and ->store() members in 'struct kobj_attribute'.
> > Add a macro to generate functions for that can be called via both
> > dev_attr_{show,store}() or kobj_attr_{show,store}() so that they can be
> > called through both kobject locations without violating kCFI and adjust
> > the attribute groups to account for this.
> 
> This was quite a roller coaster! I think the solution looks good, even
> if I'm suspicious of the original design that has the same stuff
> available twice in different places. (I have a dim memory of rdma
> needing a refactoring like this too?)

Right, I noticed this comment in intel_gt_sysfs_register() once I fully
saw what was going on:

	/*
	 * We need to make things right with the
	 * ABI compatibility. The files were originally
	 * generated under the parent directory.
	 *
	 * We generate the files only for gt 0
	 * to avoid duplicates.
	 */

Makes it seem like there will be userspace breakage if these files do
not exist? I figured this was the cleanest solution within those
parameters.

> Reviewed-by: Kees Cook <keescook@chromium.org>

Thanks for looking it over!

Cheers,
Nathan

  reply	other threads:[~2022-09-25  4:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 19:51 [PATCH] drm/i915: Fix CFI violations in gt_sysfs Nathan Chancellor
2022-09-22 19:51 ` [Intel-gfx] " Nathan Chancellor
2022-09-22 19:51 ` Nathan Chancellor
2022-09-22 23:37 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-09-23  0:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-23  6:58 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-09-23  7:15 ` [PATCH] " Tvrtko Ursulin
2022-09-23  7:15   ` [Intel-gfx] " Tvrtko Ursulin
2022-09-23  7:15   ` Tvrtko Ursulin
2022-09-24  4:57 ` Kees Cook
2022-09-24  4:57   ` [Intel-gfx] " Kees Cook
2022-09-24  4:57   ` Kees Cook
2022-09-25  4:39   ` Nathan Chancellor [this message]
2022-09-25  4:39     ` [Intel-gfx] " Nathan Chancellor
2022-09-25  4:39     ` Nathan Chancellor
2022-09-29 16:46     ` [Intel-gfx] " Andi Shyti
2022-09-29 16:46       ` Andi Shyti
2022-09-29 16:46       ` Andi Shyti
2022-09-29 16:53       ` Nathan Chancellor
2022-09-29 16:53         ` Nathan Chancellor
2022-09-29 16:53         ` Nathan Chancellor
2022-09-29 22:34 ` Andrzej Hajda
2022-09-29 22:44   ` Nathan Chancellor
2022-09-29 22:44     ` Nathan Chancellor
2022-09-29 22:44     ` Nathan Chancellor
2022-10-03 17:46     ` Nathan Chancellor
2022-10-03 17:46       ` Nathan Chancellor
2022-10-03 17:46       ` Nathan Chancellor
2022-10-03 22:58 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Fix CFI violations in gt_sysfs (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yy/bglnYjnFfjDDI@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=keescook@chromium.org \
    --cc=llvm@lists.linux.dev \
    --cc=ndesaulniers@google.com \
    --cc=patches@lists.linux.dev \
    --cc=rodrigo.vivi@intel.com \
    --cc=samitolvanen@google.com \
    --cc=trix@redhat.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.