Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1672745

Re: [PATCH] net: phy: smsc: fix buffer overflow in memcpy

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] net: phy: smsc: fix buffer overflow in memcpy
Date 2017-06-22 17:20 +0200
Message-ID <tVc3N-6uM-33@gated-at.bofh.it> (permalink)
References <tUyg2-4YJ-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 20 Jun 2017 22:40:46 +0200

> The memcpy annotation triggers for a fixed-length buffer copy:
> 
> In file included from /git/arm-soc/arch/arm64/include/asm/processor.h:30:0,
>                  from /git/arm-soc/arch/arm64/include/asm/spinlock.h:21,
>                  from /git/arm-soc/include/linux/spinlock.h:87,
>                  from /git/arm-soc/include/linux/seqlock.h:35,
>                  from /git/arm-soc/include/linux/time.h:5,
>                  from /git/arm-soc/include/linux/stat.h:21,
>                  from /git/arm-soc/include/linux/module.h:10,
>                  from /git/arm-soc/drivers/net/phy/smsc.c:20:
> In function 'memcpy',
>     inlined from 'smsc_get_strings' at /git/arm-soc/drivers/net/phy/smsc.c:166:3:
> /git/arm-soc/include/linux/string.h:309:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
> 
> Using strncpy instead of memcpy should do the right thing here.
> 
> Fixes: 030a89028db0 ("net: phy: smsc: Implement PHY statistics")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

APplied to net-next, thanks Arnd.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] net: phy: smsc: fix buffer overflow in memcpy Arnd Bergmann <arnd@arndb.de> - 2017-06-20 22:50 +0200
  Re: [PATCH] net: phy: smsc: fix buffer overflow in memcpy Andrew Lunn <andrew@lunn.ch> - 2017-06-20 23:50 +0200
  Re: [PATCH] net: phy: smsc: fix buffer overflow in memcpy David Miller <davem@davemloft.net> - 2017-06-22 17:20 +0200

csiph-web