Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4327086rba; Tue, 2 Apr 2024 13:45:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWT8q7WOXERYpgIo3K2R3cXxVs7bpmAoN4GybP4iLxW2fmRPbD87MfL84CVNVP+0LFlSM0cFYtYlKi5fOwO/HekXJXlzQU42j/8qXRx9Q== X-Google-Smtp-Source: AGHT+IHG0lR+vorW4ia0eks5y1ViGngGRhbTTx1+MIA04LFPpBeYadavMFvwqktkG9U91tthDUzd X-Received: by 2002:a05:6512:211:b0:516:b068:a05d with SMTP id a17-20020a056512021100b00516b068a05dmr457088lfo.37.1712090701429; Tue, 02 Apr 2024 13:45:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712090701; cv=pass; d=google.com; s=arc-20160816; b=GcczlifzZ++IwT0kOfa7owzILuTl4hhxcaV3WRo+5LqLaFqgAJ0fzaGDr/D4v7Bi9H PJecSyc5AbDiud99Q5FRhsodjUINypdsz/pDvMnb4tFlaGwfO5sHYQaNUBihiaTOfgdy +ezaM+j3EkDjOd5EuanMu6uGk7Ek0TK+cDHTAX8/cQJrJ9qmvhiWKwb3c2lTUjgG4PHE 5hcTFintFmTeHRhLnhrqtUigAHFFOr2zDfYKIRHk4RZxQgJc+cO4ixCvfuOeSxGK+SOc hhorlwpd5o4BH6IJbSnu7lPHDo2AmkPs4P+UojGBRzSzTffFKYg+NKRVWy5irKCGOome dcOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=wIwFBC2rK0p1PhemtWYBiHcMNF/WCdSgeYAe4DBroDE=; fh=D543v2h3bN4lEfPHNiNCtwzoTzrG7fyNFi2NHXB9+0Y=; b=wQeid3A9WLHXTGlqrQFQOLTJ9ffiM2fczaGyBGGWfV9tBhZl+lleiyeYOolqdkzlgn wtEjJdiDmnULZG+swAaIo1UW5GtvO7h6LkZu48zsKWW39ShYR3tG1E6td+kR2EV8yRlH mcDzLOaCfHDEyyVhvpaUgIKAonl04KchbmB+boONS4tNeJKHV2DQx7fdB58cK0HlFs+C cqfaOGTkbIsygl1AcyX5wMY7ww5PlHdn0WPaGU9xaTTt8S6+o9CaJDxwOAiT+gs3Hgm6 DsXG7cIEQuAUVOGQAaedd2Hq30nABr/9z8OyhmBOsssYL3S50UL8sUc9BJQyW5SRUG5i ZHCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-128672-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128672-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q20-20020a170906b29400b00a4e85cde33fsi1139676ejz.886.2024.04.02.13.45.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 13:45:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128672-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-128672-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128672-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C5AE51F22E42 for ; Tue, 2 Apr 2024 20:42:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBFA115E1EE; Tue, 2 Apr 2024 20:42:19 +0000 (UTC) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06B2E15ADB1; Tue, 2 Apr 2024 20:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712090539; cv=none; b=Zy+6DMa1rhD+7A5aPwNUeZl4jCETdIm3ql5B+4GDfcQeLb3plQlZMv7nhhDp06ZyfvbgIf+6LtC8djEQTPNKh9fCbAnlB7ZNUfGAtmbv+u9YslwWf6ov+ON2q4kWbrzECMfyroqAQgTXgeqT6knHP+JFZgXLSk7azveS6Liu6MU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712090539; c=relaxed/simple; bh=1P+GlGkD9m8hfVX1chHE40TikKKNL8DKwYPzhGMLehI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=QCeoEcuRC+jiREvxetIJeZ8a41/KSALEamTnABBFtK3S4trqxRlXPhmlbIIjZmgVW0YVzoLGcauQcbeRaP/CgAetdkWXjWOz991ASREy8GgKAgpz0Am9ITLfXJNEU9Npa+r7oxeGnS6B8qrMgNuPymi+XxTfRkwAJV2E8iCWJC0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-5c6bd3100fcso3410708a12.3; Tue, 02 Apr 2024 13:42:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712090537; x=1712695337; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wIwFBC2rK0p1PhemtWYBiHcMNF/WCdSgeYAe4DBroDE=; b=qDwv/aXizn4yEIufAi9Wi57KYi2b7A5q25nNWTbBEaeSrv9uVUpcqjkJT8wYxDh1Xg ckA17ewfWLMacU/pCIT3E31Yn3cuS2u912dzqzL1ubEoQjqOCgNl6wKMxM2kjfhdeGoC XwVRqTHo/5hYCukshVNOHtwV4GzyE6eTzfUd73DGwwkd3DWB7/Acyjbbw5KTTg+/0QD5 zonzm0HzU1mbEg4mGXRhmcq/LHlATV4d0lxrOeCirhbJtk39hpxZqyZXGcICZRTU5VGa 9Vy4JG5gNBSHsNl33j/KRQurk9rayKoGRJtRZ3akwr1ZVBzd1Z9gbAq4UF2ID/aaJXrm jfIA== X-Forwarded-Encrypted: i=1; AJvYcCUXz7MEg8mchPeubZXYq54NTiH2kfYuarSK0R1bMcU0J6JfI35lDvwTRt6rMaz4/nLPCT23a8cUTvnA/yTdqErzNq7mYXSlfzXwuFO1H10VUbf9Ev4xo0BDzYgEl7Ty9rzFQaHyi3z2vi6QMzcpaUcnR2rO4fU3SRJzbBdyW4M+IFluqg== X-Gm-Message-State: AOJu0YyKkldVdjH6kn4aJj1fb7GaaSuaHYRXXtl661UbOQuwNiqds+6X EMg3gTNDQvBH1OXVnpKukpsb9AQbjM5Ijt3E5VXoubeq0OlmSKOQMpicxFOMB7d1W5Ayh1rry3V Po5VCTQJhdVwcuPw+R7jsk+mJ2g8= X-Received: by 2002:a05:6a20:158b:b0:1a3:6dbb:f072 with SMTP id h11-20020a056a20158b00b001a36dbbf072mr12114278pzj.8.1712090537213; Tue, 02 Apr 2024 13:42:17 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240402184543.898923-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 2 Apr 2024 13:42:05 -0700 Message-ID: Subject: Re: [PATCH] perf lock contention: Add a missing NULL check To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Song Liu , bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 2, 2024 at 12:45=E2=80=AFPM Arnaldo Carvalho de Melo wrote: > > On Tue, Apr 02, 2024 at 11:45:43AM -0700, Namhyung Kim wrote: > > I got a report for a failure in BPF verifier on a recent kernel with > > perf lock contention command. It checks task->sighand->siglock without > > checking if sighand is NULL or not. Let's add one. > > > > ; if (&curr->sighand->siglock =3D=3D (void *)lock) > > 265: (79) r1 =3D *(u64 *)(r0 +2624) ; frame1: R0_w=3Dtrusted_ptr_= task_struct(off=3D0,imm=3D0) R1_w=3Drcu_ptr_or_null_sighand_struct(off=3D0,= imm=3D0) > > 266: (b7) r2 =3D 0 ; frame1: R2_w=3D0 > > 267: (0f) r1 +=3D r2 > > R1 pointer arithmetic on rcu_ptr_or_null_ prohibited, null-check it f= irst > > processed 164 insns (limit 1000000) max_states_per_insn 1 total_state= s 15 peak_states 15 mark_read 5 > > -- END PROG LOAD LOG -- > > libbpf: prog 'contention_end': failed to load: -13 > > libbpf: failed to load object 'lock_contention_bpf' > > libbpf: failed to load BPF skeleton 'lock_contention_bpf': -13 > > Failed to load lock-contention BPF skeleton > > lock contention BPF setup failed > > lock contention did not detect any lock contention > > > > Signed-off-by: Namhyung Kim > > Acked-by: Arnaldo Carvalho de Melo > > Are you going to have this merged into perf-tools? > > A Fixes: tag isn't perhaps needed as it worked in the past? Fixes: 1811e82767dcc ("perf lock contention: Track and show siglock with address") It was introduced in v6.4 and it should be fine to have this even without the error. I'll queue it to perf-tools. Thanks, Namhyung