From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Martiros Shakhzadyan <vrzh@vrzh.net>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] media: atomisp: Perform a single memset() for union
Date: Sun, 11 Jul 2021 18:16:49 +0300 [thread overview]
Message-ID: <20210711151649.GA3@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20210711145101.1434065-1-keescook@chromium.org>
On Sun, Jul 11, 2021 at 07:51:01AM -0700, Kees Cook wrote:
> There is no need to memset() both dvs_grid_info and dvs_stat_grid_info
> separately: they are part of the same union. Instead, just zero the
> union itself. This additionally avoids a false positive (due to a
> gcc optimization bug[1]) when building with the coming FORTIFY_SOURCE
> improvements:
>
> In function 'fortify_memset_chk',
> inlined from 'sh_css_pipe_get_grid_info' at drivers/staging/media/atomisp/pci/sh_css.c:5186:3,
> inlined from 'ia_css_stream_create' at drivers/staging/media/atomisp/pci/sh_css.c:9442:10:
> ./include/linux/fortify-string.h:199:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
> 199 | __write_overflow_field();
> | ^~~~~~~~~~~~~~~~~~~~~~~~
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101419
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
--
Sakari Ailus
prev parent reply other threads:[~2021-07-11 15:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-11 14:51 [PATCH] media: atomisp: Perform a single memset() for union Kees Cook
2021-07-11 15:16 ` Sakari Ailus [this message]
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=20210711151649.GA3@paasikivi.fi.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=vrzh@vrzh.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).