Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5329032ybl; Tue, 27 Aug 2019 03:00:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyz4JZpeqmDLCQiP4Vile+fBix/g2JKVFAaDRHy4VIEASw7uaX0nBkzWekc+Le1ueE2ZRsa X-Received: by 2002:a17:902:724a:: with SMTP id c10mr7856116pll.163.1566900047448; Tue, 27 Aug 2019 03:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566900047; cv=none; d=google.com; s=arc-20160816; b=yDxamuzoFnS+p32vfSDwxtmQHznzXIihjtP+YLOBa5SuBmwmyhKXFGmh7MNreQQNBm liUfyc6hCZDt2B88/Q2hs9Bh4suM3tU1KyWpw+BVt0x/PNZaea6oDTcyW64H4w+TWA5V EssTPHNSllM6H2lhAj2bJUytWIq38uTLERxThEWqpLi7BtJarIriyoUmMiAUiNF+ptKJ LkV0+92jRgwahV/Y7bQHM/t6UpJeqfIzaACG/oVpC1m6X7R+FVjVsJCgHDuzzl/wJ513 UbPmZFIWfpBBp/K70Rp+EjoW/FpnBAZ6jEM48CW9OZa/qerC3VAW3Rxme+SVQduamh/o j5eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :user-agent:mime-version:in-reply-to:references:cc:to:subject:from :date:dkim-signature; bh=jEhFx3vfpD3BoJif8WNr9up64syJNyS88BzgF6CC/tw=; b=rPlt5SNe9VJJYjQdGzPyA20RcZwgwUcx9yX0gutwCR3+F16xO05F7/7aOeiTzAHkeI Gk8qgdSa/8hRO/maCZVmNqKTG8Y5SWbWZaL4iAqfK+W/weDlFpjCxLgaCvATQXxHWwUN fV/wQCkokR67h+0rjA/LlCo2y+G696V+3JydRfafQYa4hHRz+XK7PCqAbPwe1n35tVfe rwJ7iqRES1Om7mo/9dnwrWyCz8SbGEouXALDIy91r3mpMQK6i3tY0nl3SjgbsK5z5i07 JofZe9MCR+HsI5zaoqVhRJ5UJ9r4t3QYsdcYvPubvY+OQpmQ1eUeWJ66FWywNCRQJDPY duzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OSzmtf8u; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19si12208824plp.413.2019.08.27.03.00.31; Tue, 27 Aug 2019 03:00:47 -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=@gmail.com header.s=20161025 header.b=OSzmtf8u; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728984AbfH0J7Q (ORCPT + 99 others); Tue, 27 Aug 2019 05:59:16 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:42959 "EHLO mail-pf1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbfH0J7Q (ORCPT ); Tue, 27 Aug 2019 05:59:16 -0400 Received: by mail-pf1-f180.google.com with SMTP id i30so13790121pfk.9 for ; Tue, 27 Aug 2019 02:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :user-agent:message-id:content-transfer-encoding; bh=jEhFx3vfpD3BoJif8WNr9up64syJNyS88BzgF6CC/tw=; b=OSzmtf8urJchWBO8iAwIGX2h/49CmnJpgU2aOxixbWgU0KgQkkF+d2Uv0BkHMmcX+e R2dfuz+Tm3PiSx1u7jQWOJB53JpjVg5DLJAnp5QKBFMBOyF9537e+jFDrM5PcZpONggF qz9DslETqQ6rVtY8EfUY05YoYk5PgVj5GHqxwiL/FESEw040GiPnpBOaKUxywGpVcrvj RSyA9/BbD5L6Y9iBUVZDowWjskm+lCdkdl8g8CaknB0Otjr6nqdxygzRpIyl3oovM3ds AvyJRhpEHn9pQB/ki5Nen7nQXP90Imn/zSwLiKjNSDc0NX2/rhp7CtLG/HCMqh9G7rbR VU2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:user-agent:message-id:content-transfer-encoding; bh=jEhFx3vfpD3BoJif8WNr9up64syJNyS88BzgF6CC/tw=; b=Uec9TZXb1dFFiFv9n9Ieimfj3dSMS3SCMySmLu1UOdhjvpRPz57CDiC+aoaJg86ReB ZuZ3uGhE0xau+dYgvXL1f5MxmY1rmAx7mq3kzafv5j9iT1ceMwACVygzDGMc22glgTSb jrTtIPRUNEMVcvIfOLFtouhrUQbYuGOstSFodOQUAYIpgGpAsTBZeReqjv6Sijs53t2C 4JTFGKgwMZC7kVYMv9Ofnk0IeCxKA502G5fqQzw68C2vAFJsTMsA2f+mBvHC5TcaGXPK WDoqLkyAjWUDM7UWXBNpEmCip/UIQ8jXEDqbajt/ZCwkuVw+VL0gRIRQdnlIrxTYQDjc /acA== X-Gm-Message-State: APjAAAX8OaJlSRJbLXNrWbRepX0FFoRHqNnCwxid/znlpuRvhegFpzU2 ROsUlqZMFg7aAbS0PYDVTX0= X-Received: by 2002:a63:6a4a:: with SMTP id f71mr20158183pgc.409.1566899955447; Tue, 27 Aug 2019 02:59:15 -0700 (PDT) Received: from localhost (14-202-91-55.tpgi.com.au. [14.202.91.55]) by smtp.gmail.com with ESMTPSA id g10sm23458048pfb.95.2019.08.27.02.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2019 02:59:14 -0700 (PDT) Date: Tue, 27 Aug 2019 19:58:37 +1000 From: Nicholas Piggin Subject: Re: a bug in genksysms/CONFIG_MODVERSIONS w/ __attribute__((foo))? To: Ard Biesheuvel , Arnd Bergmann , Greg KH , Michal Marek , Nick Desaulniers , Linus Torvalds , Will Deacon , Masahiro Yamada Cc: LKML References: In-Reply-To: MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1566899033.o5acyopsar.astroid@bobo.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nick Desaulniers's on August 27, 2019 8:57 am: > 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 =3D=3D >> Hash table occupancy 1/4096 =3D 0.000244141 >> $ echo 'struct __attribute__((packed)) foo { int bar; };' | >> ./scripts/genksyms/genksyms -d >> Hash table occupancy 0/4096 =3D 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? >=20 > Ah, looks like I'm late to the party: > https://lwn.net/Articles/707520/ Yeah, would be nice to do something about this. IIRC (without re-reading it all), in theory distros would be okay without modversions if they could just provide their own explicit versioning. They take care about ABIs, so they can version things carefully if they had to change. I think we left that on hold because some of the bigger distros were heading into releases and we didn't care to cause pain. I wonder if we could try again. What's your requirement for versioning? Thanks, Nick =