Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5328801pxu; Tue, 22 Dec 2020 14:09:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAmQnMFee28+zWG3iVqro/u02PWrtYFO2x6Lv+BEyD4FYU8gc/xqtQerOdkRLlVP/VlXic X-Received: by 2002:a50:e0ce:: with SMTP id j14mr22519013edl.18.1608674990606; Tue, 22 Dec 2020 14:09:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608674990; cv=none; d=google.com; s=arc-20160816; b=FYtP73g95wXx4u5tsUiDAoHAl/DlXQTRxUhsaP+06CcbZCS0KgCOY4RxCEbgyMtOkp lv7bmWrxfLLEFG9wRALTtgjZvWlfYGgi86VlgCZ2QHEfsRbONe5/RIjF3T5/QjSYYRoU 2n09LPA3Skq7CHPFzMQ9Q/LL6voq7hjUBup0IgNvj1IBQJJJtMXTWpmZ9PWFvOj4h++I gFnSu4N0FDUrg6bqkRRiFhTgnJn8FPl4eEvzUhfncyuW9VCUej+ITR8XtfpoiuXaIKuJ hSkLXAK/nUjMRLqFgWZFbGYQr38gKDBPUUynaJrsB+A533Rl7sZlgBKC9qWhf2fnUMX9 ciOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0/a10qPwK9BwgNtdpQJMh/lQWv1OSB0g+9xcOQghJHU=; b=q12YYcCyTpj7LSPE0Oj0HNsHl2uMOVszURBtPbSJRESOvRDB3HX36YP/Ygx97qmno0 u2fZSzV7RyQDctp3EvCrVbnOZgmnFyV1XTM8M2kBgf/1+URf/KNcpqL3ngA92lg+t6L6 gOjtvEkQPTSrha+JqNjH95OvLVxLSZQ1vbloMTL8MgEp3++4/55D7stSFUfCxKk9y5Ku cBqKBQXf7jyW1aTDOKfIL0UJc1q/R3t6uLTbUKZXz28/4rpmn4Ds+Gw2yID9itdUe4jO M1XPEXn8jQxpEnEimM9aPnFtEugFcAshEJUZv/unVnrYG1Q+uHqo4MD3C11IXUSh7B9X Gjqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp24si11234741ejb.371.2020.12.22.14.09.28; Tue, 22 Dec 2020 14:09:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727409AbgLVWIJ (ORCPT + 99 others); Tue, 22 Dec 2020 17:08:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727149AbgLVWII (ORCPT ); Tue, 22 Dec 2020 17:08:08 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D604C0613D3; Tue, 22 Dec 2020 14:07:28 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1krpoN-0001oG-Lf; Tue, 22 Dec 2020 23:07:19 +0100 Date: Tue, 22 Dec 2020 23:07:19 +0100 From: Florian Westphal To: Linus Torvalds Cc: syzbot , Andrew Morton , coreteam@netfilter.org, David Miller , Florian Westphal , Jakub Jelinek , Lai Jiangshan , Jozsef Kadlecsik , Jakub Kicinski , Linux Kernel Mailing List , Netdev , NetFilter , Pablo Neira Ayuso , Peter Zijlstra , syzkaller-bugs , Tejun Heo Subject: Re: kernel BUG at lib/string.c:LINE! (6) Message-ID: <20201222220719.GB9639@breakpoint.cc> References: <000000000000fcbe0705b70e9bd9@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote: > On Tue, Dec 22, 2020 at 6:44 AM syzbot > wrote: > > > > The issue was bisected to: > > > > commit 2f78788b55ba ("ilog2: improve ilog2 for constant arguments") > > That looks unlikely, although possibly some constant folding > improvement might make the fortify code notice something with it. > > > detected buffer overflow in strlen > > ------------[ cut here ]------------ > > kernel BUG at lib/string.c:1149! > > Call Trace: > > strlen include/linux/string.h:325 [inline] > > strlcpy include/linux/string.h:348 [inline] > > xt_rateest_tg_checkentry+0x2a5/0x6b0 net/netfilter/xt_RATEEST.c:143 > > Honestly, this just looks like the traditional bug in "strlcpy()". Yes, thats exactly what this is, no idea why the bisection points at ilog2 changes. > That BSD function is complete garbage, exactly because it doesn't > limit the source length. People tend to _think_ it does ("what's that > size_t argument for?") but strlcpy() only limits the *destination* > size, and the source is always read fully. Right, I'll send a patch shortly.