From: Prarit Bhargava <pra...@redhat.com>

[redhat] kernel/rh_messages.c: Wire up new calls

Wire up the new general calls into the module loading and pci driver
loading code.  This provides centralized call locations for drivers and
devices that are unmaintained, deprecated, or disabled.

Signed-off-by: Prarit Bhargava <pra...@redhat.com>
Signed-off-by: Scott Weaver <scwea...@redhat.com>

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index blahblah..blahblah 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -322,6 +322,12 @@ static long local_pci_probe(void *_ddi)
         */
        pm_runtime_get_sync(dev);
        pci_dev->driver = pci_drv;
+
+#ifdef CONFIG_RHEL_DIFFERENCES
+       if (pci_rh_check_status(pci_dev))
+               return -EACCES;
+#endif
+
        rc = pci_drv->probe(pci_dev, ddi->id);
        if (!rc)
                return rc;
diff --git a/init/main.c b/init/main.c
index blahblah..blahblah 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1147,6 +1147,9 @@ static bool __init_or_module 
initcall_blacklisted(initcall_t fn)
         */
        strreplace(fn_name, ' ', '\0');
 
+#ifdef CONFIG_RHEL_DIFFERENCES
+       init_rh_check_status(fn_name);
+#endif
        list_for_each_entry(entry, &blacklisted_initcalls, next) {
                if (!strcmp(fn_name, entry->buf)) {
                        pr_debug("initcall %s blacklisted\n", fn_name);
diff --git a/kernel/module/main.c b/kernel/module/main.c
index blahblah..blahblah 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2796,6 +2796,11 @@ static int early_mod_check(struct load_info *info, int 
flags)
                return -EPERM;
        }
 
+#ifdef CONFIG_RHEL_DIFFERENCES
+       if (get_modinfo(info, "intree"))
+               module_rh_check_status(info->name);
+#endif
+
        err = rewrite_section_headers(info, flags);
        if (err)
                return err;

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to