Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1687610
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 |
| Date | 2017-07-14 21:10 +0200 |
| Message-ID | <u3e8p-7II-5@gated-at.bofh.it> (permalink) |
| References | <u2TGF-2pl-13@gated-at.bofh.it> <u39Lt-4DQ-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jul 14, 2017 at 7:25 AM, Dave Jones <davej@codemonkey.org.uk> wrote:
> On Thu, Jul 13, 2017 at 05:16:24PM -0400, Anna Schumaker wrote:
> >
> > git://git.linux-nfs.org/projects/anna/linux-nfs.git tags/nfs-for-4.13-1
>
> Since this landed, I'm seeing this during boot..
>
> ==================================================================
> BUG: KASAN: global-out-of-bounds in strscpy+0x4a/0x230
> Read of size 8 at addr ffffffffb4eeaf20 by task nfsd/688
Is KASAN aware that strscpy() does the word-at-a-time optimistic reads
of the sources?
The problem may be that the source is initialized from the global
string "nfsd", and KASAN may be unhappy abotu the fact that we read 8
bytes from a 5-byte string (four plus NUL) as we do the word-at-a-time
strscpy..
That said, we do check the size first (because we also *write* 8 bytes
at a time), so maybe KASAN shouldn't even need to care.
Hmm. it really looks to me like this is actually a compiler bug (I'm
using current gcc in F26, which is gcc-7.1.1 - I'm assuming DaveJ is
the same).
This is the source code in __ip_map_lookup:
struct ip_map ip;
.....
strcpy(ip.m_class, class);
and "m_class" is 8 bytes in size:
struct ip_map {
...
char m_class[8]; /* e.g. "nfsd" */
...
yet when I look at the generated code for __ip_map_lookup, I see
movl $32, %edx #,
movq %r13, %rsi # class,
leaq 48(%rax), %rdi #, tmp126
call strscpy #
what's the bug here? Look at that third argument - %rdx. It is
initialized to 32.
WTF?
The code to turn "strcpy()" into "strscpy()" should pick the *smaller*
of the two object sizes as the size argument. How the hell is that
size argument 32?
Am I missing something? DaveJ, do you see the same?
Linus
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL] Please pull NFS client changes for Linux 4.13 Anna Schumaker <schumaker.anna@gmail.com> - 2017-07-13 23:20 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-13 23:50 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Christoph Hellwig <hch@infradead.org> - 2017-07-14 09:10 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Anna Schumaker <schumaker.anna@gmail.com> - 2017-07-14 13:40 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Dave Jones <davej@codemonkey.org.uk> - 2017-07-14 16:30 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 "J. Bruce Fields" <bfields@fieldses.org> - 2017-07-14 18:40 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-14 21:10 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Dave Jones <davej@codemonkey.org.uk> - 2017-07-14 21:50 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-14 22:00 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Andrey Rybainin <ryabinin.a.a@gmail.com> - 2017-07-14 22:30 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Daniel Micay <danielmicay@gmail.com> - 2017-07-14 22:40 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Daniel Micay <danielmicay@gmail.com> - 2017-07-14 23:00 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-14 23:00 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Daniel Micay <danielmicay@gmail.com> - 2017-07-14 23:10 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Daniel Micay <danielmicay@gmail.com> - 2017-07-14 23:10 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Daniel Micay <danielmicay@gmail.com> - 2017-07-15 02:00 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Dave Jones <davej@codemonkey.org.uk> - 2017-07-16 23:20 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Trond Myklebust <trondmy@primarydata.com> - 2017-07-17 01:00 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 "davej@codemonkey.org.uk" <davej@codemonkey.org.uk> - 2017-07-17 05:10 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-17 21:10 +0200
csiph-web