Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A92F4C433E0 for ; Tue, 4 Aug 2020 18:52:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72C1922B45 for ; Tue, 4 Aug 2020 18:52:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="OkEy528n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72C1922B45 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A978A89933; Tue, 4 Aug 2020 18:52:10 +0000 (UTC) Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A85F89933 for ; Tue, 4 Aug 2020 18:52:09 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id c19so2777730wmd.1 for ; Tue, 04 Aug 2020 11:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=MCVmVRayFgOyaW9uuCCMHJef4rtIhxIeTcJ1ltWDm/A=; b=OkEy528nzR32O6we06l7wDwUKcc5IZrp1dQiVRT5RGX8EW2P73GifpBRvHpw7mL1m1 YlRJV3nBmEJn+mqIOYS4yt0TTlbLlgU/D/VBkJ5goc0Jyb47Vlu5OhIRxA1rKPMnyv0S dCClQwuB6Bc7p7fYiuMhYmWWBpZ0IWmnBvYrg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=MCVmVRayFgOyaW9uuCCMHJef4rtIhxIeTcJ1ltWDm/A=; b=VB+ocX6UsTA/Q85kGzKvZTC2V8+Y/Uf19AzyaOzNRi4i3BjjrbQ/DqLT5sQ4++T321 u4QJ/gS3xIulUBiD/lXlPaNvf4gY2e/FRp9H35aeYGoNuF/GYhS40LRiEwBsA5hWRH+N +M47mk0i3hwrRjjnHGTfR1jLS7d7TmK2EUElZmosSUc1KnMStwIjjKYoXj91kOS3PiqV 6gly1bgAU/H+UcxPEbOrbRWtSdNJqU2c1S6FBiMBoFHgfDgItjgrNkkD2zrIeyFKhop2 Oym+A9FyNXkJalnGp8DoAwsoLnVPyxS1gYUpDsBUsjMODSyTWgz8zcWCFq1N2LoWCMlB E3fw== X-Gm-Message-State: AOAM532V5xpe6Cl9lTgZkDqbHYCFxEM9IPGZJ9g46Y5U7iMmvgvbW+VA hhFMBFE99B9FHDxVzV7c8Ta7GcCqWiU= X-Google-Smtp-Source: ABdhPJy3Xn6Jn/uDSiI+K7xVLnN2zx5fRbdJC5qoyUtSF0wZycX2SF7js/q8hiQY608lCKDsDYlYYA== X-Received: by 2002:a05:600c:2157:: with SMTP id v23mr5047228wml.38.1596567127744; Tue, 04 Aug 2020 11:52:07 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id a10sm31360640wro.35.2020.08.04.11.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 11:52:07 -0700 (PDT) Date: Tue, 4 Aug 2020 20:52:05 +0200 From: daniel@ffwll.ch To: DRI Development Subject: Re: [PATCH 8/8] modules: inherit TAINT_PROPRIETARY_MODULE Message-ID: <20200804185205.GR6419@phenom.ffwll.local> Mail-Followup-To: DRI Development , Jessica Yu , Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) References: <20200730061027.29472-1-hch@lst.de> <20200730061027.29472-9-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200730061027.29472-9-hch@lst.de> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , open list , Jessica Yu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jul 30, 2020 at 08:10:27AM +0200, Christoph Hellwig wrote: > If a TAINT_PROPRIETARY_MODULE exports symbol, inherit the taint flag > for all modules importing these symbols, and don't allow loading > symbols from TAINT_PROPRIETARY_MODULE modules if the module previously > imported gplonly symbols. Add a anti-circumvention devices so people > don't accidentally get themselves into trouble this way. > > Comment from Greg: > Ah, the proven-to-be-illegal "GPL Condom" defense :) > > Signed-off-by: Christoph Hellwig > Reviewed-by: Greg Kroah-Hartman If this helps to get the next gpu related entertainment at least cc'ed to dri-devel, maybe even using an upstream driver, I'm all for it. Acked-by: Daniel Vetter > --- > include/linux/module.h | 1 + > kernel/module.c | 12 ++++++++++++ > 2 files changed, 13 insertions(+) > > diff --git a/include/linux/module.h b/include/linux/module.h > index 30b0f5fcdb3c37..e30ed5fa33a738 100644 > --- a/include/linux/module.h > +++ b/include/linux/module.h > @@ -389,6 +389,7 @@ struct module { > unsigned int num_gpl_syms; > const struct kernel_symbol *gpl_syms; > const s32 *gpl_crcs; > + bool using_gplonly_symbols; > > #ifdef CONFIG_UNUSED_SYMBOLS > /* unused exported symbols. */ > diff --git a/kernel/module.c b/kernel/module.c > index afb2bfdd5134b3..04f993863ae417 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -1456,6 +1456,18 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, > if (!sym) > goto unlock; > > + if (license == GPL_ONLY) > + mod->using_gplonly_symbols = true; > + > + if (owner && test_bit(TAINT_PROPRIETARY_MODULE, &owner->taints)) { > + if (mod->using_gplonly_symbols) { > + sym = NULL; > + goto getname; > + } > + add_taint_module(mod, TAINT_PROPRIETARY_MODULE, > + LOCKDEP_NOW_UNRELIABLE); > + } > + > if (!check_version(info, name, mod, crc)) { > sym = ERR_PTR(-EINVAL); > goto getname; > -- > 2.27.0 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel