All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: thomas.hellstrom@linux.intel.com, jani.nikula@intel.com,
	ndesaulniers@google.com, intel-gfx@lists.freedesktop.org,
	linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk,
	andrzej.hajda@intel.com, dlatypov@google.com,
	matthew.auld@intel.com, daniel@ffwll.ch, airlied@redhat.com,
	mchehab@kernel.org, vitor@massaru.org, nirmoy.das@intel.com
Subject: Re: [Intel-gfx] [PATCH v10 2/9] overflow: Move and add few utility macros into overflow
Date: Tue, 13 Sep 2022 04:53:32 -0700	[thread overview]
Message-ID: <202209130453.5A729A89@keescook> (raw)
In-Reply-To: <20220909105913.752049-3-gwan-gyeong.mun@intel.com>

On Fri, Sep 09, 2022 at 07:59:06PM +0900, Gwan-gyeong Mun wrote:
> It moves overflows_type utility macro into overflow header from i915_utils
> header. The overflows_type can be used to catch the truncaion (overflow)
> between different data types. And it adds check_assign() macro which
> performs an assigning source value into destination pointer along with an
> overflow check. overflow_type macro has been improved to handle the
> different data types between source and destination by check_add_overflow
> macro. It also adds check_assign_user_ptr macro which performs an assigning
> source value into destination pointer type variable along with an overflow
> check. If an explicit overflow check is required while assigning,
> check_assign_user_ptr() can be used to assign integers into pointers along
> with an overflow check.
> 
> v3: Add is_type_unsigned() macro (Mauro)
>     Modify overflows_type() macro to consider signed data types (Mauro)
>     Fix the problem that safe_conversion() macro always returns true
> v4: Fix kernel-doc markups
> v6: Move macro addition location so that it can be used by other than drm
>     subsystem (Jani, Mauro, Andi)
>     Change is_type_unsigned to is_unsigned_type to have the same name form
>     as is_signed_type macro
> v8: Add check_assign() and remove safe_conversion() (Kees)
>     Fix overflows_type() to use gcc's built-in overflow function (Andrzej)
>     Add overflows_ptr() to allow overflow checking when assigning a value
>     into a pointer variable (G.G.)
> v9: Fix overflows_type() to use __builtin_add_overflow() instead of
>     __builtin_add_overflow_p() (Andrzej)
>     Fix overflows_ptr() to use overflows_type() with the unsigned long type
>     (Andrzej)
> v10: Remove a redundant type checking for a pointer. (Andrzej)
>      Use updated check_add_overflow macro instead of __builtin_add_overflow
>      (G.G)
>      Add check_assign_user_ptr() macro and drop overflows_ptr() macro(Kees)
> 
> Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>

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

-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: thomas.hellstrom@linux.intel.com, mauro.chehab@linux.intel.com,
	andi.shyti@linux.intel.com, jani.nikula@intel.com,
	ndesaulniers@google.com, intel-gfx@lists.freedesktop.org,
	linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk,
	andrzej.hajda@intel.com, dlatypov@google.com,
	matthew.auld@intel.com, airlied@redhat.com, mchehab@kernel.org,
	vitor@massaru.org, nirmoy.das@intel.com
Subject: Re: [PATCH v10 2/9] overflow: Move and add few utility macros into overflow
Date: Tue, 13 Sep 2022 04:53:32 -0700	[thread overview]
Message-ID: <202209130453.5A729A89@keescook> (raw)
In-Reply-To: <20220909105913.752049-3-gwan-gyeong.mun@intel.com>

On Fri, Sep 09, 2022 at 07:59:06PM +0900, Gwan-gyeong Mun wrote:
> It moves overflows_type utility macro into overflow header from i915_utils
> header. The overflows_type can be used to catch the truncaion (overflow)
> between different data types. And it adds check_assign() macro which
> performs an assigning source value into destination pointer along with an
> overflow check. overflow_type macro has been improved to handle the
> different data types between source and destination by check_add_overflow
> macro. It also adds check_assign_user_ptr macro which performs an assigning
> source value into destination pointer type variable along with an overflow
> check. If an explicit overflow check is required while assigning,
> check_assign_user_ptr() can be used to assign integers into pointers along
> with an overflow check.
> 
> v3: Add is_type_unsigned() macro (Mauro)
>     Modify overflows_type() macro to consider signed data types (Mauro)
>     Fix the problem that safe_conversion() macro always returns true
> v4: Fix kernel-doc markups
> v6: Move macro addition location so that it can be used by other than drm
>     subsystem (Jani, Mauro, Andi)
>     Change is_type_unsigned to is_unsigned_type to have the same name form
>     as is_signed_type macro
> v8: Add check_assign() and remove safe_conversion() (Kees)
>     Fix overflows_type() to use gcc's built-in overflow function (Andrzej)
>     Add overflows_ptr() to allow overflow checking when assigning a value
>     into a pointer variable (G.G.)
> v9: Fix overflows_type() to use __builtin_add_overflow() instead of
>     __builtin_add_overflow_p() (Andrzej)
>     Fix overflows_ptr() to use overflows_type() with the unsigned long type
>     (Andrzej)
> v10: Remove a redundant type checking for a pointer. (Andrzej)
>      Use updated check_add_overflow macro instead of __builtin_add_overflow
>      (G.G)
>      Add check_assign_user_ptr() macro and drop overflows_ptr() macro(Kees)
> 
> Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>

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

-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, mchehab@kernel.org,
	chris@chris-wilson.co.uk, matthew.auld@intel.com,
	thomas.hellstrom@linux.intel.com, jani.nikula@intel.com,
	nirmoy.das@intel.com, airlied@redhat.com, daniel@ffwll.ch,
	andi.shyti@linux.intel.com, andrzej.hajda@intel.com,
	mauro.chehab@linux.intel.com, linux@rasmusvillemoes.dk,
	vitor@massaru.org, dlatypov@google.com, ndesaulniers@google.com
Subject: Re: [PATCH v10 2/9] overflow: Move and add few utility macros into overflow
Date: Tue, 13 Sep 2022 04:53:32 -0700	[thread overview]
Message-ID: <202209130453.5A729A89@keescook> (raw)
In-Reply-To: <20220909105913.752049-3-gwan-gyeong.mun@intel.com>

On Fri, Sep 09, 2022 at 07:59:06PM +0900, Gwan-gyeong Mun wrote:
> It moves overflows_type utility macro into overflow header from i915_utils
> header. The overflows_type can be used to catch the truncaion (overflow)
> between different data types. And it adds check_assign() macro which
> performs an assigning source value into destination pointer along with an
> overflow check. overflow_type macro has been improved to handle the
> different data types between source and destination by check_add_overflow
> macro. It also adds check_assign_user_ptr macro which performs an assigning
> source value into destination pointer type variable along with an overflow
> check. If an explicit overflow check is required while assigning,
> check_assign_user_ptr() can be used to assign integers into pointers along
> with an overflow check.
> 
> v3: Add is_type_unsigned() macro (Mauro)
>     Modify overflows_type() macro to consider signed data types (Mauro)
>     Fix the problem that safe_conversion() macro always returns true
> v4: Fix kernel-doc markups
> v6: Move macro addition location so that it can be used by other than drm
>     subsystem (Jani, Mauro, Andi)
>     Change is_type_unsigned to is_unsigned_type to have the same name form
>     as is_signed_type macro
> v8: Add check_assign() and remove safe_conversion() (Kees)
>     Fix overflows_type() to use gcc's built-in overflow function (Andrzej)
>     Add overflows_ptr() to allow overflow checking when assigning a value
>     into a pointer variable (G.G.)
> v9: Fix overflows_type() to use __builtin_add_overflow() instead of
>     __builtin_add_overflow_p() (Andrzej)
>     Fix overflows_ptr() to use overflows_type() with the unsigned long type
>     (Andrzej)
> v10: Remove a redundant type checking for a pointer. (Andrzej)
>      Use updated check_add_overflow macro instead of __builtin_add_overflow
>      (G.G)
>      Add check_assign_user_ptr() macro and drop overflows_ptr() macro(Kees)
> 
> Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>

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

-- 
Kees Cook

  reply	other threads:[~2022-09-13 11:53 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 10:59 [Intel-gfx] [PATCH v10 0/9] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation Gwan-gyeong Mun
2022-09-09 10:59 ` Gwan-gyeong Mun
2022-09-09 10:59 ` Gwan-gyeong Mun
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 1/9] overflow: Allow mixed type arguments Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-11 10:31   ` [Intel-gfx] " Andi Shyti
2022-09-11 10:31     ` Andi Shyti
2022-09-11 10:31     ` Andi Shyti
2022-09-12  8:38   ` [Intel-gfx] " Andrzej Hajda
2022-09-12  8:38     ` Andrzej Hajda
2022-09-12  8:38     ` Andrzej Hajda
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 2/9] overflow: Move and add few utility macros into overflow Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-13 11:53   ` Kees Cook [this message]
2022-09-13 11:53     ` Kees Cook
2022-09-13 11:53     ` Kees Cook
2022-09-17 23:31   ` [Intel-gfx] " kernel test robot
2022-09-17 23:31     ` kernel test robot
2022-09-17 23:31     ` kernel test robot
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 3/9] compiler_types.h: Add assert_type to catch type mis-match while compiling Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-11 11:04   ` [Intel-gfx] " Andi Shyti
2022-09-11 11:04     ` Andi Shyti
2022-09-11 11:04     ` Andi Shyti
2022-09-12  9:52     ` [Intel-gfx] " Rasmus Villemoes
2022-09-12  9:52       ` Rasmus Villemoes
2022-09-12  9:52       ` Rasmus Villemoes
2022-09-12 10:21       ` [Intel-gfx] " Andi Shyti
2022-09-12 10:21         ` Andi Shyti
2022-09-12 10:21         ` Andi Shyti
2022-09-13 12:01   ` [Intel-gfx] " Kees Cook
2022-09-13 12:01     ` Kees Cook
2022-09-13 12:01     ` Kees Cook
2022-09-21 14:10     ` [Intel-gfx] " Gwan-gyeong Mun
2022-09-21 14:10       ` Gwan-gyeong Mun
2022-09-21 14:10       ` Gwan-gyeong Mun
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 4/9] drm/i915/gem: Typecheck page lookups Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-10  6:53   ` kernel test robot
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 5/9] drm/i915: Check for integer truncation on scatterlist creation Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 6/9] drm/i915: Check for integer truncation on the configuration of ttm place Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 7/9] drm/i915: Check if the size is too big while creating shmem file Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 8/9] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59 ` [Intel-gfx] [PATCH v10 9/9] drm/i915: Remove truncation warning for large objects Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 10:59   ` Gwan-gyeong Mun
2022-09-09 11:24 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation Patchwork
2022-09-11 11:22 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation (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=202209130453.5A729A89@keescook \
    --to=keescook@chromium.org \
    --cc=airlied@redhat.com \
    --cc=andrzej.hajda@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel@ffwll.ch \
    --cc=dlatypov@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gwan-gyeong.mun@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=matthew.auld@intel.com \
    --cc=mchehab@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nirmoy.das@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=vitor@massaru.org \
    /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.