All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] ethtool: fix string set id check
@ 2020-12-14 13:25 Michal Kubecek
  2020-12-16 19:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Kubecek @ 2020-12-14 13:25 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev; +Cc: linux-kernel

Syzbot reported a shift of a u32 by more than 31 in strset_parse_request()
which is undefined behavior. This is caused by range check of string set id
using variable ret (which is always 0 at this point) instead of id (string
set id from request).

Fixes: 71921690f974 ("ethtool: provide string sets with STRSET_GET request")
Reported-by: syzbot+96523fb438937cd01220@syzkaller.appspotmail.com
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 net/ethtool/strset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index 0baad0ce1832..c3a5489964cd 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -182,7 +182,7 @@ static int strset_parse_request(struct ethnl_req_info *req_base,
 		ret = strset_get_id(attr, &id, extack);
 		if (ret < 0)
 			return ret;
-		if (ret >= ETH_SS_COUNT) {
+		if (id >= ETH_SS_COUNT) {
 			NL_SET_ERR_MSG_ATTR(extack, attr,
 					    "unknown string set id");
 			return -EOPNOTSUPP;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ethtool: fix string set id check
  2020-12-14 13:25 [PATCH net] ethtool: fix string set id check Michal Kubecek
@ 2020-12-16 19:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-12-16 19:20 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: davem, kuba, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Mon, 14 Dec 2020 14:25:01 +0100 (CET) you wrote:
> Syzbot reported a shift of a u32 by more than 31 in strset_parse_request()
> which is undefined behavior. This is caused by range check of string set id
> using variable ret (which is always 0 at this point) instead of id (string
> set id from request).
> 
> Fixes: 71921690f974 ("ethtool: provide string sets with STRSET_GET request")
> Reported-by: syzbot+96523fb438937cd01220@syzkaller.appspotmail.com
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
> 
> [...]

Here is the summary with links:
  - [net] ethtool: fix string set id check
    https://git.kernel.org/netdev/net/c/efb796f5571f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-16 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 13:25 [PATCH net] ethtool: fix string set id check Michal Kubecek
2020-12-16 19:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.