From: Simon Horman <horms@kernel.org>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Michael Chan <michael.chan@broadcom.com>,
Artem Chernyshev <artem.chernyshev@red-soft.ru>,
netdev@vger.kernel.org
Subject: Re: [PATCH] net: b44: fix clang-specific fortify warning
Date: Sat, 13 Jan 2024 15:56:24 +0000 [thread overview]
Message-ID: <20240113155624.GJ392144@kernel.org> (raw)
In-Reply-To: <20240112103743.188072-1-dmantipov@yandex.ru>
On Fri, Jan 12, 2024 at 01:37:33PM +0300, Dmitry Antipov wrote:
> When compiling with clang 17.0.6 and CONFIG_FORTIFY_SOURCE=y, I've
> noticed the following warning (somewhat confusing due to absence of
> an actual source code location):
>
> In file included from ./drivers/net/ethernet/broadcom/b44.c:17:
> In file included from ./include/linux/module.h:13:
> In file included from ./include/linux/stat.h:6:
> In file included from ./arch/arm64/include/asm/stat.h:12:
> In file included from ./include/linux/time.h:60:
> In file included from ./include/linux/time32.h:13:
> In file included from ./include/linux/timex.h:67:
> In file included from ./arch/arm64/include/asm/timex.h:8:
> In file included from ./arch/arm64/include/asm/arch_timer.h:12:
> In file included from ./arch/arm64/include/asm/hwcap.h:9:
> In file included from ./arch/arm64/include/asm/cpufeature.h:26:
> In file included from ./include/linux/cpumask.h:12:
> In file included from ./include/linux/bitmap.h:12:
> In file included from ./include/linux/string.h:295:
> ./include/linux/fortify-string.h:588:4: warning: call to '__read_overflow2_field'
> declared with 'warning' attribute: detected read beyond size of field (2nd parameter);
> maybe use struct_group()? [-Wattribute-warning]
> 588 | __read_overflow2_field(q_size_field, size);
> | ^
>
> The compiler actually complains on 'b44_get_strings()' because the
> fortification logic inteprets call to 'memcpy()' as an attempt to
> copy the whole array from its first member and so issues an overread
> warning. This warning may be silenced by passing an address of the
> whole array and not the first member to 'memcpy()'.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
This patch is for net-next, when reposting please annotate this
in the subject.
Subject: [PATCH net-next v2] ...
[adapted from text by Jakub]
## Form letter - net-next-closed
The merge window for v6.8 has begun and therefore net-next is closed
for new drivers, features, code refactoring and optimizations.
We are currently accepting bug fixes only.
Please repost when net-next reopens on or after 22nd January.
RFC patches sent for review only are obviously welcome at any time.
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
--
pw-bot: defer
prev parent reply other threads:[~2024-01-13 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 10:37 [PATCH] net: b44: fix clang-specific fortify warning Dmitry Antipov
2024-01-13 15:56 ` Simon Horman [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=20240113155624.GJ392144@kernel.org \
--to=horms@kernel.org \
--cc=artem.chernyshev@red-soft.ru \
--cc=dmantipov@yandex.ru \
--cc=michael.chan@broadcom.com \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).