kernel-rt/mod-blacklist.sh
Juri Lelli 5860f8e815 kernel-rt-5.12.0-0.rc1.163.rt9.1
* Fri Mar 05 2021 Juri Lelli <juri.lelli@redhat.com> [5.12.0-0.rc1.163.rt9.1]
- Add localversion for -RT release (Thomas Gleixner)
- sysfs: Add /sys/kernel/realtime entry (Clark Williams)
- genirq: Disable irqpoll on -rt (Ingo Molnar)
- signals: Allow RT tasks to cache one sigqueue struct (Thomas Gleixner)
- tpm_tis: fix stall after iowrite*()s (Haris Okanovic)
- drivers/block/zram: Replace bit spinlocks with rtmutex for -rt (Mike Galbraith)
- POWERPC: Allow to enable RT (Sebastian Andrzej Siewior)
- powerpc: Avoid recursive header includes (Sebastian Andrzej Siewior)
- powerpc/stackprotector: work around stack-guard init from atomic (Sebastian Andrzej Siewior)
- powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT (Bogdan Purcareata)
- powerpc/pseries/iommu: Use a locallock instead local_irq_save() (Sebastian Andrzej Siewior)
- powerpc: traps: Use PREEMPT_RT (Sebastian Andrzej Siewior)
- ARM64: Allow to enable RT (Sebastian Andrzej Siewior)
- ARM: Allow to enable RT (Sebastian Andrzej Siewior)
- x86: Enable RT also on 32bit (Sebastian Andrzej Siewior)
- arm64: fpsimd: Delay freeing memory in fpsimd_flush_thread() (Sebastian Andrzej Siewior)
- KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() (Josh Cartwright)
- genirq: update irq_set_irqchip_state documentation (Josh Cartwright)
- ARM: enable irq in translation/section permission fault handlers (Yadi.hu)
- tty/serial/pl011: Make the locking work on RT (Thomas Gleixner)
- tty/serial/omap: Make the locking RT aware (Thomas Gleixner)
- leds: trigger: disable CPU trigger on -RT (Sebastian Andrzej Siewior)
- jump-label: disable if stop_machine() is used (Thomas Gleixner)
- arch/arm64: Add lazy preempt support (Anders Roxell)
- arm: Add support for lazy preemption (Thomas Gleixner)
- x86: Support for lazy preemption (Thomas Gleixner)
- x86/entry: Use should_resched() in idtentry_exit_cond_resched() (Sebastian Andrzej Siewior)
- sched: Add support for lazy preemption (Thomas Gleixner)
- mm/scatterlist: Do not disable irqs on RT (Thomas Gleixner)
- x86: Allow to enable RT (Sebastian Andrzej Siewior)
- cpuset: Convert callback_lock to raw_spinlock_t (Mike Galbraith)
- drm/i915/gt: Only disable interrupts for the timeline lock on !force-threaded (Sebastian Andrzej Siewior)
- drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE (Sebastian Andrzej Siewior)
- drm/i915: disable tracing on -RT (Sebastian Andrzej Siewior)
- drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updates (Mike Galbraith)
- drm,radeon,i915: Use preempt_disable/enable_rt() where recommended (Mike Galbraith)
- lockdep: disable self-test (Sebastian Andrzej Siewior)
- lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals (Josh Cartwright)
- lockdep: selftest: Only do hardirq context test for raw spinlock (Yong Zhang)
- lockdep: Make it RT aware (Thomas Gleixner)
- net: Remove preemption disabling in netif_rx() (Priyanka Jain)
- random: Make it work on rt (Thomas Gleixner)
- x86: stackprotector: Avoid random pool on rt (Thomas Gleixner)
- panic: skip get_random_bytes for RT_FULL in init_oops_id (Thomas Gleixner)
- crypto: cryptd - add a lock instead preempt_disable/local_bh_disable (Sebastian Andrzej Siewior)
- crypto: limit more FPU-enabled sections (Sebastian Andrzej Siewior)
- irqwork: push most work into softirq context (Sebastian Andrzej Siewior)
- net: dev: always take qdisc's busylock in __dev_xmit_skb() (Sebastian Andrzej Siewior)
- net: Dequeue in dev_cpu_dead() without the lock (Sebastian Andrzej Siewior)
- net: Use skbufhead with raw lock (Thomas Gleixner)
- debugobjects: Make RT aware (Thomas Gleixner)
- fs: namespace: Use cpu_chill() in trylock loops (Thomas Gleixner)
- rt: Introduce cpu_chill() (Thomas Gleixner)
- sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() (Mike Galbraith)
- scsi/fcoe: Make RT aware. (Thomas Gleixner)
- md: raid5: Make raid5_percpu handling RT aware (Thomas Gleixner)
- block/mq: do not invoke preempt_disable() (Sebastian Andrzej Siewior)
- mm/vmalloc: Another preempt disable region which sucks (Thomas Gleixner)
- rcutorture: Avoid problematic critical section nesting on RT (Scott Wood)
- locking: Make spinlock_t and rwlock_t a RCU section on RT (Sebastian Andrzej Siewior)
- ptrace: fix ptrace_unfreeze_traced() race with rt-lock (Oleg Nesterov)
- ptrace: fix ptrace vs tasklist_lock race (Sebastian Andrzej Siewior)
- pid.h: include atomic.h (Grygorii Strashko)
- net/core: use local_bh_disable() in netif_rx_ni() (Sebastian Andrzej Siewior)
- softirq: Disable softirq stacks for RT (Thomas Gleixner)
- softirq: Check preemption after reenabling interrupts (Thomas Gleixner)
- sched: Disable TTWU_QUEUE on RT (Thomas Gleixner)
- sched: Do not account rcu_preempt_depth on RT in might_sleep() (Thomas Gleixner)
- kernel/sched: move stack + kprobe clean up to __put_task_struct() (Sebastian Andrzej Siewior)
- sched: Move mmdrop to RCU on RT (Thomas Gleixner)
- sched: Limit the number of task migrations per batch (Thomas Gleixner)
- wait.h: include atomic.h (Sebastian Andrzej Siewior)
- x86: kvm Require const tsc for RT (Thomas Gleixner)
- mm/zsmalloc: copy with get_cpu_var() and locking (Mike Galbraith)
- mm/memcontrol: Replace local_irq_disable with local locks (Sebastian Andrzej Siewior)
- mm/memcontrol: Don't call schedule_work_on in preemption disabled context (Yang Shi)
- mm: memcontrol: Provide a local_lock for per-CPU memcg_stock (Sebastian Andrzej Siewior)
- mm: slub: Don't enable partial CPU caches on PREEMPT_RT by default (Sebastian Andrzej Siewior)
- mm: page_alloc: Use a local_lock instead of explicit local_irq_save(). (Ingo Molnar)
- mm: page_alloc: Use migrate_disable() in drain_local_pages_wq() (Sebastian Andrzej Siewior)
- mm: slub: Don't resize the location tracking cache on PREEMPT_RT (Sebastian Andrzej Siewior)
- mm: slub: Move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context (Sebastian Andrzej Siewior)
- mm: slub: Move discard_slab() invocations out of IRQ-off sections (Sebastian Andrzej Siewior)
- mm: slub: Enable irqs for __GFP_WAIT (Thomas Gleixner)
- mm: slub: Make object_map_lock a raw_spinlock_t (Sebastian Andrzej Siewior)
- mm: sl[au]b: Change list_lock to raw_spinlock_t (Thomas Gleixner)
- locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs (Sebastian Andrzej Siewior)
- trace: Add migrate-disabled counter to tracing output (Thomas Gleixner)
- kernel/sched: add {put|get}_cpu_light() (Sebastian Andrzej Siewior)
- signal/x86: Delay calling signals in atomic (Oleg Nesterov)
- rt: Add local irq locks (Thomas Gleixner)
- efi: Allow efi=runtime (Sebastian Andrzej Siewior)
- efi: Disable runtime services on RT (Sebastian Andrzej Siewior)
- net/core: disable NET_RX_BUSY_POLL on RT (Sebastian Andrzej Siewior)
- sched: Disable CONFIG_RT_GROUP_SCHED on RT (Thomas Gleixner)
- mm: Allow only SLUB on RT (Ingo Molnar)
- kconfig: Disable config options which are not RT compatible (Thomas Gleixner)
- net: Properly annotate the try-lock for the seqlock (Sebastian Andrzej Siewior)
- net/Qdisc: use a seqlock instead seqcount (Sebastian Andrzej Siewior)
- fs/dcache: disable preemption on i_dir_seq's write side (Sebastian Andrzej Siewior)
- fs/dcache: use swait_queue instead of waitqueue (Sebastian Andrzej Siewior)
- u64_stats: Disable preemption on 32bit-UP/SMP with RT during updates (Sebastian Andrzej Siewior)
- xfrm: Use sequence counter with associated spinlock (Ahmed S. Darwish)
- mm/memcontrol: Disable preemption in __mod_memcg_lruvec_state() (Sebastian Andrzej Siewior)
- mm/vmstat: Protect per cpu variables with preempt disable on RT (Ingo Molnar)
- preempt: Provide preempt_*_(no)rt variants (Thomas Gleixner)
- signal: Revert ptrace preempt magic (Thomas Gleixner)
- locking/rtmutex: Use custom scheduling function for spin-schedule() (Sebastian Andrzej Siewior)
- locking/rtmutex: add ww_mutex addon for mutex-rt (Sebastian Andrzej Siewior)
- locking/rtmutex: wire up RT's locking (Thomas Gleixner)
- locking/rtmutex: add rwlock implementation based on rtmutex (Thomas Gleixner)
- locking/rtmutex: add rwsem implementation based on rtmutex (Thomas Gleixner)
- locking/rtmutex: add mutex implementation based on rtmutex (Thomas Gleixner)
- locking/rtmutex: Allow rt_mutex_trylock() on PREEMPT_RT (Sebastian Andrzej Siewior)
- locking/rtmutex: add sleeping lock implementation (Thomas Gleixner)
- sched: Add saved_state for tasks blocked on sleeping locks (Thomas Gleixner)
- locking/rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock (Thomas Gleixner)
- locking/rtmutex: Provide rt_mutex_slowlock_locked() (Thomas Gleixner)
- locking: split out the rbtree definition (Sebastian Andrzej Siewior)
- lockdep: Reduce header files in debug_locks.h (Sebastian Andrzej Siewior)
- locking/rtmutex: Avoid include hell (Thomas Gleixner)
- locking/spinlock: Split the lock types header (Thomas Gleixner)
- locking/rtmutex: Make lock_killable work (Thomas Gleixner)
- futex: Fix bug on when a requeued RT task times out (Steven Rostedt)
- locking/rtmutex: Handle the various new futex race conditions (Thomas Gleixner)
- locking/rtmutex: Remove rt_mutex_timed_lock() (Sebastian Andrzej Siewior)
- locking/rtmutex: Move rt_mutex_init() outside of CONFIG_DEBUG_RT_MUTEXES (Sebastian Andrzej Siewior)
- locking/rtmutex: Remove output from deadlock detector. (Sebastian Andrzej Siewior)
- locking/rtmutex: Remove cruft (Sebastian Andrzej Siewior)
- firewire: ohci: Use tasklet_disable_in_atomic() in the two atomic user (Sebastian Andrzej Siewior)
- atm: eni: Use tasklet_disable_in_atomic() in the ->send() callback (Sebastian Andrzej Siewior)
- PCI: hv: Use tasklet_disable_in_atomic() (Sebastian Andrzej Siewior)
- ath9k: Use tasklet_disable_in_atomic(). (Sebastian Andrzej Siewior)
- net: sundance: Use tasklet_disable_in_atomic(). (Sebastian Andrzej Siewior)
- net: jme: Replace link-change tasklet with a worker (Sebastian Andrzej Siewior)
- rcu: Prevent false positive softirq warning on RT (Thomas Gleixner)
- tick/sched: Prevent false positive softirq pending warnings on RT (Thomas Gleixner)
- softirq: Make softirq control and processing RT aware (Thomas Gleixner)
- softirq: Move various protections into inline helpers (Thomas Gleixner)
- irqtime: Make accounting correct on RT (Thomas Gleixner)
- softirq: Add RT specific softirq accounting (Thomas Gleixner)
- tasklets: Prevent tasklet_unlock_spin_wait() deadlock on RT (Thomas Gleixner)
- tasklets: Replace spin wait in tasklet_kill() (Peter Zijlstra)
- tasklets: Replace spin wait in tasklet_unlock_wait() (Peter Zijlstra)
- tasklets: Provide tasklet_disable_in_atomic() (Thomas Gleixner)
- tasklets: Use static inlines for stub implementations (Thomas Gleixner)
- softirq: Replace barrier() with cpu_relax() in tasklet_unlock_wait() (Thomas Gleixner)
- smp: Wake ksoftirqd on PREEMPT_RT instead do_softirq(). (Sebastian Andrzej Siewior)
- tcp: Remove superfluous BH-disable around listening_hash (Sebastian Andrzej Siewior)
- net: Move lockdep where it belongs (Thomas Gleixner)
- shmem: Use raw_spinlock_t for ->stat_lock (Sebastian Andrzej Siewior)
- mm: workingset: replace IRQ-off check with a lockdep assert. (Sebastian Andrzej Siewior)
- cgroup: use irqsave in cgroup_rstat_flush_locked() (Sebastian Andrzej Siewior)
- kcov: Remove kcov include from sched.h and move it to its users. (Sebastian Andrzej Siewior)
- printk: add pr_flush() (John Ogness)
- printk: add console handover (John Ogness)
- printk: remove deferred printing (John Ogness)
- printk: move console printing to kthreads (John Ogness)
- printk: introduce kernel sync mode (John Ogness)
- printk: change @console_seq to atomic64_t (John Ogness)
- printk: combine boot_delay_msec() into printk_delay() (John Ogness)
- printk: relocate printk_delay() and vprintk_default() (John Ogness)
- serial: 8250: implement write_atomic (John Ogness)
- console: add write_atomic interface (John Ogness)
- printk: convert @syslog_lock to spin_lock (John Ogness)
- printk: remove safe buffers (John Ogness)
- printk: track/limit recursion (John Ogness)
- printk: console: remove unnecessary safe buffer usage (John Ogness)
- printk: kmsg_dump: use kmsg_dump_rewind (John Ogness)
- printk: kmsg_dump: remove _nolock() variants (John Ogness)
- printk: remove logbuf_lock (John Ogness)
- um: synchronize kmsg_dumper (John Ogness)
- printk: introduce a kmsg_dump iterator (John Ogness)
- printk: add syslog_lock (John Ogness)
- printk: use atomic64_t for devkmsg_user.seq (John Ogness)
- printk: use seqcount_latch for clear_seq (John Ogness)
- printk: introduce CONSOLE_LOG_MAX for improved multi-line support (John Ogness)
- printk: consolidate kmsg_dump_get_buffer/syslog_print_all code (John Ogness)
- printk: refactor kmsg_dump_get_buffer() (John Ogness)
- printk: kmsg_dump: remove unused fields (John Ogness)
- printk: limit second loop of syslog_print_all (John Ogness)
- powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used (Sebastian Andrzej Siewior)
- notifier: Make atomic_notifiers use raw_spinlock (Valentin Schneider)
- genirq: Move prio assignment into the newly created thread (Thomas Gleixner)
- kthread: Move prio/affinite change into the newly created thread (Sebastian Andrzej Siewior)
- timers: Move clearing of base::timer_running under base::lock (Thomas Gleixner)
- highmem: Don't disable preemption on RT in kmap_atomic() (Sebastian Andrzej Siewior)
Resolves: rhbz#1891873
2021-03-05 17:23:42 +01:00

165 lines
4.2 KiB
Bash
Executable File

#! /bin/bash
# shellcheck disable=SC2164
RpmDir=$1
ModDir=$2
Dir="$1/$2"
# Note the list filename must have the format mod-[PACKAGE].list, for example,
# mod-internal.list or mod-extra.list. The PACKAGE is used to create a
# override directory for the modules.
List=$3
Dest="$4"
blacklist()
{
cat > "$RpmDir/etc/modprobe.d/$1-blacklist.conf" <<-__EOF__
# This kernel module can be automatically loaded by non-root users. To
# enhance system security, the module is blacklisted by default to ensure
# system administrators make the module available for use as needed.
# See https://access.redhat.com/articles/3760101 for more details.
#
# Remove the blacklist by adding a comment # at the start of the line.
blacklist $1
__EOF__
}
check_blacklist()
{
mod=$(find "$RpmDir/$ModDir" -name "$1")
[ ! "$mod" ] && return 0
if modinfo "$mod" | grep -q '^alias:\s\+net-'; then
mod="${1##*/}"
mod="${mod%.ko*}"
echo "$mod has an alias that allows auto-loading. Blacklisting."
blacklist "$mod"
fi
}
find_depends()
{
dep=$1
depends=$(modinfo "$dep" | sed -n -e "/^depends/ s/^depends:[ \t]*//p")
[ -z "$depends" ] && exit
for mod in ${depends//,/ }
do
match=$(grep "^$mod.ko" "$ListName")
[ -z "$match" ] && continue
# check if the module we are looking at is in mod-* too.
# if so we do not need to mark the dep as required.
mod2=${dep##*/} # same as $(basename $dep), but faster
match2=$(grep "^$mod2" "$ListName")
if [ -n "$match2" ]
then
#echo $mod2 >> notreq.list
continue
fi
echo "$mod".ko >> req.list
done
}
foreachp()
{
P=$(nproc)
bgcount=0
while read -r mod; do
$1 "$mod" &
bgcount=$((bgcount + 1))
if [ $bgcount -eq "$P" ]; then
wait -n
bgcount=$((bgcount - 1))
fi
done
wait
}
# Destination was specified on the command line
test -n "$4" && echo "$0: Override Destination $Dest has been specified."
pushd "$Dir"
OverrideDir=$(basename "$List")
OverrideDir=${OverrideDir%.*}
OverrideDir=${OverrideDir#*-}
mkdir -p "$OverrideDir"
rm -rf modnames
find . -name "*.ko" -type f > modnames
# Look through all of the modules, and throw any that have a dependency in
# our list into the list as well.
rm -rf dep.list dep2.list
rm -rf req.list req2.list
touch dep.list req.list
cp "$List" .
# This variable needs to be exported because it is used in sub-script
# executed by xargs
ListName=$(basename "$List")
export ListName
foreachp find_depends < modnames
sort -u req.list > req2.list
sort -u "$ListName" > modules2.list
join -v 1 modules2.list req2.list > modules3.list
while IFS= read -r mod
do
# get the path for the module
modpath=$(grep /"$mod" modnames)
[ -z "$modpath" ] && continue
echo "$modpath" >> dep.list
done < modules3.list
sort -u dep.list > dep2.list
if [ -n "$Dest" ]; then
# now move the modules into the $Dest directory
while IFS= read -r mod
do
newpath=$(dirname "$mod" | sed -e "s/kernel\\//$Dest\//")
mkdir -p "$newpath"
mv "$mod" "$newpath"
echo "$mod" | sed -e "s/kernel\\//$Dest\//" | sed -e "s|^.|${ModDir}|g" >> "$RpmDir"/"$ListName"
done < dep2.list
fi
popd
# If we're signing modules, we can't leave the .mod files for the .ko files
# we've moved in .tmp_versions/. Remove them so the Kbuild 'modules_sign'
# target doesn't try to sign a non-existent file. This is kinda ugly, but
# so are the modules-* packages.
while IFS= read -r mod
do
modfile=$(basename "$mod" | sed -e 's/.ko/.mod/')
rm .tmp_versions/"$modfile"
done < "$Dir"/dep2.list
if [ -z "$Dest" ]; then
sed -e "s|^.|${ModDir}|g" "$Dir"/dep2.list > "$RpmDir/$ListName"
echo "./$RpmDir/$ListName created."
[ -d "$RpmDir/etc/modprobe.d/" ] || mkdir -p "$RpmDir/etc/modprobe.d/"
foreachp check_blacklist < "$List"
fi
# Many BIOS-es export a PNP-id which causes the floppy driver to autoload
# even though most modern systems don't have a 3.5" floppy driver anymore
# this replaces the old die_floppy_die.patch which removed the PNP-id from
# the module
floppylist=("$RpmDir"/"$ModDir"/extra/drivers/block/floppy.ko*)
if [[ -n ${floppylist[0]} && -f ${floppylist[0]} ]]; then
blacklist "floppy"
fi
# avoid an empty kernel-extra package
echo "$ModDir/$OverrideDir" >> "$RpmDir/$ListName"
pushd "$Dir"
rm modnames dep.list dep2.list req.list req2.list
rm "$ListName" modules2.list modules3.list
popd