From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Kees Cook <keescook@chromium.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Arnd Bergmann <arnd@arndb.de>,
linux-media@vger.kernel.org, stable@vger.kernel.org,
"Gustavo A . R . Silva" <gustavoars@kernel.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH RESEND] media: omap3isp: Use struct_group() for memcpy() region
Date: Thu, 27 Jan 2022 09:31:08 +0200 [thread overview]
Message-ID: <YfJKPCXr4RjPL6lc@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20220125092426.7bdfba8f@coco.lan>
Hi Mauro,
On Tue, Jan 25, 2022 at 09:24:26AM +0100, Mauro Carvalho Chehab wrote:
> Em Mon, 24 Jan 2022 09:29:52 -0800
> Kees Cook <keescook@chromium.org> escreveu:
>
> > In preparation for FORTIFY_SOURCE performing compile-time and run-time
> > field bounds checking for memcpy(), memmove(), and memset(), avoid
> > intentionally writing across neighboring fields. Wrap the target region
> > in struct_group(). This additionally fixes a theoretical misalignment
> > of the copy (since the size of "buf" changes between 64-bit and 32-bit,
> > but this is likely never built for 64-bit).
>
>
> > FWIW, I think this code is totally broken on 64-bit (which appears to
> > not be a "real" build configuration): it would either always fail (with
> > an uninitialized data->buf_size) or would cause corruption in userspace
> > due to the copy_to_user() in the call path against an uninitialized
> > data->buf value:
>
> It doesn't matter. This driver is specific for TI OMAP3 SoC, which
> is Cortex-A8 (32-bits). It only builds on 64 bit due to COMPILE_TEST.
I agree that "it doesn't matter" in any real configuration. But if it's
this easy to address omap3isp driver behaving nicely with compile test,
then this is definitely worth merging.
I'll pick the patch to my tree.
--
Kind regards,
Sakari Ailus
next prev parent reply other threads:[~2022-01-27 7:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 17:29 Kees Cook
2022-01-25 8:24 ` Mauro Carvalho Chehab
2022-01-27 7:31 ` Sakari Ailus [this message]
2022-01-26 0:34 ` Laurent Pinchart
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=YfJKPCXr4RjPL6lc@paasikivi.fi.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=arnd@arndb.de \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®