Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4772772ybl; Mon, 26 Aug 2019 15:58:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi72Lz7qbUkEt0zG8kjbLC8iWwXyzW/C6ffc0uQ+6Exv/whdU4zzjCqMRzMdYUG77t3eAN X-Received: by 2002:a62:ab13:: with SMTP id p19mr9883815pff.20.1566860335013; Mon, 26 Aug 2019 15:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566860335; cv=none; d=google.com; s=arc-20160816; b=jmsVanm301N40DZ0kI/u8FjTQhP2BY7vCGVALHXNLtt5q0Zrn7C+3KVszUEaKuWI8L Y+uOZquAQ0v61hBK1TEJSzoDsNFLjAacCRFy+5m7+4Dlhl0TaiRJhWM3Y3kNTb5WkMja NPnwnXgGqZCr/QOocrafenlNMmJ2eNHIRQ1UUqTqcRIP6FLvGOvHmMp9SruRPtr+3Ulc bVc8T2pD350YiFENRPftmIm+nE7s6TmjSBjJDMaJ3yczXKuP39lub3GdRtIb28JfyCLT a5Xbbj5qil3XfzGHqlT6Qjmntgx7U/RK1NfF3MWDNpH7u7vLi3DWjyKWKQnXQAgUtm6x +ZIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xA1R9dD2TutV2Z170ahV4G14Z1OgTzuJeruk3z7eV2c=; b=rtG/JtrZya8rz0Aem0JuziNIw6ScUp6GnanuMfZpooO22y3Wfp2ptTXPWm7miFHngL godu9GrJJdEyZ25A4P+kEoIEpxGpVjJYlwPOX5tHhOHbh+wwbIb89FaFnFA6t2leAFbK 8PqFrmSGRBfOH5DEe21uCmRuviFv24Mk6MjvDC/TFYW9n9R1f1fBkRljwaq/yO3qF0fx Zv+rnudqw0UTgF4qHQzyDJRkzuBc/lbdlmIUGWTX+vLOy0CZggL46n74GgW45dUkHrp4 TCj0ZgFl44K9KQVSDmngyqWk6/EqgbNtdpHyH2jZVsjt0u3auDGH7EfeXSdWsWy6oXoc 01CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AERbP4Rz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f196si11995038pfa.57.2019.08.26.15.58.39; Mon, 26 Aug 2019 15:58:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AERbP4Rz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbfHZW5w (ORCPT + 99 others); Mon, 26 Aug 2019 18:57:52 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35561 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbfHZW5v (ORCPT ); Mon, 26 Aug 2019 18:57:51 -0400 Received: by mail-pf1-f193.google.com with SMTP id d85so12779480pfd.2 for ; Mon, 26 Aug 2019 15:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xA1R9dD2TutV2Z170ahV4G14Z1OgTzuJeruk3z7eV2c=; b=AERbP4Rztk3SN5GtGKXtX3TrZ3m/fScubto0XvP+6FDz7VMVU42cAXy6NC3pczw2bc Gwxkpv1s0w69sq4xkWimuKQLIT+DUYruxRwHOVqU8Pqd7P5EpsPGoCEGJchwJ2MUVgEw UPr6LTjpKdJYBCt3d81empjWYPFoCDP7TInHRL9WzZcBx+p4f82RulMm5fIBPu0leQlp TCJajvb8StSXaK8V136MGkMNIhdzdQvoG3y4157iLyd7IQKR75LcVeQz3bsfeD8N15kx CaSDRuOoUl7fNQWbXkKzDPA0yuQelVrDAHr0nEPpM5alelZU1mWOAZvT6b3nAbmuc6iH af1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xA1R9dD2TutV2Z170ahV4G14Z1OgTzuJeruk3z7eV2c=; b=lsv6Di/zpDU59wESEgIDLdYProOdjsCUpsh1qBGycHRyUPCe1IG/cxqHsGE8os7QwB LuzsXTxbAAvuvJCcxg3bWNcgFLnczOLx8+pKFulotBsNerFt/MZqP3uYVO6wYF4Sj0E+ a//V0KFyIfrW7ZudKTIZLoTf3jFN3+2TypazDsNiSPUQzhRQwlwp/+B1v0t3to/h+4Q8 d/VqsYh8G3puoQSOFi+9mjqWCXPBSD87p7ac8TnYoBMzNBgEyBI2fcurnd2CP/YywngR 6RQy4PQ2DPE02jF+UWih4S2wqNzHTXS+J6xIg6delr2a+VmFw7VhM62p1ezelKNu4N/G qVsQ== X-Gm-Message-State: APjAAAUOFIsPN7Q4/ENQRYuNlQXuV4z/hARB1gmeq2PQhFcYGYw6Ai5j CHEZWDgbXgzPCHEPfdwz7cYQRCpuiaCuX/94g+qb1A== X-Received: by 2002:a17:90a:c20f:: with SMTP id e15mr21969838pjt.123.1566860270396; Mon, 26 Aug 2019 15:57:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Desaulniers Date: Mon, 26 Aug 2019 15:57:39 -0700 Message-ID: Subject: Re: a bug in genksysms/CONFIG_MODVERSIONS w/ __attribute__((foo))? To: Ard Biesheuvel , Masahiro Yamada , Linus Torvalds , Greg KH , Will Deacon , Arnd Bergmann , Michal Marek , Nicholas Piggin Cc: LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 26, 2019 at 2:22 PM Nick Desaulniers wrote: > > I'm looking into a linkage failure for one of our device kernels, and > it seems that genksyms isn't producing a hash value correctly for > aggregate definitions that contain __attribute__s like > __attribute__((packed)). > > Example: > $ echo 'struct foo { int bar; };' | ./scripts/genksyms/genksyms -d > Defn for struct foo == > Hash table occupancy 1/4096 = 0.000244141 > $ echo 'struct __attribute__((packed)) foo { int bar; };' | > ./scripts/genksyms/genksyms -d > Hash table occupancy 0/4096 = 0 > > I assume the __attribute__ part isn't being parsed correctly (looks > like genksyms is a lex/yacc based C parser). > > The issue we have in our out of tree driver (*sadface*) is basically a > EXPORT_SYMBOL'd function whose signature contains a packed struct. > > Theoretically, there should be nothing wrong with exporting a function > that requires packed structs, and this is just a bug in the lex/yacc > based parser, right? I assume that not having CONFIG_MODVERSIONS > coverage of packed structs in particular could lead to potentially > not-fun bugs? Or is using packed structs in exported function symbols > with CONFIG_MODVERSIONS forbidden in some documentation somewhere I > missed? Ah, looks like I'm late to the party: https://lwn.net/Articles/707520/ -- Thanks, ~Nick Desaulniers