Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp161852pxf; Wed, 7 Apr 2021 23:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy46Ozt2VDf/zR0AkD9HIxV0rBYMjBUPNc6T/daU3GCENj1jSuh3yiNN4ehQDjdHbE7zMBa X-Received: by 2002:a17:906:ff15:: with SMTP id zn21mr8151383ejb.296.1617863010730; Wed, 07 Apr 2021 23:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617863010; cv=none; d=google.com; s=arc-20160816; b=FDRZ5H+Wx3eLkJwFlMqM9RqvL+KOUK1ujGFQc+3XML5CdM3Q+FLAF5sVGsXBpp5dlY NjM9aGT5lDZnV0X9bjHbsoECZAKur60o3HXC1HDYCAny70L9nlMMx2E5M9A6AmSOV/VA qo60l6DGbWZxAnBM+3deHQ5vQAZtY/0o2jIjZfpyV5tn0BK7EkIAZoY7a+zJvzv9mMXO ECCSNrlD8dAbwfIrSqt5QV0ezZ3tT8uubsDZ4Jvaz2s9DpfU1UUy9oyupBMUg2D9lJCp KDQ16fbowheY2vfj/VIrq80N9RlzSnFl/KYqktzX+B49FG89vu4tVL0nF6qzxGy7z6Pz Ta7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=TsbSyPqcXIpypJS2UxalQLeYcuAIVrM3yNjiNzBQiuw=; b=Dq8CJg+YT6gOUKhaQT9CR1xOlnP7wbR198tg+2uEQ5MvWe3Dt5BXn4KUKvHXQ3j1VW sd0x7QI1wF+B/xqGrPEjoEN8oM63ZHblp+1yspWL8aTyo0lQnR+MuQ7zeQcTUilhJGdA vNP3yqep8BtRLXI+k1Z4VmAoYndwCxeqlMa8F1/GARtDcNkxZk/hzBj5HRMePq+y99wp klhbaiK2Wmu5VvOP+35pJIvWICYGpaHBPJ38bYmTsj+uDk7UhKUe8dC+JMLe9GAfVozk XXCluw6K0r850PqviMBMFLWVwJKjpHtowzjYU2tlBW9ZIeoULHtN85uaYviB+pK0ih3H u0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MAdstSYY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz5si12284218ejb.453.2021.04.07.23.23.07; Wed, 07 Apr 2021 23:23:30 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b=MAdstSYY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbhDHGUs (ORCPT + 99 others); Thu, 8 Apr 2021 02:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbhDHGUq (ORCPT ); Thu, 8 Apr 2021 02:20:46 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C7D6C061760 for ; Wed, 7 Apr 2021 23:20:35 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id f29so657061pgm.8 for ; Wed, 07 Apr 2021 23:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=TsbSyPqcXIpypJS2UxalQLeYcuAIVrM3yNjiNzBQiuw=; b=MAdstSYYrcSMuaaI8CP2BXExnhOsX2vyV3ze4dGRwDqc8dqULs+9Y+RCyG3aq7ftT7 XUi+TNuqaAHnyZb69kEz+UD9KKQWbQYZaCTelmss7wCI/h4tPfi5rGRNYE7OQ+ZCErdM 9/fUFLVRxgPGFoFlk2E8XysGJqCeZYgfhG/Bo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=TsbSyPqcXIpypJS2UxalQLeYcuAIVrM3yNjiNzBQiuw=; b=ns1Iy7hpHivgw/XHQf03qHQDQZkeXSgJ2ltImFLCdDJGbk/VZZgURUACRChKMqvOha vACzHym1iLoe9hYP3HKQVlXiwbdCUwlFePMKVlR1yzzEi2wZ2A04jW6wuUulhW87yLVi 4yk4Q+x5Le4BHJrDG74+J1RkHTC82xV5AivKbTvtB9fP8MUB24KLJyqc07nHGYT7Jh1M iUPpaoSK1NHDFsJZAShEdCCdN0KjHTwgFNHyrJ9tNBT3TIJGA9xiijifHQeCU1U3+zrL OjdvB6S3yyHQNAFBQAYsKtydJStap1Vwe5Cp+Ih50uRL1OKS6xXdnwRXhTarLDX+32I3 FyGA== X-Gm-Message-State: AOAM531HL7f0EJKJj1FIPTdwugLGGu82i6mIucdVBzvW59YkriEw3pDX /gt4URmPc/Gmyom9sn7QFlodrQ== X-Received: by 2002:a63:f056:: with SMTP id s22mr6642577pgj.369.1617862834841; Wed, 07 Apr 2021 23:20:34 -0700 (PDT) Received: from chromium.org ([2620:15c:202:201:e193:83c5:6e95:43de]) by smtp.gmail.com with ESMTPSA id 184sm6658514pfx.156.2021.04.07.23.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 23:20:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20210331030520.3816265-1-swboyd@chromium.org> <20210331030520.3816265-4-swboyd@chromium.org> Subject: Re: [PATCH v3 03/12] dump_stack: Add vmlinux build ID to stack traces From: Stephen Boyd Cc: Andrew Morton , linux-kernel@vger.kernel.org, Jiri Olsa , Alexei Starovoitov , Jessica Yu , Evan Green , Hsin-Yi Wang , Steven Rostedt , Andy Shevchenko , Matthew Wilcox To: Petr Mladek Date: Wed, 07 Apr 2021 23:20:32 -0700 Message-ID: <161786283299.3790633.9395579294249054249@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Petr Mladek (2021-04-07 07:03:19) > # readelf -Wn vmlinux-5.12.0-rc6-default+=20 >=20 > Displaying notes found in: .notes > Owner Data size Description > Xen 0x00000006 Unknown note type: (0x00000006) = description data: 6c 69 6e 75 78 00=20 > Xen 0x00000004 Unknown note type: (0x00000007) = description data: 32 2e 36 00=20 > Xen 0x00000008 Unknown note type: (0x00000005) = description data: 78 65 6e 2d 33 2e 30 00=20 > Xen 0x00000008 Unknown note type: (0x00000003) = description data: 00 00 00 ffffff80 ffffffff ffffffff ffffffff ffffffff=20 >=20 Thanks for the readelf output. That was most helpful to see what's going on. The buildid code isn't prepared for this it seems. We'll need to check the note data to see if it starts with "GNU\0" and if it does then we use it as the buildid. I'm not sure what this Xen note is that has a type of 3 but I think that's OK, it won't have "GNU" in there so we should ignore it. Does this patch work? ----8<---- diff --git a/lib/buildid.c b/lib/buildid.c index 483abf71eeec..f281dbe6fb83 100644 --- a/lib/buildid.c +++ b/lib/buildid.c @@ -25,6 +25,7 @@ static int parse_build_id_buf(unsigned char *build_id, =20 if (nhdr->n_type =3D=3D BUILD_ID && nhdr->n_namesz =3D=3D sizeof("GNU") && + !strcmp((char *)(nhdr + 1), "GNU") && nhdr->n_descsz > 0 && nhdr->n_descsz <=3D BUILD_ID_SIZE_MAX) { memcpy(build_id,