From: David Laight <David.Laight@ACULAB.COM>
To: "'Andrew Morton'" <akpm@linux-foundation.org>,
Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Ding Tianhong <dingtianhong@huawei.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
LinuxArm <linuxarm@huawei.com>
Subject: RE: [PATCH v2] ubsan: don't handle misaligned address when support unaligned access
Date: Fri, 8 Dec 2017 10:00:52 +0000 [thread overview]
Message-ID: <d52530dfa78b458ca413cada22f3f396@AcuMS.aculab.com> (raw)
In-Reply-To: <20171207152453.7aaf8f420ebf69d13c29a761@linux-foundation.org>
From: Andrew Morton
> Sent: 07 December 2017 23:25
> On Thu, 7 Dec 2017 16:31:23 +0300 Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
>
> > On 12/07/2017 03:49 AM, Andrew Morton wrote:
> > > (correcting Andrey's email address)
> > >
> > >
> > > From: Ding Tianhong <dingtianhong@huawei.com>
> > > Subject: lib/ubsan.c: don't handle misaligned address when kernel supports unaligned access
> > >
> > > ubsan reports a warning like:
> > >
> > > UBSAN: Undefined behaviour in ../include/linux/etherdevice.h:386:9
> > > load of misaligned address ffffffc069ba0482 for type 'long unsigned int'
> > > which requires 8 byte alignment
> > > CPU: 0 PID: 901 Comm: sshd Not tainted 4.xx+ #1
> > > Hardware name: linux,dummy-virt (DT)
> > > Call trace:
> > > [<ffffffc000093600>] dump_backtrace+0x0/0x348
> > > [<ffffffc000093968>] show_stack+0x20/0x30
> > > [<ffffffc001651664>] dump_stack+0x144/0x1b4
> > > [<ffffffc0016519b0>] ubsan_epilogue+0x18/0x74
> > > [<ffffffc001651bac>] __ubsan_handle_type_mismatch+0x1a0/0x25c
> > > [<ffffffc00125d8a0>] dev_gro_receive+0x17d8/0x1830
> > > [<ffffffc00125d928>] napi_gro_receive+0x30/0x158
> > > [<ffffffc000f4f93c>] virtnet_receive+0xad4/0x1fa8
> > >
> > > The reason is that when enabling the CONFIG_UBSAN_ALIGNMENT, ubsan will
> > > report the unaligned access even if the system supports it
> > > (CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y). This produces a lot of noise
> > > in the log and causes confusion.
> > >
> >
> > NACK. This doesn't make sense. If you don't want to see misaligned access reports
> > you simply shouldn't enable CONFIG_UBSAN_ALIGNMENT.
>
> So should UBSAN Kconfig disable CONFIG_UBSAN_ALIGNMENT when
> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y?
>From the look of the code fragment it would appear that the function
is called when the original request wasn't actioned.
But you either want to action it or print the error.
Jus suppressing the error message cannot be right.
David
next prev parent reply other threads:[~2017-12-08 10:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-02 5:46 Ding Tianhong
2017-12-07 0:49 ` Andrew Morton
2017-12-07 1:11 ` Ding Tianhong
2017-12-07 13:31 ` Andrey Ryabinin
2017-12-07 23:24 ` Andrew Morton
2017-12-08 10:00 ` David Laight [this message]
2017-12-08 10:48 ` Andrey Ryabinin
2017-12-08 11:14 ` David Laight
2017-12-08 11:45 ` Andrey Ryabinin
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=d52530dfa78b458ca413cada22f3f396@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=dingtianhong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.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 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®