Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7235351rwb; Tue, 15 Nov 2022 09:19:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7iRuErSCr8XpHVkljhLGSq/XmeZkFG7F+ihH4H2QocpcpU0MK8PiPPmTYSQxPbcPXE7mZE X-Received: by 2002:a65:55c8:0:b0:457:a1a5:3ce with SMTP id k8-20020a6555c8000000b00457a1a503cemr17108026pgs.416.1668532778786; Tue, 15 Nov 2022 09:19:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668532778; cv=none; d=google.com; s=arc-20160816; b=O2XTWqYPz6bPN1hI0HanahBYpgKA9A7LOZGkrbswnloVjoF/GS4sNLtKXwX4c+yOAo R97MJEN1dBbLLmdGgD2e07Ne76lyFjQfVnO103zIRZ3HIRLvZZvJHaVAgmkZ5d687BPw J86X9RnVCX0hPXbluhX8oiSOFX+1W1dh5ofKcLDK+H6eZggL+hQ//F4kYK6HWDHaRxIf XjpvCUTDV3AUKLH7xbR92dhkJ5ou8c5ZNSUyxsYSl9UenOyO/Ap9Vk9foLf3ZrRL1E0u ZwNekUFEQFY9D78fPzHQE8qvGffKDERDiHav8uYZIO6JFf8gdAl2Zu6Gb21E9i1PPOR8 ElXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=VRNh05oNOBSO3e3N+oS8ulifbW6+Wo/eunoiGxes4G8=; b=fofcpTKucZM0jki8mQf5zdK9TzHc7M/80M7LL7a4DuHS1WGz+iuC507v2cPiVDFsWm woKQchzakrN4rq8rr0lXkJD8scu83peLlSXW0QGmVB/W0beem+qSauflkG/GB0JdlP8L oolbZlWRrds1Xkq0Qn7gC8mK0TdQefJlzSBWH9KK7kIe7Cvt/q18hkZwq1t8LMTg9MVV BNwJmMzNIPmeoFr6rK0JlDNace7u6nLrEOKdcXZ3gFzz8cvlh6SNTm+XcqZjuCF6cmRt FHhd6Vt3zCM1zA8IY5fSuDmL1LqQEtBFUMqrZii0C99asHXTgDUs+AHoXMvK3z91Lj6G raJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=g1NyMIiD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j69-20020a638048000000b00476c531cef9si1565237pgd.601.2022.11.15.09.19.26; Tue, 15 Nov 2022 09:19:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=g1NyMIiD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbiKORBY (ORCPT + 91 others); Tue, 15 Nov 2022 12:01:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbiKORBU (ORCPT ); Tue, 15 Nov 2022 12:01:20 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3189326571; Tue, 15 Nov 2022 09:01:19 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id h186-20020a1c21c3000000b003cfe48519a6so573234wmh.0; Tue, 15 Nov 2022 09:01:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=VRNh05oNOBSO3e3N+oS8ulifbW6+Wo/eunoiGxes4G8=; b=g1NyMIiDpe6R9MGBxnLQr3ww8IkrMfGj+/F+Ujq9sFGVdDhevPGMcvV+g+KiH/LJEr 0siG0y0WOZd23PsQHaYswqIZ6C1Gz/y777cidMA9nzbgf8S25nCP2rXcyKpmF+02T+vb T3HEcJ4nhxBZZtmpU2q1sAFsPvhOpyxtotGiZEjvXOupv2Hx3zsqLaL9gJlSdNpObWxw +dIfy2WBgM8KKaXZiq/lJHPGQAsrpvvlIMF1mx9t7T1FbGClj8phSukYi5TRvo2Pgacs 0UHwvJ7jwFTJ25X150i0XD6OfoWURgx8po8DoHcRFCzxtkEST0W7AMkv20bBu5eXcJt6 /2XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VRNh05oNOBSO3e3N+oS8ulifbW6+Wo/eunoiGxes4G8=; b=uFnofKf5PdLm6+wrU4amvLynrVw3u1dr5xEg59O/+hFxY55OtLUzw04fRbNKQma7oT lL//E2MfzC/0i0o5GOOU/x3JIICH9QjGKe6f6QpiTeX9AoXiJe4vRn87WTYrVqSE6Lxm +MGkOD+DDA0sBvtUid1fsFIh/YuaLtCbiInFSJ2Mt+xTIaeupjTjkb666xLnkDciSL8M 9d1u4SNxspL/6+2VcKEnndz6KMfh0yRkx6mUAnnMqvZJxyLwS2SQo3O+oo6ERSYciwla OeXRTNmMbjh5LL8ZZByfPGALdOxZ5LotZFF40sfudhKVbu4xv01+aI2fZ1CCBQN9Dj+1 3Wxw== X-Gm-Message-State: ANoB5pmR87kSPEQTOJWzqX9i/zfBxOSDzHsaCtC+LyUrWmLIF6FUTa58 JxWEu+GC7DzBi1gG3RXPhfDvlAzl+wj/Tw== X-Received: by 2002:a1c:2581:0:b0:3cf:6a83:c7a3 with SMTP id l123-20020a1c2581000000b003cf6a83c7a3mr2110946wml.21.1668531677496; Tue, 15 Nov 2022 09:01:17 -0800 (PST) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id cy6-20020a056000400600b002416ecb8c33sm12682146wrb.105.2022.11.15.09.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 09:01:17 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Tue, 15 Nov 2022 18:01:15 +0100 To: Hao Sun Cc: Jiri Olsa , Alexei Starovoitov , Alexei Starovoitov , Linux Kernel Mailing List , Andrii Nakryiko , bpf , Daniel Borkmann , Hao Luo , John Fastabend , KP Singh , Martin KaFai Lau , Stanislav Fomichev , Song Liu , Yonghong Song Subject: Re: WARNING in bpf_bprintf_prepare Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 15, 2022 at 09:48:27AM +0800, Hao Sun wrote: SNIP > > > > Hi Jirka, > > > > > > > > I've tested the proposed patch, the warning from bpf_bprintf_prepare will not > > > > be triggered with the patch, but the reproducer can still trigger the following > > > > warning. My test was conducted on: > > > > > > > > commit: f67dd6ce0723 Merge tag 'slab-for-6.1-rc4-fixes' > > > > git tree: upstream > > > > kernel config: https://pastebin.com/raw/sE5QK5HL > > > > C reproducer: https://pastebin.com/raw/X96ASi27 > > > > console log *before* the patch: https://pastebin.com/raw/eSCUNFrd > > > > console log *after* the patch: https://pastebin.com/raw/tzcmdWZt > > > > > > thanks for testing.. I can't reproduce this for some reason > > > > > > I'll check some more and perhaps go with denying bpf attachment > > > for this tracepoint as Alexei suggeste > > > > the change below won't allow to attach bpf program with any printk > > helper in contention_begin and bpf_trace_printk tracepoints > > > > I still need to test it on the machine that reproduced the issue > > for me.. meanwhile any feedback is appreciated > > > > Hi, > > Tested on my machine, the C reproducer won't trigger any issue > this time with the patch. The test was conducted on: > > commit: f67dd6ce0723 Merge tag 'slab-for-6.1-rc4-fixes' > git tree: upstream > kernel config: https://pastebin.com/raw/sE5QK5HL > C reproducer: https://pastebin.com/raw/X96ASi27 > full console log *before* the patch: https://pastebin.com/raw/n3x55RDr > full console log *after* the patch: https://pastebin.com/raw/7HdxnCnL thanks, looks good on my end as well jirka