kernel-6.6.30

This commit is contained in:
Rmys
2024-05-04 16:26:44 +03:00
parent 8b9f8716b4
commit 8ae0d14768
74 changed files with 80864 additions and 181877 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,209 @@
SPDX-License-Identifier: GPL-2.0
aufs6.6 base patch
diff --git a/MAINTAINERS b/MAINTAINERS
index dd5de540ec0b..1b495555a80c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3334,6 +3334,19 @@ F: include/uapi/linux/audit.h
F: kernel/audit*
F: lib/*audit.c
+AUFS (advanced multi layered unification filesystem) FILESYSTEM
+M: "J. R. Okajima" <hooanon05g@gmail.com>
+L: aufs-users@lists.sourceforge.net (members only)
+L: linux-unionfs@vger.kernel.org
+S: Supported
+W: http://aufs.sourceforge.net
+T: git://github.com/sfjro/aufs4-linux.git
+F: Documentation/ABI/testing/debugfs-aufs
+F: Documentation/ABI/testing/sysfs-aufs
+F: Documentation/filesystems/aufs/
+F: fs/aufs/
+F: include/uapi/linux/aufs_type.h
+
AUXILIARY BUS DRIVER
M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
R: Dave Ertman <david.m.ertman@intel.com>
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 9f2d412fc560..1fefc6a8d049 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -645,6 +645,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
goto done;
}
+/*
+ * for AUFS
+ * no get/put for file.
+ */
+struct file *loop_backing_file(struct super_block *sb)
+{
+ struct file *ret;
+ struct loop_device *l;
+
+ ret = NULL;
+ if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
+ l = sb->s_bdev->bd_disk->private_data;
+ ret = l->lo_backing_file;
+ }
+ return ret;
+}
+EXPORT_SYMBOL_GPL(loop_backing_file);
+
/* loop sysfs attributes */
static ssize_t loop_attr_show(struct device *dev, char *page,
diff --git a/fs/dcache.c b/fs/dcache.c
index 25ac74d30bff..6c930ceed526 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1345,7 +1345,7 @@ enum d_walk_ret {
*
* The @enter() callbacks are called with d_lock held.
*/
-static void d_walk(struct dentry *parent, void *data,
+void d_walk(struct dentry *parent, void *data,
enum d_walk_ret (*enter)(void *, struct dentry *))
{
struct dentry *this_parent;
diff --git a/fs/fcntl.c b/fs/fcntl.c
index e871009f6c88..d62e114c1b1a 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -34,7 +34,7 @@
#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
-static int setfl(int fd, struct file * filp, unsigned int arg)
+int setfl(int fd, struct file * filp, unsigned int arg)
{
struct inode * inode = file_inode(filp);
int error = 0;
@@ -64,6 +64,8 @@ static int setfl(int fd, struct file * filp, unsigned int arg)
if (filp->f_op->check_flags)
error = filp->f_op->check_flags(arg);
+ if (!error && filp->f_op->setfl)
+ error = filp->f_op->setfl(filp, arg);
if (error)
return error;
diff --git a/fs/namespace.c b/fs/namespace.c
index e157efc54023..6c57487f126b 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -872,6 +872,12 @@ static inline int check_mnt(struct mount *mnt)
return mnt->mnt_ns == current->nsproxy->mnt_ns;
}
+/* for aufs, CONFIG_AUFS_BR_FUSE */
+int is_current_mnt_ns(struct vfsmount *mnt)
+{
+ return check_mnt(real_mount(mnt));
+}
+
/*
* vfsmount lock must be held for write
*/
diff --git a/fs/splice.c b/fs/splice.c
index d983d375ff11..7216ef993b5f 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -925,8 +925,8 @@ static int warn_unsupported(struct file *file, const char *op)
/*
* Attempt to initiate a splice from pipe to file.
*/
-static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
- loff_t *ppos, size_t len, unsigned int flags)
+long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+ loff_t *ppos, size_t len, unsigned int flags)
{
if (unlikely(!out->f_op->splice_write))
return warn_unsupported(out, "write");
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4a40823c3c67..a46e516bfc32 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1099,6 +1099,7 @@ extern void fasync_free(struct fasync_struct *);
/* can be called from interrupts */
extern void kill_fasync(struct fasync_struct **, int, int);
+extern int setfl(int fd, struct file *filp, unsigned int arg);
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
extern int f_setown(struct file *filp, int who, int force);
extern void f_delown(struct file *filp);
@@ -1872,6 +1873,7 @@ struct file_operations {
int (*lock) (struct file *, int, struct file_lock *);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
+ int (*setfl)(struct file *, unsigned long);
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index dc2844b071c2..069ffb776c2c 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -249,6 +249,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
return lock->key == key;
}
+struct lock_class *lockdep_hlock_class(struct held_lock *hlock);
+
/*
* Acquire a lock.
*
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 8f882f5881e8..6b9808f09843 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -7,12 +7,15 @@ struct mnt_namespace;
struct fs_struct;
struct user_namespace;
struct ns_common;
+struct vfsmount;
extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
struct user_namespace *, struct fs_struct *);
extern void put_mnt_ns(struct mnt_namespace *ns);
extern struct ns_common *from_mnt_ns(struct mnt_namespace *);
+extern int is_current_mnt_ns(struct vfsmount *mnt);
+
extern const struct file_operations proc_mounts_operations;
extern const struct file_operations proc_mountinfo_operations;
extern const struct file_operations proc_mountstats_operations;
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 6c461573434d..f08de3775987 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -99,4 +99,7 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
extern const struct pipe_buf_operations default_pipe_buf_ops;
+
+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+ loff_t *ppos, size_t len, unsigned int flags);
#endif
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index e85b5ad3e206..db4297f60bd3 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -218,7 +218,7 @@ unsigned long max_lock_class_idx;
struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS);
-static inline struct lock_class *hlock_class(struct held_lock *hlock)
+inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
{
unsigned int class_idx = hlock->class_idx;
@@ -239,6 +239,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
*/
return lock_classes + class_idx;
}
+#define hlock_class(hlock) lockdep_hlock_class(hlock)
#ifdef CONFIG_LOCK_STAT
static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);
@@ -0,0 +1,24 @@
SPDX-License-Identifier: GPL-2.0
aufs6.6 kbuild patch
diff --git a/fs/Kconfig b/fs/Kconfig
index aa7e03cc1941..bf780967b6c4 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -331,6 +331,7 @@ source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
source "fs/erofs/Kconfig"
source "fs/vboxsf/Kconfig"
+source "fs/aufs/Kconfig"
endif # MISC_FILESYSTEMS
diff --git a/fs/Makefile b/fs/Makefile
index f9541f40be4e..3a0e13ee39e7 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -129,3 +129,4 @@ obj-$(CONFIG_EFIVAR_FS) += efivarfs/
obj-$(CONFIG_EROFS_FS) += erofs/
obj-$(CONFIG_VBOXSF_FS) += vboxsf/
obj-$(CONFIG_ZONEFS_FS) += zonefs/
+obj-$(CONFIG_AUFS_FS) += aufs/
@@ -0,0 +1,241 @@
SPDX-License-Identifier: GPL-2.0
aufs6.6 loopback patch
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 1fefc6a8d049..86f1f66305d2 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -54,7 +54,7 @@ struct loop_device {
int lo_flags;
char lo_file_name[LO_NAME_SIZE];
- struct file * lo_backing_file;
+ struct file *lo_backing_file, *lo_backing_virt_file;
struct block_device *lo_device;
gfp_t old_gfp_mask;
@@ -510,6 +510,15 @@ static inline void loop_update_dio(struct loop_device *lo)
lo->use_dio);
}
+static struct file *loop_real_file(struct file *file)
+{
+ struct file *f = NULL;
+
+ if (file->f_path.dentry->d_sb->s_op->real_loop)
+ f = file->f_path.dentry->d_sb->s_op->real_loop(file);
+ return f;
+}
+
static void loop_reread_partitions(struct loop_device *lo)
{
int rc;
@@ -567,6 +576,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
{
struct file *file = fget(arg);
struct file *old_file;
+ struct file *f, *virt_file = NULL, *old_virt_file;
int error;
bool partscan;
bool is_loop;
@@ -590,11 +600,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
if (!(lo->lo_flags & LO_FLAGS_READ_ONLY))
goto out_err;
+ f = loop_real_file(file);
+ if (f) {
+ virt_file = file;
+ file = f;
+ get_file(file);
+ }
+
error = loop_validate_file(file, bdev);
if (error)
goto out_err;
old_file = lo->lo_backing_file;
+ old_virt_file = lo->lo_backing_virt_file;
error = -EINVAL;
@@ -607,6 +625,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
blk_mq_freeze_queue(lo->lo_queue);
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file;
+ lo->lo_backing_virt_file = virt_file;
lo->old_gfp_mask = mapping_gfp_mask(file->f_mapping);
mapping_set_gfp_mask(file->f_mapping,
lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
@@ -629,6 +648,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
* dependency.
*/
fput(old_file);
+ if (old_virt_file)
+ fput(old_virt_file);
if (partscan)
loop_reread_partitions(lo);
@@ -642,6 +663,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
loop_global_unlock(lo, is_loop);
out_putf:
fput(file);
+ if (virt_file)
+ fput(virt_file);
goto done;
}
@@ -1013,6 +1036,7 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,
const struct loop_config *config)
{
struct file *file = fget(config->fd);
+ struct file *f, *virt_file = NULL;
struct inode *inode;
struct address_space *mapping;
int error;
@@ -1028,6 +1052,13 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,
/* This is safe, since we have a reference from open(). */
__module_get(THIS_MODULE);
+ f = loop_real_file(file);
+ if (f) {
+ virt_file = file;
+ file = f;
+ get_file(file);
+ }
+
/*
* If we don't hold exclusive handle for the device, upgrade to it
* here to avoid changing device under exclusive owner.
@@ -1091,6 +1122,7 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,
lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO;
lo->lo_device = bdev;
lo->lo_backing_file = file;
+ lo->lo_backing_virt_file = virt_file;
lo->old_gfp_mask = mapping_gfp_mask(mapping);
mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
@@ -1146,6 +1178,8 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,
bd_abort_claiming(bdev, loop_configure);
out_putf:
fput(file);
+ if (virt_file)
+ fput(virt_file);
/* This is safe: open() is still holding a reference. */
module_put(THIS_MODULE);
return error;
@@ -1154,6 +1188,7 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,
static void __loop_clr_fd(struct loop_device *lo, bool release)
{
struct file *filp;
+ struct file *virt_filp = lo->lo_backing_virt_file;
gfp_t gfp = lo->old_gfp_mask;
if (test_bit(QUEUE_FLAG_WC, &lo->lo_queue->queue_flags))
@@ -1170,6 +1205,7 @@ static void __loop_clr_fd(struct loop_device *lo, bool release)
spin_lock_irq(&lo->lo_lock);
filp = lo->lo_backing_file;
lo->lo_backing_file = NULL;
+ lo->lo_backing_virt_file = NULL;
spin_unlock_irq(&lo->lo_lock);
lo->lo_device = NULL;
@@ -1232,6 +1268,8 @@ static void __loop_clr_fd(struct loop_device *lo, bool release)
* fput can take open_mutex which is usually taken before lo_mutex.
*/
fput(filp);
+ if (virt_filp)
+ fput(virt_filp);
}
static int loop_clr_fd(struct loop_device *lo)
diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c
index fa8a517ffd0c..c18f7bcef81b 100644
--- a/fs/aufs/f_op.c
+++ b/fs/aufs/f_op.c
@@ -311,7 +311,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
if (IS_ERR(h_file))
goto out;
- if (au_test_loopback_kthread()) {
+ if (0 && au_test_loopback_kthread()) {
au_warn_loopback(h_file->f_path.dentry->d_sb);
if (file->f_mapping != h_file->f_mapping) {
file->f_mapping = h_file->f_mapping;
diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c
index 58043e31e5f3..e2bfae6f9d59 100644
--- a/fs/aufs/loop.c
+++ b/fs/aufs/loop.c
@@ -133,3 +133,19 @@ void au_loopback_fin(void)
symbol_put(loop_backing_file);
au_kfree_try_rcu(au_warn_loopback_array);
}
+
+/* ---------------------------------------------------------------------- */
+
+/* support the loopback block device insude aufs */
+
+struct file *aufs_real_loop(struct file *file)
+{
+ struct file *f;
+
+ BUG_ON(!au_test_aufs(file->f_path.dentry->d_sb));
+ fi_read_lock(file);
+ f = au_hf_top(file);
+ fi_read_unlock(file);
+ AuDebugOn(!f);
+ return f;
+}
diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h
index 03d4908a6c03..34d356e181d5 100644
--- a/fs/aufs/loop.h
+++ b/fs/aufs/loop.h
@@ -26,6 +26,8 @@ void au_warn_loopback(struct super_block *h_sb);
int au_loopback_init(void);
void au_loopback_fin(void);
+
+struct file *aufs_real_loop(struct file *file);
#else
AuStub(struct file *, loop_backing_file, return NULL, struct super_block *sb)
@@ -36,6 +38,8 @@ AuStubVoid(au_warn_loopback, struct super_block *h_sb)
AuStubInt0(au_loopback_init, void)
AuStubVoid(au_loopback_fin, void)
+
+AuStub(struct file *, aufs_real_loop, return NULL, struct file *file)
#endif /* BLK_DEV_LOOP */
#endif /* __KERNEL__ */
diff --git a/fs/aufs/super.c b/fs/aufs/super.c
index 07d3412e950f..c4a00f620e57 100644
--- a/fs/aufs/super.c
+++ b/fs/aufs/super.c
@@ -758,7 +758,10 @@ const struct super_operations aufs_sop = {
.show_options = aufs_show_options,
.statfs = aufs_statfs,
.put_super = aufs_put_super,
- .sync_fs = aufs_sync_fs
+ .sync_fs = aufs_sync_fs,
+#ifdef CONFIG_AUFS_BDEV_LOOP
+ .real_loop = aufs_real_loop
+#endif
};
/* ---------------------------------------------------------------------- */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a46e516bfc32..a0d040eef83d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2027,6 +2027,11 @@ struct super_operations {
long (*free_cached_objects)(struct super_block *,
struct shrink_control *);
void (*shutdown)(struct super_block *sb);
+
+#if IS_ENABLED(CONFIG_BLK_DEV_LOOP) || IS_ENABLED(CONFIG_BLK_DEV_LOOP_MODULE)
+ /* and aufs */
+ struct file *(*real_loop)(struct file *);
+#endif
};
/*
@@ -0,0 +1,428 @@
SPDX-License-Identifier: GPL-2.0
aufs6.6 mmap patch
diff --git a/fs/proc/base.c b/fs/proc/base.c
index ffd54617c354..29ec720c8038 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2218,7 +2218,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
rc = -ENOENT;
vma = find_exact_vma(mm, vm_start, vm_end);
if (vma && vma->vm_file) {
- *path = vma->vm_file->f_path;
+ *path = vma_pr_or_file(vma)->f_path;
path_get(path);
rc = 0;
}
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
index 4d3493579458..42edd9a42c78 100644
--- a/fs/proc/nommu.c
+++ b/fs/proc/nommu.c
@@ -39,7 +39,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
file = region->vm_file;
if (file) {
- struct inode *inode = file_inode(region->vm_file);
+ struct inode *inode;
+
+ file = vmr_pr_or_file(region);
+ inode = file_inode(file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
}
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 3dd5be96691b..40d9d970b308 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -271,7 +271,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
const char *name = NULL;
if (file) {
- struct inode *inode = file_inode(vma->vm_file);
+ struct inode *inode;
+
+ file = vma_pr_or_file(vma);
+ inode = file_inode(file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
@@ -1943,7 +1946,7 @@ static int show_numa_map(struct seq_file *m, void *v)
struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
struct vm_area_struct *vma = v;
struct numa_maps *md = &numa_priv->md;
- struct file *file = vma->vm_file;
+ struct file *file = vma_pr_or_file(vma);
struct mm_struct *mm = vma->vm_mm;
struct mempolicy *pol;
char buffer[64];
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 7cebd397cc26..81be1641c7fb 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -137,7 +137,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
file = vma->vm_file;
if (file) {
- struct inode *inode = file_inode(vma->vm_file);
+ struct inode *inode;
+
+ file = vma_pr_or_file(vma);
+ inode = file_inode(file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bf5d0b1b16f4..94b956eff452 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2409,6 +2409,43 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
static inline struct vm_area_struct *vma_lookup(struct mm_struct *mm,
unsigned long addr);
+#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int);
+extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[],
+ int);
+extern void vma_do_get_file(struct vm_area_struct *, const char[], int);
+extern void vma_do_fput(struct vm_area_struct *, const char[], int);
+
+#define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \
+ __LINE__)
+#define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \
+ __LINE__)
+#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__)
+#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__)
+
+#ifndef CONFIG_MMU
+extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int);
+extern void vmr_do_fput(struct vm_region *, const char[], int);
+
+#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \
+ __LINE__)
+#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__)
+#endif /* !CONFIG_MMU */
+
+#else
+
+#define vma_file_update_time(vma) file_update_time((vma)->vm_file)
+#define vma_pr_or_file(vma) (vma)->vm_file
+#define vma_get_file(vma) get_file((vma)->vm_file)
+#define vma_fput(vma) fput((vma)->vm_file)
+
+#ifndef CONFIG_MMU
+#define vmr_pr_or_file(region) (region)->vm_file
+#define vmr_fput(region) fput((region)->vm_file)
+#endif /* !CONFIG_MMU */
+
+#endif /* CONFIG_AUFS_FS */
+
extern int access_process_vm(struct task_struct *tsk, unsigned long addr,
void *buf, int len, unsigned int gup_flags);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 36c5b43999e6..ce93e97f76a6 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -524,6 +524,9 @@ struct vm_region {
unsigned long vm_top; /* region allocated to here */
unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */
struct file *vm_file; /* the backing file or NULL */
+#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ struct file *vm_prfile; /* the virtual backing file or NULL */
+#endif
int vm_usage; /* region usage count (access under nommu_region_sem) */
bool vm_icache_flushed : 1; /* true if the icache has been flushed for
@@ -637,6 +640,9 @@ struct vm_area_struct {
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
units */
struct file * vm_file; /* File we map to (can be NULL). */
+#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ struct file *vm_prfile; /* shadow of vm_file */
+#endif
void * vm_private_data; /* was vm_pte (shared mem) */
#ifdef CONFIG_ANON_VMA_NAME
diff --git a/kernel/fork.c b/kernel/fork.c
index 3b6d20dfb9a8..ccad0325cfa9 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -731,7 +731,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
if (file) {
struct address_space *mapping = file->f_mapping;
- get_file(file);
+ vma_get_file(tmp);
i_mmap_lock_write(mapping);
if (tmp->vm_flags & VM_SHARED)
mapping_allow_writable(mapping);
diff --git a/mm/Makefile b/mm/Makefile
index ec65984e2ade..d59461647ccd 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -138,3 +138,4 @@ obj-$(CONFIG_IO_MAPPING) += io-mapping.o
obj-$(CONFIG_HAVE_BOOTMEM_INFO_NODE) += bootmem_info.o
obj-$(CONFIG_GENERIC_IOREMAP) += ioremap.o
obj-$(CONFIG_SHRINKER_DEBUG) += shrinker_debug.o
+obj-y += prfile.o
diff --git a/mm/filemap.c b/mm/filemap.c
index f0a15ce1bd1b..a5eba9bbe416 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3626,7 +3626,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
vm_fault_t ret = VM_FAULT_LOCKED;
sb_start_pagefault(mapping->host->i_sb);
- file_update_time(vmf->vma->vm_file);
+ vma_file_update_time(vmf->vma);
folio_lock(folio);
if (folio->mapping != mapping) {
folio_unlock(folio);
diff --git a/mm/mmap.c b/mm/mmap.c
index 9e018d8dd7d6..047bd4a0ced8 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -140,7 +140,7 @@ static void remove_vma(struct vm_area_struct *vma, bool unreachable)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
- fput(vma->vm_file);
+ vma_fput(vma);
mpol_put(vma_policy(vma));
if (unreachable)
__vm_area_free(vma);
@@ -554,7 +554,7 @@ static inline void vma_complete(struct vma_prepare *vp,
if (vp->file) {
uprobe_munmap(vp->remove, vp->remove->vm_start,
vp->remove->vm_end);
- fput(vp->file);
+ vma_fput(vp->vma);
}
if (vp->remove->anon_vma)
anon_vma_merge(vp->vma, vp->remove);
@@ -2384,7 +2384,7 @@ int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma,
goto out_free_mpol;
if (new->vm_file)
- get_file(new->vm_file);
+ vma_get_file(new);
if (new->vm_ops && new->vm_ops->open)
new->vm_ops->open(new);
@@ -2801,7 +2801,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
* and cause general protection fault
* ultimately.
*/
- fput(vma->vm_file);
+ vma_fput(vma);
vm_area_free(vma);
vma = merge;
/* Update vm_flags to pick up the change. */
@@ -2896,7 +2896,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
if (file || vma->vm_file) {
unmap_and_free_vma:
- fput(vma->vm_file);
+ vma_fput(vma);
vma->vm_file = NULL;
vma_iter_set(&vmi, vma->vm_end);
@@ -2958,6 +2958,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
unsigned long populate = 0;
unsigned long ret = -EINVAL;
struct file *file;
+#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ struct file *prfile;
+#endif
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/mm/remap_file_pages.rst.\n",
current->comm, current->pid);
@@ -3016,10 +3019,34 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
if (vma->vm_flags & VM_LOCKED)
flags |= MAP_LOCKED;
+#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ vma_get_file(vma);
+ file = vma->vm_file;
+ prfile = vma->vm_prfile;
+ ret = do_mmap(vma->vm_file, start, size,
+ prot, flags, /*vm_flags*/0, pgoff, &populate, NULL);
+ if (!IS_ERR_VALUE(ret) && file && prfile) {
+ struct vm_area_struct *new_vma;
+
+ new_vma = find_vma(mm, ret);
+ if (!new_vma->vm_prfile)
+ new_vma->vm_prfile = prfile;
+ if (prfile)
+ get_file(prfile);
+ }
+ /*
+ * two fput()s instead of vma_fput(vma),
+ * coz vma may not be available anymore.
+ */
+ fput(file);
+ if (prfile)
+ fput(prfile);
+#else
file = get_file(vma->vm_file);
ret = do_mmap(vma->vm_file, start, size,
prot, flags, 0, pgoff, &populate, NULL);
fput(file);
+#endif /* CONFIG_AUFS_FS */
out:
mmap_write_unlock(mm);
if (populate)
@@ -3370,7 +3397,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
if (anon_vma_clone(new_vma, vma))
goto out_free_mempol;
if (new_vma->vm_file)
- get_file(new_vma->vm_file);
+ vma_get_file(new_vma);
if (new_vma->vm_ops && new_vma->vm_ops->open)
new_vma->vm_ops->open(new_vma);
if (vma_link(mm, new_vma))
@@ -3384,7 +3411,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
new_vma->vm_ops->close(new_vma);
if (new_vma->vm_file)
- fput(new_vma->vm_file);
+ vma_fput(new_vma);
unlink_anon_vmas(new_vma);
out_free_mempol:
diff --git a/mm/nommu.c b/mm/nommu.c
index 7f9e9e5a0e12..69663f2bd4c4 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -523,7 +523,7 @@ static void __put_nommu_region(struct vm_region *region)
up_write(&nommu_region_sem);
if (region->vm_file)
- fput(region->vm_file);
+ vmr_fput(region);
/* IO memory and memory shared directly out of the pagecache
* from ramfs/tmpfs mustn't be released here */
@@ -603,7 +603,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
- fput(vma->vm_file);
+ vma_fput(vma);
put_nommu_region(vma->vm_region);
vm_area_free(vma);
}
@@ -1135,7 +1135,7 @@ unsigned long do_mmap(struct file *file,
goto error_just_free;
}
}
- fput(region->vm_file);
+ vmr_fput(region);
kmem_cache_free(vm_region_jar, region);
region = pregion;
result = start;
@@ -1221,10 +1221,10 @@ unsigned long do_mmap(struct file *file,
error:
vma_iter_free(&vmi);
if (region->vm_file)
- fput(region->vm_file);
+ vmr_fput(region);
kmem_cache_free(vm_region_jar, region);
if (vma->vm_file)
- fput(vma->vm_file);
+ vma_fput(vma);
vm_area_free(vma);
return ret;
diff --git a/mm/prfile.c b/mm/prfile.c
new file mode 100644
index 000000000000..8f820a235364
--- /dev/null
+++ b/mm/prfile.c
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Mainly for aufs which mmap(2) different file and wants to print different
+ * path in /proc/PID/maps.
+ * Call these functions via macros defined in linux/mm.h.
+ *
+ * See Documentation/filesystems/aufs/design/06mmap.txt
+ *
+ * Copyright (c) 2014-2022 Junjro R. Okajima
+ * Copyright (c) 2014 Ian Campbell
+ */
+
+#include <linux/mm.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+
+/* #define PRFILE_TRACE */
+static inline void prfile_trace(struct file *f, struct file *pr,
+ const char func[], int line, const char func2[])
+{
+#ifdef PRFILE_TRACE
+ if (pr)
+ pr_info("%s:%d: %s, %pD2\n", func, line, func2, f);
+#endif
+}
+
+void vma_do_file_update_time(struct vm_area_struct *vma, const char func[],
+ int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ file_update_time(f);
+ if (f && pr)
+ file_update_time(pr);
+}
+
+struct file *vma_do_pr_or_file(struct vm_area_struct *vma, const char func[],
+ int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ return (f && pr) ? pr : f;
+}
+
+void vma_do_get_file(struct vm_area_struct *vma, const char func[], int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ get_file(f);
+ if (f && pr)
+ get_file(pr);
+}
+
+void vma_do_fput(struct vm_area_struct *vma, const char func[], int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ fput(f);
+ if (f && pr)
+ fput(pr);
+}
+
+#ifndef CONFIG_MMU
+struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[],
+ int line)
+{
+ struct file *f = region->vm_file, *pr = region->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ return (f && pr) ? pr : f;
+}
+
+void vmr_do_fput(struct vm_region *region, const char func[], int line)
+{
+ struct file *f = region->vm_file, *pr = region->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ fput(f);
+ if (f && pr)
+ fput(pr);
+}
+#endif /* !CONFIG_MMU */
@@ -1,11 +1,11 @@
SPDX-License-Identifier: GPL-2.0
aufs5.x-rcN standalone patch
aufs6.6 standalone patch
diff --git a/fs/dcache.c b/fs/dcache.c
index ddca6240e0db4..30dec552278dc 100644
index 6c930ceed526..576ad162cdec 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1390,6 +1390,7 @@ void d_walk(struct dentry *parent, void *data,
@@ -1450,6 +1450,7 @@ void d_walk(struct dentry *parent, void *data,
seq = 1;
goto again;
}
@@ -13,7 +13,7 @@ index ddca6240e0db4..30dec552278dc 100644
struct check_mount {
struct vfsmount *mnt;
@@ -2935,6 +2936,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
@@ -3051,6 +3052,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
write_sequnlock(&rename_lock);
}
@@ -22,10 +22,10 @@ index ddca6240e0db4..30dec552278dc 100644
/**
* d_ancestor - search for an ancestor
diff --git a/fs/exec.c b/fs/exec.c
index 547a2390baf54..18d51d0face68 100644
index 6518e33ea813..b67efac6a1ad 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -113,6 +113,7 @@ bool path_noexec(const struct path *path)
@@ -112,6 +112,7 @@ bool path_noexec(const struct path *path)
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
}
@@ -34,10 +34,10 @@ index 547a2390baf54..18d51d0face68 100644
#ifdef CONFIG_USELIB
/*
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 073ca6af500f3..b18afdf81e762 100644
index d62e114c1b1a..ceef001775bd 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -85,6 +85,7 @@ int setfl(int fd, struct file *filp, unsigned long arg)
@@ -87,6 +87,7 @@ int setfl(int fd, struct file * filp, unsigned int arg)
out:
return error;
}
@@ -46,10 +46,10 @@ index 073ca6af500f3..b18afdf81e762 100644
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
int force)
diff --git a/fs/file_table.c b/fs/file_table.c
index 709ada3151da5..27a3e3c9f2a82 100644
index ee21b3da9d08..c45ac36795dd 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -162,6 +162,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)
@@ -225,6 +225,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)
}
return ERR_PTR(-ENFILE);
}
@@ -57,31 +57,11 @@ index 709ada3151da5..27a3e3c9f2a82 100644
/*
* Variant of alloc_empty_file() that doesn't check and modify nr_files.
@@ -376,6 +377,7 @@ void __fput_sync(struct file *file)
}
EXPORT_SYMBOL(fput);
+EXPORT_SYMBOL_GPL(__fput_sync);
void __init files_init(void)
{
diff --git a/fs/inode.c b/fs/inode.c
index e7f0c614a58f3..6fe0a92a4c93c 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1776,6 +1776,7 @@ int update_time(struct inode *inode, struct timespec64 *time, int flags)
return inode->i_op->update_time(inode, time, flags);
return generic_update_time(inode, time, flags);
}
+EXPORT_SYMBOL_GPL(update_time);
/**
* touch_atime - update the access time
diff --git a/fs/namespace.c b/fs/namespace.c
index 451dee24a546a..38078cbede431 100644
index 6c57487f126b..16be9ac1c734 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -431,6 +431,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
@@ -466,6 +466,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
mnt_dec_writers(real_mount(mnt));
preempt_enable();
}
@@ -89,7 +69,7 @@ index 451dee24a546a..38078cbede431 100644
/**
* mnt_drop_write - give up write access to a mount
@@ -797,6 +798,7 @@ int is_current_mnt_ns(struct vfsmount *mnt)
@@ -877,6 +878,7 @@ int is_current_mnt_ns(struct vfsmount *mnt)
{
return check_mnt(real_mount(mnt));
}
@@ -97,7 +77,7 @@ index 451dee24a546a..38078cbede431 100644
/*
* vfsmount lock must be held for write
@@ -1961,6 +1963,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
@@ -2152,6 +2154,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
}
return 0;
}
@@ -106,7 +86,7 @@ index 451dee24a546a..38078cbede431 100644
static void lock_mnt_tree(struct mount *mnt)
{
diff --git a/fs/notify/group.c b/fs/notify/group.c
index a4a4b1c64d32a..86dc2efb1850c 100644
index 1de6631a3925..3008eb37a18d 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -100,6 +100,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
@@ -118,10 +98,10 @@ index a4a4b1c64d32a..86dc2efb1850c 100644
/*
* Drop a reference to a group. Free it if it's through.
diff --git a/fs/open.c b/fs/open.c
index 9af548fb841b0..2ff09b709f7bf 100644
index 98f6601fbac6..8624e4ffa15b 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -65,6 +65,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
@@ -67,6 +67,7 @@ int do_truncate(struct mnt_idmap *idmap, struct dentry *dentry,
inode_unlock(dentry->d_inode);
return ret;
}
@@ -130,10 +110,10 @@ index 9af548fb841b0..2ff09b709f7bf 100644
long vfs_truncate(const struct path *path, loff_t length)
{
diff --git a/fs/read_write.c b/fs/read_write.c
index 75f764b434184..7582bb3fb634b 100644
index 4771701c896b..c79270aba792 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -503,6 +503,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
@@ -477,6 +477,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
inc_syscr(current);
return ret;
}
@@ -141,7 +121,7 @@ index 75f764b434184..7582bb3fb634b 100644
static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
{
@@ -613,6 +614,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
@@ -592,6 +593,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
file_end_write(file);
return ret;
}
@@ -150,42 +130,22 @@ index 75f764b434184..7582bb3fb634b 100644
/* file_ppos returns &file->f_pos or NULL if file is stream */
static inline loff_t *file_ppos(struct file *file)
diff --git a/fs/splice.c b/fs/splice.c
index 55b5356262085..c13ac0fbac318 100644
index 7216ef993b5f..7ce1f1bc4268 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -763,6 +763,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
@@ -932,6 +932,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return warn_unsupported(out, "write");
return out->f_op->splice_write(pipe, out, ppos, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_from);
/*
* Attempt to initiate a splice from a file to a pipe.
@@ -787,6 +788,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
return warn_unsupported(in, "read");
return in->f_op->splice_read(in, ppos, pipe, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_to);
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/fs/sync.c b/fs/sync.c
index b7b5a0a0df6ff..fa5c7fba7f1ba 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -39,6 +39,7 @@ int __sync_filesystem(struct super_block *sb, int wait)
sb->s_op->sync_fs(sb, wait);
return __sync_blockdev(sb->s_bdev, wait);
}
+EXPORT_SYMBOL_GPL(__sync_filesystem);
/*
* Write out and wait upon all dirty data associated with this
* Indicate to the caller that there was a premature EOF when reading from the
diff --git a/fs/xattr.c b/fs/xattr.c
index cd7a563e8bcd4..7d989d57b0f0d 100644
index efd4736bc94b..ce1a2c39ab23 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -360,6 +360,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
@@ -406,6 +406,7 @@ vfs_getxattr_alloc(struct mnt_idmap *idmap, struct dentry *dentry,
*xattr_value = value;
return error;
}
@@ -194,10 +154,10 @@ index cd7a563e8bcd4..7d989d57b0f0d 100644
ssize_t
__vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 7f006a47790cf..be002c3a30833 100644
index db4297f60bd3..9aca18312afb 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -209,6 +209,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
@@ -239,6 +239,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
*/
return lock_classes + class_idx;
}
@@ -206,79 +166,79 @@ index 7f006a47790cf..be002c3a30833 100644
#ifdef CONFIG_LOCK_STAT
diff --git a/kernel/task_work.c b/kernel/task_work.c
index 8d6e1217c451c..0e73637adda86 100644
index 95a7e1b7f1da..5053670775d3 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -154,3 +154,4 @@ void task_work_run(void)
@@ -183,3 +183,4 @@ void task_work_run(void)
} while (work);
}
}
+EXPORT_SYMBOL_GPL(task_work_run);
diff --git a/security/security.c b/security/security.c
index a28045dc9e7f6..310cf38efeec7 100644
index 23b129d482a7..fca4c5707a1c 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1093,6 +1093,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
@@ -1750,6 +1750,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
return 0;
return call_int_hook(path_rmdir, 0, dir, dentry);
}
+EXPORT_SYMBOL_GPL(security_path_rmdir);
int security_path_unlink(const struct path *dir, struct dentry *dentry)
{
@@ -1109,6 +1110,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
/**
* security_path_unlink() - Check if removing a hard link is allowed
@@ -1785,6 +1786,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
return 0;
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
}
+EXPORT_SYMBOL_GPL(security_path_symlink);
int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
struct dentry *new_dentry)
@@ -1117,6 +1119,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
/**
* security_path_link - Check if creating a hard link is allowed
@@ -1803,6 +1805,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
return 0;
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
}
+EXPORT_SYMBOL_GPL(security_path_link);
int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
const struct path *new_dir, struct dentry *new_dentry,
@@ -1144,6 +1147,7 @@ int security_path_truncate(const struct path *path)
return 0;
return call_int_hook(path_truncate, 0, path);
}
+EXPORT_SYMBOL_GPL(security_path_truncate);
int security_path_chmod(const struct path *path, umode_t mode)
{
@@ -1151,6 +1155,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
/**
* security_path_rename() - Check if renaming a file is allowed
@@ -1864,6 +1867,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
return 0;
return call_int_hook(path_chmod, 0, path, mode);
}
+EXPORT_SYMBOL_GPL(security_path_chmod);
int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
{
@@ -1158,6 +1163,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
/**
* security_path_chown() - Check if changing the file's owner/group is allowed
@@ -1881,6 +1885,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
return 0;
return call_int_hook(path_chown, 0, path, uid, gid);
}
+EXPORT_SYMBOL_GPL(security_path_chown);
int security_path_chroot(const struct path *path)
{
@@ -1258,6 +1264,7 @@ int security_inode_permission(struct inode *inode, int mask)
/**
* security_path_chroot() - Check if changing the root directory is allowed
@@ -2110,6 +2115,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
+EXPORT_SYMBOL_GPL(security_inode_permission);
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
@@ -1450,6 +1457,7 @@ int security_file_permission(struct file *file, int mask)
/**
* security_inode_setattr() - Check if setting file attributes is allowed
@@ -2588,6 +2594,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
+EXPORT_SYMBOL_GPL(security_file_permission);
int security_file_alloc(struct file *file)
/**
* security_file_alloc() - Allocate and init a file's LSM blob
@@ -2854,6 +2861,7 @@ int security_file_truncate(struct file *file)
{
return call_int_hook(file_truncate, 0, file);
}
+EXPORT_SYMBOL_GPL(security_file_truncate);
/**
* security_task_alloc() - Allocate a task's LSM blob
@@ -0,0 +1,16 @@
SPDX-License-Identifier: GPL-2.0
aufs6.6 lockdep patch
diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h
index 2ebc323d345a..9d7009190515 100644
--- a/include/linux/lockdep_types.h
+++ b/include/linux/lockdep_types.h
@@ -12,7 +12,7 @@
#include <linux/types.h>
-#define MAX_LOCKDEP_SUBCLASSES 8UL
+#define MAX_LOCKDEP_SUBCLASSES (8UL + 4)
enum lockdep_wait_type {
LD_WAIT_INV = 0, /* not checked, catch all */
@@ -0,0 +1,213 @@
SPDX-License-Identifier: GPL-2.0
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 6b0c626620f5..fc6fa00a3016 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -51,10 +51,13 @@ struct shmem_quota_limits {
};
struct shmem_sb_info {
+ struct mutex idr_lock;
+ bool idr_nouse;
+ struct idr idr; /* manages inode-number */
unsigned long max_blocks; /* How many blocks are allowed */
struct percpu_counter used_blocks; /* How many are allocated */
- unsigned long max_inodes; /* How many inodes are allowed */
- unsigned long free_ispace; /* How much ispace left for allocation */
+ int max_inodes; /* How many inodes are allowed */
+ int free_ispace; /* How many are left for allocation */
raw_spinlock_t stat_lock; /* Serialize shmem_sb_info changes */
umode_t mode; /* Mount mode for root directory */
unsigned char huge; /* Whether to try for hugepages */
diff --git a/mm/shmem.c b/mm/shmem.c
index 69595d341882..34cdf49cf1d4 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -111,7 +111,7 @@ struct shmem_falloc {
struct shmem_options {
unsigned long long blocks;
- unsigned long long inodes;
+ int inodes;
struct mempolicy *mpol;
kuid_t uid;
kgid_t gid;
@@ -136,12 +136,14 @@ static unsigned long shmem_default_max_blocks(void)
return totalram_pages() / 2;
}
-static unsigned long shmem_default_max_inodes(void)
+static int shmem_default_max_inodes(void)
{
unsigned long nr_pages = totalram_pages();
+ unsigned long ul;
- return min3(nr_pages - totalhigh_pages(), nr_pages / 2,
- ULONG_MAX / BOGO_INODE_SIZE);
+ ul = INT_MAX;
+ ul = min3(ul, nr_pages - totalhigh_pages(), nr_pages / 2);
+ return ul;
}
#endif
@@ -1262,6 +1264,11 @@ static void shmem_evict_inode(struct inode *inode)
}
simple_xattrs_free(&info->xattrs, sbinfo->max_inodes ? &freed : NULL);
+ if (!sbinfo->idr_nouse && inode->i_ino) {
+ mutex_lock(&sbinfo->idr_lock);
+ idr_remove(&sbinfo->idr, inode->i_ino);
+ mutex_unlock(&sbinfo->idr_lock);
+ }
shmem_free_inode(inode->i_sb, freed);
WARN_ON(inode->i_blocks);
clear_inode(inode);
@@ -2506,6 +2513,25 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap,
break;
}
+ if (!sbinfo->idr_nouse) {
+ /* inum 0 and 1 are unused */
+ mutex_lock(&sbinfo->idr_lock);
+ ino = idr_alloc(&sbinfo->idr, inode, 2, INT_MAX,
+ GFP_NOFS);
+ if (ino > 0) {
+ inode->i_ino = ino;
+ mutex_unlock(&sbinfo->idr_lock);
+ __insert_inode_hash(inode, inode->i_ino);
+ } else {
+ inode->i_ino = 0;
+ mutex_unlock(&sbinfo->idr_lock);
+ iput(inode);
+ /* shmem_free_inode() will be called */
+ inode = NULL;
+ }
+ } else
+ inode->i_ino = ino;
+
lockdep_annotate_inode_mutex_key(inode);
return inode;
}
@@ -3754,8 +3780,7 @@ static struct dentry *shmem_get_parent(struct dentry *child)
static int shmem_match(struct inode *ino, void *vfh)
{
__u32 *fh = vfh;
- __u64 inum = fh[2];
- inum = (inum << 32) | fh[1];
+ __u64 inum = fh[1];
return ino->i_ino == inum && fh[0] == ino->i_generation;
}
@@ -3775,14 +3800,11 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
struct dentry *dentry = NULL;
u64 inum;
- if (fh_len < 3)
+ if (fh_len < 2)
return NULL;
- inum = fid->raw[2];
- inum = (inum << 32) | fid->raw[1];
-
- inode = ilookup5(sb, (unsigned long)(inum + fid->raw[0]),
- shmem_match, fid->raw);
+ inum = fid->raw[1];
+ inode = ilookup5(sb, inum, shmem_match, fid->raw);
if (inode) {
dentry = shmem_find_alias(inode);
iput(inode);
@@ -3794,30 +3816,15 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
static int shmem_encode_fh(struct inode *inode, __u32 *fh, int *len,
struct inode *parent)
{
- if (*len < 3) {
- *len = 3;
+ if (*len < 2) {
+ *len = 2;
return FILEID_INVALID;
}
- if (inode_unhashed(inode)) {
- /* Unfortunately insert_inode_hash is not idempotent,
- * so as we hash inodes here rather than at creation
- * time, we need a lock to ensure we only try
- * to do it once
- */
- static DEFINE_SPINLOCK(lock);
- spin_lock(&lock);
- if (inode_unhashed(inode))
- __insert_inode_hash(inode,
- inode->i_ino + inode->i_generation);
- spin_unlock(&lock);
- }
-
fh[0] = inode->i_generation;
fh[1] = inode->i_ino;
- fh[2] = ((__u64)inode->i_ino) >> 32;
- *len = 3;
+ *len = 2;
return 1;
}
@@ -3916,7 +3923,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
break;
case Opt_nr_inodes:
ctx->inodes = memparse(param->string, &rest);
- if (*rest || ctx->inodes > ULONG_MAX / BOGO_INODE_SIZE)
+ if (*rest || ctx->inodes < 2 || ctx->inodes > INT_MAX)
goto bad_value;
ctx->seen |= SHMEM_SEEN_INODES;
break;
@@ -4202,7 +4209,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
if (sbinfo->max_blocks != shmem_default_max_blocks())
seq_printf(seq, ",size=%luk", K(sbinfo->max_blocks));
if (sbinfo->max_inodes != shmem_default_max_inodes())
- seq_printf(seq, ",nr_inodes=%lu", sbinfo->max_inodes);
+ seq_printf(seq, ",nr_inodes=%d", sbinfo->max_inodes);
if (sbinfo->mode != (0777 | S_ISVTX))
seq_printf(seq, ",mode=%03ho", sbinfo->mode);
if (!uid_eq(sbinfo->uid, GLOBAL_ROOT_UID))
@@ -4256,6 +4263,8 @@ static void shmem_put_super(struct super_block *sb)
#ifdef CONFIG_TMPFS_QUOTA
shmem_disable_quotas(sb);
#endif
+ if (!sbinfo->idr_nouse)
+ idr_destroy(&sbinfo->idr);
free_percpu(sbinfo->ino_batch);
percpu_counter_destroy(&sbinfo->used_blocks);
mpol_put(sbinfo->mpol);
@@ -4300,6 +4309,8 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc)
#else
sb->s_flags |= SB_NOUSER;
#endif
+ mutex_init(&sbinfo->idr_lock);
+ idr_init(&sbinfo->idr);
sbinfo->max_blocks = ctx->blocks;
sbinfo->max_inodes = ctx->inodes;
sbinfo->free_ispace = sbinfo->max_inodes * BOGO_INODE_SIZE;
@@ -4445,6 +4456,15 @@ static int shmem_error_remove_page(struct address_space *mapping,
return 0;
}
+static __init void shmem_no_idr(struct super_block *sb)
+{
+ struct shmem_sb_info *sbinfo;
+
+ sbinfo = SHMEM_SB(sb);
+ sbinfo->idr_nouse = true;
+ idr_destroy(&sbinfo->idr);
+}
+
const struct address_space_operations shmem_aops = {
.writepage = shmem_writepage,
.dirty_folio = noop_dirty_folio,
@@ -4618,6 +4638,7 @@ void __init shmem_init(void)
pr_err("Could not kern_mount tmpfs\n");
goto out1;
}
+ shmem_no_idr(shm_mnt->mnt_sb);
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
if (has_transparent_hugepage() && shmem_huge > SHMEM_HUGE_DENY)
@@ -0,0 +1,24 @@
SPDX-License-Identifier: GPL-2.0
diff --git a/fs/inode.c b/fs/inode.c
index 84bc3c76e5cc..63fc36b8af8e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -970,6 +970,8 @@ unsigned int get_next_ino(void)
unsigned int *p = &get_cpu_var(last_ino);
unsigned int res = *p;
+start:
+
#ifdef CONFIG_SMP
if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) {
static atomic_t shared_last_ino;
@@ -982,7 +984,7 @@ unsigned int get_next_ino(void)
res++;
/* get_next_ino should not provide a 0 inode number */
if (unlikely(!res))
- res++;
+ goto start;
*p = res;
put_cpu_var(last_ino);
return res;
Binary file not shown.
@@ -1,57 +0,0 @@
Include 3rdparty directory into the main build-system.
Original author is unknown.
(Was either Juan Quintela or Jeff Garzik)
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
[Simplified for Mageia 7 / kernel 5.1.6 and up / tmb]
Signed-off-by: Thomas Backlund <tmb@mageia.org>
---
Makefile | 2 +-
arch/arm/Kconfig | 2 ++
arch/arm64/Kconfig | 2 ++
arch/x86/Kconfig | 2 ++
4 files changed, 7 insertions(+), 1 deletion(-)
diff -Nurp linux-5.12/arch/arm/Kconfig linux-5.12-3rd/arch/arm/Kconfig
--- linux-5.12/arch/arm/Kconfig 2021-04-25 23:49:08.000000000 +0300
+++ linux-5.12-3rd/arch/arm/Kconfig 2021-04-26 18:10:06.513775304 +0300
@@ -2016,3 +2016,5 @@ source "arch/arm/crypto/Kconfig"
endif
source "arch/arm/Kconfig.assembler"
+
+source "3rdparty/Kconfig"
diff -Nurp linux-5.12/arch/arm64/Kconfig linux-5.12-3rd/arch/arm64/Kconfig
--- linux-5.12/arch/arm64/Kconfig 2021-04-25 23:49:08.000000000 +0300
+++ linux-5.12-3rd/arch/arm64/Kconfig 2021-04-26 18:10:06.512775257 +0300
@@ -1959,3 +1959,5 @@ source "arch/arm64/kvm/Kconfig"
if CRYPTO
source "arch/arm64/crypto/Kconfig"
endif
+
+source "3rdparty/Kconfig"
diff -Nurp linux-5.12/arch/x86/Kconfig linux-5.12-3rd/arch/x86/Kconfig
--- linux-5.12/arch/x86/Kconfig 2021-04-25 23:49:08.000000000 +0300
+++ linux-5.12-3rd/arch/x86/Kconfig 2021-04-26 18:10:06.512775257 +0300
@@ -2909,3 +2909,5 @@ source "drivers/firmware/Kconfig"
source "arch/x86/kvm/Kconfig"
source "arch/x86/Kconfig.assembler"
+
+source "3rdparty/Kconfig"
diff -Nurp linux-5.14/Makefile linux-5.14-3rd/Makefile
--- linux-5.14/Makefile
+++ linux-5.14-3rd/Makefile
@@ -670,7 +670,7 @@ endif
ifeq ($(KBUILD_EXTMOD),)
# Objects we will link into vmlinux / subdirs we need to visit
core-y := init/ usr/ arch/$(SRCARCH)/
-drivers-y := drivers/ sound/
+drivers-y := drivers/ sound/ 3rdparty/
drivers-$(CONFIG_SAMPLES) += samples/
drivers-$(CONFIG_NET) += net/
drivers-y += virt/
@@ -1,21 +0,0 @@
3rdparty/Kconfig | 5 +++++
3rdparty/Makefile | 3 +++
2 files changed, 8 insertions(+)
diff -Nurp linux-5.1.6/3rdparty/Kconfig linux-5.1.6-3rd/3rdparty/Kconfig
--- linux-5.1.6/3rdparty/Kconfig 1970-01-01 02:00:00.000000000 +0200
+++ linux-5.1.6-3rd/3rdparty/Kconfig 2019-05-31 23:02:53.380127780 +0300
@@ -0,0 +1,5 @@
+#
+
+menu "External 3rdparty kernel additions"
+
+endmenu
diff -Nurp linux-5.1.6/3rdparty/Makefile linux-5.1.6-3rd/3rdparty/Makefile
--- linux-5.1.6/3rdparty/Makefile 1970-01-01 02:00:00.000000000 +0200
+++ linux-5.1.6-3rd/3rdparty/Makefile 2019-05-31 23:03:58.338529850 +0300
@@ -0,0 +1,3 @@
+#
+
+obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
@@ -1,34 +0,0 @@
diff -up ./3rdparty/rtl8723de/Kconfig.tv ./3rdparty/rtl8723de/Kconfig
--- ./3rdparty/rtl8723de/Kconfig.tv 2020-10-13 21:02:42.452125426 +0200
+++ ./3rdparty/rtl8723de/Kconfig 2020-10-13 20:59:14.012371730 +0200
@@ -1,6 +1,6 @@
config RTL8723DE
tristate "Realtek 8723DE PCI WiFi"
depends on PCI
- ---help---
+ help
Help message of RTL8723DE
diff -up ./3rdparty/rtl8821ce/Kconfig.tv ./3rdparty/rtl8821ce/Kconfig
--- ./3rdparty/rtl8821ce/Kconfig.tv 2020-10-13 16:09:11.157856145 +0200
+++ ./3rdparty/rtl8821ce/Kconfig 2020-10-13 20:58:17.242118685 +0200
@@ -1,6 +1,6 @@
config RTL8821CE
tristate "Realtek 8821C PCI WiFi"
depends on PCI
- ---help---
+ help
Help message of RTL8821CE
diff -up ./3rdparty/viahss/Kconfig.tv ./3rdparty/viahss/Kconfig
--- ./3rdparty/viahss/Kconfig.tv 2020-10-13 21:02:44.844168369 +0200
+++ ./3rdparty/viahss/Kconfig 2020-10-13 20:59:19.875488718 +0200
@@ -1,7 +1,7 @@
config VIAHSS
tristate "VIA High Speed Serial"
depends on SERIAL_CORE && m
- ---help---
+ help
VIA High Speed Serial is a little kernel module (1 KB) which enables
high speed serial port modes of VIA VT82C686A or VT82C686B
southbridge-equipped motherboards. With this module, you can use the
File diff suppressed because it is too large Load Diff
@@ -1,7 +0,0 @@
--- linux-2.6.24.orig/3rdparty/ndiswrapper/Kconfig 1969-12-31 21:00:00.000000000 -0300
+++ linux-2.6.24/3rdparty/ndiswrapper/Kconfig 2007-11-26 15:11:31.000000000 -0200
@@ -0,0 +1,4 @@
+
+config NDISWRAPPER
+ tristate "NDIS driver wrapper support"
+ depends on PCI && USB && !X86_64_XEN
@@ -1,45 +0,0 @@
--- linux-3.12.2-ndiswrapper-1.59/3rdparty/ndiswrapper/Makefile.orig 2013-11-28 21:42:10.000000000 +0200
+++ linux-3.12.2-ndiswrapper-1.59/3rdparty/ndiswrapper/Makefile 2013-11-30 21:41:19.550504380 +0200
@@ -9,24 +9,10 @@ DISTFILES = \
winnt_types.h workqueue.c wrapmem.c wrapmem.h wrapndis.c wrapndis.h \
wrapper.c wrapper.h
-# By default, we try to compile the modules for the currently running
-# kernel. But it's the first approximation, as we will re-read the
-# version from the kernel sources.
-KVERS_UNAME ?= $(shell uname -r)
-
# KBUILD is the path to the Linux kernel build tree. It is usually the
# same as the kernel source tree, except when the kernel was compiled in
# a separate directory.
-KBUILD ?= $(shell readlink -f /lib/modules/$(KVERS_UNAME)/build)
-
-ifeq (,$(KBUILD))
-$(error Kernel build tree not found - please set KBUILD to configured kernel)
-endif
-
-KCONFIG := $(KBUILD)/.config
-ifeq (,$(wildcard $(KCONFIG)))
-$(error No .config found in $(KBUILD), please set KBUILD to configured kernel)
-endif
+KBUILD ?= $(srctree)
ifneq (,$(wildcard $(KBUILD)/include/linux/version.h))
ifneq (,$(wildcard $(KBUILD)/include/generated/uapi/linux/version.h))
@@ -43,16 +29,9 @@ endif
ifeq (,$(wildcard $(VERSION_H)))
VERSION_H := $(KBUILD)/include/linux/version.h
endif
-ifeq (,$(wildcard $(VERSION_H)))
-$(error Please run 'make modules_prepare' in $(KBUILD))
-endif
KVERS := $(shell sed -ne 's/"//g;s/^\#define UTS_RELEASE //p' $(VERSION_H))
-ifeq (,$(KVERS))
-$(error Cannot find UTS_RELEASE in $(VERSION_H), please report)
-endif
-
INST_DIR = /lib/modules/$(KVERS)/misc
SRC_DIR=$(shell pwd)
@@ -1,16 +0,0 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:02:53.380127780 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:26:48.844304457 +0300
@@ -2,4 +2,6 @@
menu "External 3rdparty kernel additions"
+source "3rdparty/ndiswrapper/Kconfig"
+
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:03:58.338529850 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:27:35.405319287 +0300
@@ -1,3 +1,4 @@
#
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
+obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
@@ -1,244 +0,0 @@
diff -urp linux-5.6.3/3rdparty/rtl8723de.orig/os_dep/linux/rtw_proc.c linux-5.6.3/3rdparty/rtl8723de/os_dep/linux/rtw_proc.c
--- linux-5.6.3/3rdparty/rtl8723de.orig/os_dep/linux/rtw_proc.c 2020-04-10 17:12:12.495541693 +0300
+++ linux-5.6.3/3rdparty/rtl8723de/os_dep/linux/rtw_proc.c 2020-04-10 17:22:51.328340275 +0300
@@ -68,12 +68,19 @@ inline struct proc_dir_entry *rtw_proc_c
return entry;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
+ const struct proc_ops *pops, void * data)
+#else
inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
const struct file_operations *fops, void * data)
+#endif
{
struct proc_dir_entry *entry;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+ entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, pops, data);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, fops, data);
#else
entry = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUGO, parent);
@@ -219,7 +226,24 @@ static ssize_t rtw_drv_proc_write(struct
return -EROFS;
}
-static const struct file_operations rtw_drv_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_drv_proc_seq_ops = {
+ .proc_open = rtw_drv_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_drv_proc_write,
+};
+
+static const struct proc_ops rtw_drv_proc_sseq_ops = {
+ .proc_open = rtw_drv_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_drv_proc_write,
+};
+#else
+static const struct file_operations rtw_drv_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
.read = seq_read,
@@ -228,7 +252,7 @@ static const struct file_operations rtw_
.write = rtw_drv_proc_write,
};
-static const struct file_operations rtw_drv_proc_sseq_fops = {
+static const struct file_operations rtw_drv_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
.read = seq_read,
@@ -236,6 +260,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_drv_proc_write,
};
+#endif
int rtw_drv_proc_init(void)
{
@@ -257,9 +282,9 @@ int rtw_drv_proc_init(void)
for (i = 0; i < drv_proc_hdls_num; i++) {
if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_ops, (void *)i);
else if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -2335,7 +2360,24 @@ static ssize_t rtw_adapter_proc_write(st
return -EROFS;
}
-static const struct file_operations rtw_adapter_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_adapter_proc_seq_ops = {
+ .proc_open = rtw_adapter_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_adapter_proc_write,
+};
+
+static const struct proc_ops rtw_adapter_proc_sseq_ops = {
+ .proc_open = rtw_adapter_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_adapter_proc_write,
+};
+#else
+static const struct file_operations rtw_adapter_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
.read = seq_read,
@@ -2344,7 +2386,7 @@ static const struct file_operations rtw_
.write = rtw_adapter_proc_write,
};
-static const struct file_operations rtw_adapter_proc_sseq_fops = {
+static const struct file_operations rtw_adapter_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
.read = seq_read,
@@ -2352,6 +2394,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_adapter_proc_write,
};
+#endif
int proc_get_odm_dbg_comp(struct seq_file *m, void *v)
{
@@ -2670,7 +2713,24 @@ static ssize_t rtw_odm_proc_write(struct
return -EROFS;
}
-static const struct file_operations rtw_odm_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_odm_proc_seq_ops = {
+ .proc_open = rtw_odm_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_odm_proc_write,
+};
+
+static const struct proc_ops rtw_odm_proc_sseq_ops = {
+ .proc_open = rtw_odm_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_odm_proc_write,
+};
+#else
+static const struct file_operations rtw_odm_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
.read = seq_read,
@@ -2679,7 +2739,7 @@ static const struct file_operations rtw_
.write = rtw_odm_proc_write,
};
-static const struct file_operations rtw_odm_proc_sseq_fops = {
+static const struct file_operations rtw_odm_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
.read = seq_read,
@@ -2687,6 +2747,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_odm_proc_write,
};
+#endif
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
{
@@ -2715,9 +2776,9 @@ struct proc_dir_entry *rtw_odm_proc_init
for (i = 0; i < odm_proc_hdls_num; i++) {
if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_ops, (void *)i);
else if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -2809,7 +2870,24 @@ static ssize_t rtw_mcc_proc_write(struct
return -EROFS;
}
-static const struct file_operations rtw_mcc_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_mcc_proc_seq_ops = {
+ .proc_open = rtw_mcc_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_mcc_proc_write,
+};
+
+static const struct file_operations rtw_mcc_proc_sseq_ops = {
+ .proc_open = rtw_mcc_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_mcc_proc_write,
+};
+#else
+static const struct file_operations rtw_mcc_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_mcc_proc_open,
.read = seq_read,
@@ -2818,7 +2896,7 @@ static const struct file_operations rtw_
.write = rtw_mcc_proc_write,
};
-static const struct file_operations rtw_mcc_proc_sseq_fops = {
+static const struct file_operations rtw_mcc_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_mcc_proc_open,
.read = seq_read,
@@ -2826,6 +2904,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_mcc_proc_write,
};
+#endif
struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
{
@@ -2854,9 +2933,9 @@ struct proc_dir_entry *rtw_mcc_proc_init
for (i = 0; i < mcc_proc_hdls_num; i++) {
if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_ops, (void *)i);
else if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -2920,9 +2999,9 @@ struct proc_dir_entry *rtw_adapter_proc_
for (i = 0; i < adapter_proc_hdls_num; i++) {
if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_ops, (void *)i);
else if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -1,16 +0,0 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:30:41.568375751 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:33:39.796256889 +0300
@@ -4,5 +4,6 @@ menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
source "3rdparty/rtl8812au/Kconfig"
+source "3rdparty/rtl8723de/Kconfig"
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:33:17.610773901 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:33:57.608644657 +0300
@@ -3,3 +3,4 @@
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
obj-$(CONFIG_RTL8812AU) += rtl8812au/
+obj-$(CONFIG_RTL8723DE) += rtl8723de/
@@ -1,79 +0,0 @@
--- linux-5.8/3rdparty/rtl8723de/core/rtw_security.c
+++ linux-5.8/3rdparty/rtl8723de/core/rtw_security.c
@@ -33,6 +33,14 @@ static const char *_security_type_str[] = {
"BIP",
};
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+struct sha256_state {
+ u64 length;
+ u32 state[8], curlen;
+ u8 buf[64];
+};
+#endif
+
const char *security_type_str(u8 value)
{
#ifdef CONFIG_IEEE80211W
--- linux-5.8/3rdparty/rtl8723de/include/rtw_security.h
+++ linux-5.8/3rdparty/rtl8723de/include/rtw_security.h
@@ -246,11 +246,13 @@ struct security_priv {
#endif /* DBG_SW_SEC_CNT */
};
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
struct sha256_state {
u64 length;
u32 state[8], curlen;
u8 buf[64];
};
+#endif
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
do {\
--- linux-5.8/3rdparty/rtl8723de/os_dep/linux/ioctl_cfg80211.c
+++ linux-5.8/3rdparty/rtl8723de/os_dep/linux/ioctl_cfg80211.c
@@ -5857,10 +5857,18 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#else
struct net_device *ndev,
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ struct mgmt_frame_regs *upd)
+#else
u16 frame_type, bool reg)
+#endif
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev);
+#endif
+/* hardcoded always true, to make it pass compilation */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ bool reg = true;
#endif
_adapter *adapter;
@@ -5880,7 +5888,11 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
/* Wait QC Verify */
return;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ switch (upd->interface_stypes) {
+#else
switch (frame_type) {
+#endif
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
break;
@@ -6846,7 +6858,11 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx,
- .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
+#else
+ .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
+#endif
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx,
#endif
@@ -1,13 +0,0 @@
--- linux/3rdparty/rtl8723de/include/wifi.h.orig 2019-01-19 16:29:26.302342688 +0200
+++ linux/3rdparty/rtl8723de/include/wifi.h 2019-01-19 16:32:25.543905828 +0200
@@ -1003,8 +1003,9 @@ typedef enum _HT_CAP_AMPDU_DENSITY {
* According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
*/
#define IEEE80211_MIN_AMPDU_BUF 0x8
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0))
#define IEEE80211_MAX_AMPDU_BUF 0x40
-
+#endif
/* Spatial Multiplexing Power Save Modes */
#define WLAN_HT_CAP_SM_PS_STATIC 0
@@ -1,11 +0,0 @@
--- ./3rdparty/rtl8723de/Makefile.orig 2019-10-08 13:51:56.729205790 +0300
+++ ./3rdparty/rtl8723de/Makefile 2019-10-08 14:03:32.894164296 +0300
@@ -74,7 +74,7 @@ CONFIG_APPEND_VENDOR_IE_ENABLE = n
CONFIG_RTW_NAPI = y
CONFIG_RTW_GRO = y
########################## Debug ###########################
-CONFIG_RTW_DEBUG = y
+CONFIG_RTW_DEBUG = n
# default log level is _DRV_INFO_ = 4,
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
CONFIG_RTW_LOG_LEVEL = 4
@@ -1,16 +0,0 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:26:48.844304457 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:30:41.568375751 +0300
@@ -3,5 +3,6 @@
menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
+source "3rdparty/rtl8812au/Kconfig"
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:27:35.405319287 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:30:56.855708733 +0300
@@ -2,3 +2,4 @@
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
+obj-$(CONFIG_RTL8812AU) += rtl8812au/
@@ -1,281 +0,0 @@
From ee9619ba0c8840db6d59d11989c31e24a8f0d806 Mon Sep 17 00:00:00 2001
From: Carlos <CGarces@users.noreply.github.com>
Date: Sun, 8 Nov 2020 12:25:43 +0000
Subject: [PATCH] Fix kernel 5.10-rc1
---
3rdparty/rtl8812au/core/rtw_btcoex.c | 7 ++++++-
3rdparty/rtl8812au/core/rtw_wlan_util.c | 10 ++++++----
3rdparty/rtl8812au/os_dep/linux/os_intfs.c | 19 +++++++++++++-----
3rdparty/rtl8812au/os_dep/osdep_service.c | 43 +++++++++++++++++++++++++++--------------
4 files changed, 54 insertions(+), 25 deletions(-)
diff --git a/3rdparty/rtl8812au/core/rtw_btcoex.c b/3rdparty/rtl8812au/core/rtw_btcoex.c
index d5b89bdc..f5e0f567 100644
--- a/3rdparty/rtl8812au/core/rtw_btcoex.c
+++ b/3rdparty/rtl8812au/core/rtw_btcoex.c
@@ -1443,7 +1443,9 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
{
u8 error;
struct msghdr udpmsg;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
struct iovec iov;
struct bt_coex_info *pcoex_info = &padapter->coex_info;
@@ -1473,15 +1475,18 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
udpmsg.msg_control = NULL;
udpmsg.msg_controllen = 0;
udpmsg.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL;
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
-
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg);
#else
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg, msg_size);
#endif
+#ifdef set_fs
set_fs(oldfs);
+#endif
if (error < 0) {
RTW_INFO("Error when sendimg msg, error:%d\n", error);
return _FAIL;
diff --git a/3rdparty/rtl8812au/core/rtw_wlan_util.c b/3rdparty/rtl8812au/core/rtw_wlan_util.c
index b4cecd11..e465e9b5 100644
--- a/3rdparty/rtl8812au/core/rtw_wlan_util.c
+++ b/3rdparty/rtl8812au/core/rtw_wlan_util.c
@@ -4744,7 +4744,9 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
int i = 0;
struct file *fp;
+#ifdef set_fs
mm_segment_t fs;
+#endif
loff_t pos = 0;
u8 *source = NULL;
long len = 0;
@@ -4780,10 +4782,10 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
RTW_INFO("Error, cipher array using default value.\n");
return 0;
}
-
+#ifdef set_fs
fs = get_fs();
set_fs(KERNEL_DS);
-
+#endif
source = rtw_zmalloc(2048);
if (source != NULL) {
@@ -4791,10 +4793,10 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
rtw_parse_cipher_list(nlo_info, source);
rtw_mfree(source, 2048);
}
-
+#ifdef set_fs
set_fs(fs);
filp_close(fp, NULL);
-
+#endif
RTW_INFO("-%s-\n", __func__);
return 0;
}
diff --git a/3rdparty/rtl8812au/os_dep/linux/os_intfs.c b/3rdparty/rtl8812au/os_dep/linux/os_intfs.c
index 1085d6cd..a37e488b 100644
--- a/3rdparty/rtl8812au/os_dep/linux/os_intfs.c
+++ b/3rdparty/rtl8812au/os_dep/linux/os_intfs.c
@@ -4029,7 +4029,9 @@ static int route_dump(u32 *gw_addr , int *gw_index)
struct msghdr msg;
struct iovec iov;
struct sockaddr_nl nladdr;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
char *pg;
int size = 0;
@@ -4067,16 +4069,18 @@ static int route_dump(u32 *gw_addr , int *gw_index)
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
-
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
err = sock_sendmsg(sock, &msg);
#else
err = sock_sendmsg(sock, &msg, sizeof(req));
#endif
+#ifdef set_fs
set_fs(oldfs);
-
+#endif
if (err < 0)
goto out_sock;
@@ -4099,16 +4103,18 @@ static int route_dump(u32 *gw_addr , int *gw_index)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
iov_iter_init(&msg.msg_iter, READ, &iov, 1, PAGE_SIZE);
#endif
-
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
err = sock_recvmsg(sock, &msg, MSG_DONTWAIT);
#else
err = sock_recvmsg(sock, &msg, PAGE_SIZE, MSG_DONTWAIT);
#endif
+#ifdef set_fs
set_fs(oldfs);
-
+#endif
if (err < 0)
goto out_sock_pg;
@@ -4178,15 +4184,18 @@ static int route_dump(u32 *gw_addr , int *gw_index)
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
err = sock_sendmsg(sock, &msg);
#else
err = sock_sendmsg(sock, &msg, sizeof(req));
#endif
+#ifdef set_fs
set_fs(oldfs);
-
+#endif
if (err > 0)
goto restart;
}
diff --git a/3rdparty/rtl8812au/os_dep/osdep_service.c b/3rdparty/rtl8812au/os_dep/osdep_service.c
index 7c6d1208..0769b49d 100644
--- a/3rdparty/rtl8812au/os_dep/osdep_service.c
+++ b/3rdparty/rtl8812au/os_dep/osdep_service.c
@@ -2164,11 +2164,21 @@ static int writeFile(struct file *fp, char *buf, int len)
{
int wlen = 0, sum = 0;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
+ if (!(fp->f_mode & FMODE_CAN_WRITE))
+#else
if (!fp->f_op || !fp->f_op->write)
+#endif
return -EPERM;
while (sum < len) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
+ wlen = kernel_write(fp, buf + sum, len - sum, &fp->f_pos);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
+ wlen = __vfs_write(fp, buf + sum, len - sum, &fp->f_pos);
+#else
wlen = fp->f_op->write(fp, buf + sum, len - sum, &fp->f_pos);
+#endif
if (wlen > 0)
sum += wlen;
else if (0 != wlen)
@@ -2191,19 +2201,19 @@ static int isFileReadable(const char *path, u32 *sz)
{
struct file *fp;
int ret = 0;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
char buf;
fp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(fp))
ret = PTR_ERR(fp);
else {
+#ifdef set_fs
oldfs = get_fs();
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
- #else
- set_fs(get_ds());
- #endif
+#endif
if (1 != readFile(fp, &buf, 1))
ret = PTR_ERR(fp);
@@ -2215,8 +2225,9 @@ static int isFileReadable(const char *path, u32 *sz)
*sz = i_size_read(fp->f_dentry->d_inode);
#endif
}
-
+#ifdef set_fs
set_fs(oldfs);
+#endif
filp_close(fp, NULL);
}
return ret;
@@ -2232,22 +2243,23 @@ static int isFileReadable(const char *path, u32 *sz)
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
{
int ret = -1;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
struct file *fp;
if (path && buf) {
ret = openFile(&fp, path, O_RDONLY, 0);
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
-
+#ifdef set_fs
oldfs = get_fs();
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
- #else
- set_fs(get_ds());
- #endif
ret = readFile(fp, buf, sz);
set_fs(oldfs);
+#else
+ ret = readFile(fp, buf, sz);
+#endif
closeFile(fp);
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
@@ -2271,22 +2283,23 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
static int storeToFile(const char *path, u8 *buf, u32 sz)
{
int ret = 0;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
struct file *fp;
if (path && buf) {
ret = openFile(&fp, path, O_CREAT | O_WRONLY, 0666);
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
-
+#ifdef set_fs
oldfs = get_fs();
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
- #else
- set_fs(get_ds());
- #endif
ret = writeFile(fp, buf, sz);
set_fs(oldfs);
+#else
+ ret = writeFile(fp, buf, sz);
+#endif
closeFile(fp);
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
@@ -1,12 +0,0 @@
diff -urp linux/3rdparty/rtl8812au.orig/os_dep/linux/recv_linux.c linux/3rdparty/rtl8812au/os_dep/linux/recv_linux.c
--- linux/3rdparty/rtl8812au.orig/os_dep/linux/recv_linux.c 2021-04-26 18:35:37.411027594 +0300
+++ linux/3rdparty/rtl8812au/os_dep/linux/recv_linux.c 2021-04-26 18:53:13.502814526 +0300
@@ -353,7 +353,7 @@ static int napi_recv(_adapter *padapter,
rx_ok = _FALSE;
-#ifdef CONFIG_RTW_GRO
+#if defined(CONFIG_RTW_GRO) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
if (pregistrypriv->en_gro) {
if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP)
rx_ok = _TRUE;
@@ -1,66 +0,0 @@
From:
https://github.com/aircrack-ng/rtl8812au/commit/47a38b7c736dd9e9baac9eb07a6dceb83429fb49
diff -Nurp linux-5.15/3rdparty/rtl8812au.orig/core/rtw_br_ext.c linux-5.15/3rdparty/rtl8812au/core/rtw_br_ext.c
--- linux-5.15/3rdparty/rtl8812au.orig/core/rtw_br_ext.c 2021-11-08 23:40:48.236272741 +0200
+++ linux-5.15/3rdparty/rtl8812au/core/rtw_br_ext.c 2021-11-08 23:49:12.118046953 +0200
@@ -17,7 +17,10 @@
#ifdef __KERNEL__
#include <linux/if_arp.h>
#include <net/ip.h>
+ #include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
#include <net/ipx.h>
+#endif
#include <linux/atalk.h>
#include <linux/udp.h>
#include <linux/if_pppox.h>
@@ -169,6 +172,7 @@ static __inline__ void __nat25_generate_
}
+#ifdef _NET_INET_IPX_H_
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
{
@@ -189,6 +193,7 @@ static __inline__ void __nat25_generate_
memcpy(networkAddr + 1, (unsigned char *)ipxNetAddr, 4);
memcpy(networkAddr + 5, (unsigned char *)ipxSocketAddr, 2);
}
+#endif
static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
@@ -330,6 +335,7 @@ static __inline__ int __nat25_network_ha
x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
return x & (NAT25_HASH_SIZE - 1);
+#ifdef _NET_INET_IPX_H_
} else if (networkAddr[0] == NAT25_IPX) {
unsigned long x;
@@ -337,6 +343,7 @@ static __inline__ int __nat25_network_ha
networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
return x & (NAT25_HASH_SIZE - 1);
+#endif
} else if (networkAddr[0] == NAT25_APPLE) {
unsigned long x;
@@ -889,6 +896,7 @@ int nat25_db_handle(_adapter *priv, stru
}
}
+#ifdef _NET_INET_IPX_H_
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
@@ -1109,6 +1117,7 @@ int nat25_db_handle(_adapter *priv, stru
return -1;
}
+#endif
/*---------------------------------------------------*/
/* Handle PPPoE frame */
@@ -1,78 +0,0 @@
Adjust driver bits so it keeps the name of the replaced driver
Signed-off-by: Thomas Backlund <tmb@mageia.org>
---
3rdparty/rtl8812au/Kconfig | 7 +++----
3rdparty/rtl8812au/Makefile | 8 ++++----
3rdparty/rtl8812au/hal/hal_com.c | 2 +-
3rdparty/rtl8812au/os_dep/linux/ioctl_cfg80211.c | 2 +-
4 files changed, 9 insertions(+), 10 deletions(-)
diff -Nurp linux-5.11/3rdparty/rtl8812au.orig/hal/hal_com.c linux-5.11/3rdparty/rtl8812au/hal/hal_com.c
--- linux-5.11/3rdparty/rtl8812au.orig/hal/hal_com.c 2021-03-07 18:43:20.313672664 +0200
+++ linux-5.11/3rdparty/rtl8812au/hal/hal_com.c 2021-03-07 18:43:51.392141299 +0200
@@ -12879,7 +12879,7 @@ bypass_hw_pg:
_rtw_memset(hal_data->EEPROMMACAddr, 0, ETH_ALEN);
ret = _FAIL;
exit:
- dev_info(&udev->dev, "88XXau %pM hw_info[%02x]", hw_addr, addr_offset);
+ dev_info(&udev->dev, "8812au %pM hw_info[%02x]", hw_addr, addr_offset);
return ret;
}
diff -Nurp linux-5.11/3rdparty/rtl8812au.orig/Kconfig linux-5.11/3rdparty/rtl8812au/Kconfig
--- linux-5.11/3rdparty/rtl8812au.orig/Kconfig 2021-03-07 18:43:20.369675309 +0200
+++ linux-5.11/3rdparty/rtl8812au/Kconfig 2021-03-07 18:45:22.910465892 +0200
@@ -1,6 +1,5 @@
-config 88XXAU
- tristate "Realtek 88XXau USB WiFi"
+config RTL8812AU
+ tristate "Realtek 8812au USB WiFi"
depends on USB
help
- Help message of 88XXau
-
+ Help message of 8812au
diff -Nurp linux-5.11/3rdparty/rtl8812au.orig/Makefile linux-5.11/3rdparty/rtl8812au/Makefile
--- linux-5.11/3rdparty/rtl8812au.orig/Makefile 2021-03-07 18:43:20.370675357 +0200
+++ linux-5.11/3rdparty/rtl8812au/Makefile 2021-03-07 18:43:51.401141725 +0200
@@ -180,9 +180,9 @@ endif
ifeq ($(CONFIG_RTL8812A)_$(CONFIG_RTL8821A)_$(CONFIG_RTL8814A), y_y_n)
-EXTRA_CFLAGS += -DDRV_NAME=\"rtl88XXau\"
+EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
ifeq ($(CONFIG_USB_HCI), y)
-USER_MODULE_NAME = 88XXau
+USER_MODULE_NAME = 8812au
endif
else
EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
@@ -2232,11 +2232,11 @@ $(MODULE_NAME)-y += $(_PLATFORM_FILES)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o
-obj-$(CONFIG_88XXAU) := $(MODULE_NAME).o
+obj-$(CONFIG_RTL8812AU) := $(MODULE_NAME).o
else
-export CONFIG_88XXAU = m
+export CONFIG_RTL8812AU = m
all: modules
diff -Nurp linux-5.11/3rdparty/rtl8812au.orig/os_dep/linux/ioctl_cfg80211.c linux-5.11/3rdparty/rtl8812au/os_dep/linux/ioctl_cfg80211.c
--- linux-5.11/3rdparty/rtl8812au.orig/os_dep/linux/ioctl_cfg80211.c 2021-03-07 18:43:20.371675404 +0200
+++ linux-5.11/3rdparty/rtl8812au/os_dep/linux/ioctl_cfg80211.c 2021-03-07 18:43:51.402141772 +0200
@@ -2646,7 +2646,7 @@ void rtw_cfg80211_unlink_bss(_adapter *p
#endif
if (!wiphy) {
- pr_info("88XXAU: rtw_cfg80211_unlink_bss: wiphy is NULL\n");
+ pr_info("8812AU: rtw_cfg80211_unlink_bss: wiphy is NULL\n");
return;
}
@@ -1,301 +0,0 @@
diff -up linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c.kernel58 linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c
--- linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c.kernel58 2020-08-12 18:12:12.492276511 +0200
+++ linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c 2020-08-12 18:13:07.202678858 +0200
@@ -2133,7 +2133,7 @@ BIP_exit:
#ifndef PLATFORM_FREEBSD
#if defined(CONFIG_TDLS)
/* compress 512-bits */
-static int sha256_compress(struct _sha256_state *md, unsigned char *buf)
+static int sha256_compress(struct sha256_state *md, unsigned char *buf)
{
u32 S[8], W[64], t0, t1;
u32 t;
@@ -2181,7 +2181,7 @@ static int sha256_compress(struct _sha25
}
/* Initialize the hash state */
-static void sha256_init(struct _sha256_state *md)
+static void sha256_init(struct sha256_state *md)
{
md->curlen = 0;
md->length = 0;
@@ -2202,7 +2202,7 @@ static void sha256_init(struct _sha256_s
@param inlen The length of the data (octets)
@return CRYPT_OK if successful
*/
-static int sha256_process(struct _sha256_state *md, unsigned char *in,
+static int sha256_process(struct sha256_state *md, unsigned char *in,
unsigned long inlen)
{
unsigned long n;
@@ -2243,7 +2243,7 @@ static int sha256_process(struct _sha256
@param out [out] The destination of the hash (32 bytes)
@return CRYPT_OK if successful
*/
-static int sha256_done(struct _sha256_state *md, unsigned char *out)
+static int sha256_done(struct sha256_state *md, unsigned char *out)
{
int i;
@@ -2293,7 +2293,7 @@ static int sha256_done(struct _sha256_st
static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
u8 *mac)
{
- struct _sha256_state ctx;
+ struct sha256_state ctx;
size_t i;
sha256_init(&ctx);
diff -up linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h.kernel58 linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h
--- linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h.kernel58 2020-08-12 18:12:12.860279218 +0200
+++ linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h 2020-08-12 18:13:07.202678858 +0200
@@ -249,11 +249,13 @@ struct security_priv {
#define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE
#endif
-struct _sha256_state {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
+struct sha256_state {
u64 length;
u32 state[8], curlen;
u8 buf[64];
};
+#endif
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
do {\
diff -up linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c.kernel58 linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c
--- linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c.kernel58 2020-08-12 18:12:12.867279269 +0200
+++ linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c 2020-08-12 18:13:07.204678873 +0200
@@ -80,7 +80,7 @@
#endif
/*
- * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant)
+ * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant)
* when Wi-Fi driver decides to abort the scan request in the scan flow by default.
* Defining this flag makes Wi-Fi driver to return -EBUSY to the system if Wi-Fi driver is too busy to do the scan.
*/
@@ -321,7 +321,7 @@ static u8 rtw_chbw_to_cfg80211_chan_def(
if (!chan)
goto exit;
- if (bw == CHANNEL_WIDTH_20)
+ if (bw == CHANNEL_WIDTH_20)
chdef->width = ht ? NL80211_CHAN_WIDTH_20 : NL80211_CHAN_WIDTH_20_NOHT;
else if (bw == CHANNEL_WIDTH_40)
chdef->width = NL80211_CHAN_WIDTH_40;
@@ -355,7 +355,7 @@ static void rtw_get_chbw_from_cfg80211_c
rtw_warn_on(1);
*ch = 0;
return;
- }
+ }
switch (chdef->width) {
case NL80211_CHAN_WIDTH_20_NOHT:
@@ -1577,8 +1577,8 @@ static int rtw_cfg80211_set_encryption(s
_rtw_memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8);
_rtw_memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8);
padapter->securitypriv.binstallGrpkey = _TRUE;
- if (param->u.crypt.idx < 4)
- _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8);
+ if (param->u.crypt.idx < 4)
+ _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8);
padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx;
rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1, _TRUE);
@@ -1826,7 +1826,7 @@ static int cfg80211_rtw_get_key(struct w
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
|| (MLME_IS_STA(adapter) && !pairwise)
#endif
- ) {
+ ) {
/* WEP key, TX GTK/IGTK, RX GTK/IGTK(for STA mode) */
if (is_wep_enc(sec->dot118021XGrpPrivacy)) {
if (keyid >= WEP_KEYS)
@@ -1915,7 +1915,7 @@ static int cfg80211_rtw_get_key(struct w
}
ret = 0;
-
+
exit:
RTW_INFO(FUNC_NDEV_FMT
GET_KEY_PARAM_FMT_S
@@ -5565,7 +5565,7 @@ release_plink_ctl:
if (del_sta) {
u8 sta_addr[ETH_ALEN];
u8 updated = _FALSE;
-
+
_rtw_memcpy(sta_addr, del_sta->cmn.mac_addr, ETH_ALEN);
updated = ap_free_sta(adapter, del_sta, 0, 0, 1);
rtw_mesh_expire_peer(stapriv->padapter, sta_addr);
@@ -5650,7 +5650,7 @@ static int cfg80211_rtw_dump_station(str
else
_rtw_memcpy(mac, plink->addr, ETH_ALEN);
#endif
-
+
sinfo->filled = 0;
if (psta) {
@@ -7307,11 +7307,22 @@ static void cfg80211_rtw_mgmt_frame_regi
#else
struct net_device *ndev,
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ struct mgmt_frame_regs *upd)
+#else
u16 frame_type, bool reg)
+#endif
+
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev);
#endif
+
+/* hardcoded always true, to make it pass compilation */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ bool reg = true;
+#endif
+
_adapter *adapter;
struct rtw_wdev_priv *pwdev_priv;
@@ -7330,7 +7341,12 @@ static void cfg80211_rtw_mgmt_frame_regi
/* Wait QC Verify */
return;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ switch (upd->interface_stypes) {
+#else
switch (frame_type) {
+#endif
+
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
break;
@@ -7682,7 +7698,7 @@ void dump_mesh_config(void *sel, const s
RTW_PRINT_SEL(sel, "path_refresh_time:%u\n", conf->path_refresh_time);
RTW_PRINT_SEL(sel, "min_discovery_timeout:%u\n", conf->min_discovery_timeout);
RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathTimeout:%u\n", conf->dot11MeshHWMPactivePathTimeout);
- RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval);
+ RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0))
RTW_PRINT_SEL(sel, "dot11MeshHWMPperrMinInterval:%u\n", conf->dot11MeshHWMPperrMinInterval);
#endif
@@ -7697,11 +7713,11 @@ void dump_mesh_config(void *sel, const s
RTW_PRINT_SEL(sel, "dot11MeshForwarding:%d\n", conf->dot11MeshForwarding);
RTW_PRINT_SEL(sel, "rssi_threshold:%d\n", conf->rssi_threshold);
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0))
RTW_PRINT_SEL(sel, "ht_opmode:0x%04x\n", conf->ht_opmode);
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathToRootTimeout:%u\n", conf->dot11MeshHWMPactivePathToRootTimeout);
RTW_PRINT_SEL(sel, "dot11MeshHWMProotInterval:%u\n", conf->dot11MeshHWMProotInterval);
@@ -7712,7 +7728,7 @@ void dump_mesh_config(void *sel, const s
RTW_PRINT_SEL(sel, "power_mode:%s\n", nl80211_mesh_power_mode_str(conf->power_mode));
RTW_PRINT_SEL(sel, "dot11MeshAwakeWindowDuration:%u\n", conf->dot11MeshAwakeWindowDuration);
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
RTW_PRINT_SEL(sel, "plink_timeout:%u\n", conf->plink_timeout);
#endif
@@ -7848,14 +7864,14 @@ static void rtw_cfg80211_mesh_cfg_set(_a
if (chk_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask));
#endif
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
if (chk_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask))
mcfg->dot11MeshHWMPactivePathToRootTimeout = conf->dot11MeshHWMPactivePathToRootTimeout;
if (chk_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask))
mcfg->dot11MeshHWMProotInterval = conf->dot11MeshHWMProotInterval;
if (chk_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask))
- mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval;
+ mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval;
#endif
#if 0 /* TBD */
@@ -7913,7 +7929,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_i
#endif
if (!ch)
goto exit;
-
+
#if defined(CONFIG_80211AC_VHT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
vht = ht && ch > 14 && bw >= CHANNEL_WIDTH_80; /* VHT40/VHT20? */
#endif
@@ -8244,7 +8260,7 @@ static int cfg80211_rtw_join_mesh(struct
ret = -EINVAL;
goto exit;
}
-
+
rtw_mesh_work(&adapter->mesh_work);
exit:
@@ -8325,7 +8341,7 @@ static int cfg80211_rtw_del_mpath(struct
}
} else {
rtw_mesh_path_flush_by_iface(adapter);
- }
+ }
exit:
return ret;
@@ -8626,13 +8642,13 @@ int cfg80211_rtw_resume(struct wiphy *wi
//rtw_sitesurvey_cmd(padapter, NULL);
rtw_sitesurvey_cmd(padapter, &parm);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
-
+
for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) {
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE)
break;
rtw_msleep_os(1000);
}
-
+
_enter_critical_bh(&pmlmepriv->lock, &irqL);
cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
@@ -8640,7 +8656,7 @@ int cfg80211_rtw_resume(struct wiphy *wi
}
RTW_DBG("<== %s\n",__func__);
return 0;
-
+
}
#endif /* CONFIG_PNO_SUPPORT */
@@ -9530,7 +9546,7 @@ int rtw_hostapd_acs_dump_survey(struct w
#elif defined(CONFIG_RTW_ACS) && defined(CONFIG_BACKGROUND_NOISE_MONITOR)
rtw_cfg80211_set_survey_info_with_clm(padapter, idx, info);
#else
- RTW_ERR("%s: unknown acs operation!\n", __func__);
+ RTW_ERR("%s: unknown acs operation!\n", __func__);
#endif
return ret;
@@ -9631,7 +9647,11 @@ static struct cfg80211_ops rtw_cfg80211_
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
+#else
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
+#endif
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx,
#endif
@@ -1,20 +0,0 @@
--- linux-5.3.orig/3rdparty/Kconfig
+++ linux-5.3/3rdparty/Kconfig
@@ -3,6 +3,7 @@
menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
+source "3rdparty/rtl8821ce/Kconfig"
source "3rdparty/rtl8812au/Kconfig"
source "3rdparty/rtl8723de/Kconfig"
source "3rdparty/viahss/Kconfig"
--- linux-5.3.orig/3rdparty/Makefile
+++ linux-5.3/3rdparty/Makefile
@@ -2,6 +2,7 @@
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
+obj-$(CONFIG_RTL8821CE) += rtl8821ce/
obj-$(CONFIG_RTL8812AU) += rtl8812au/
obj-$(CONFIG_RTL8723DE) += rtl8723de/
obj-$(CONFIG_VIAHSS) += viahss/
@@ -1,162 +0,0 @@
diff -urp linux-5.10/3rdparty/rtl8821ce.orig/core/rtw_btcoex.c linux-5.10/3rdparty/rtl8821ce/core/rtw_btcoex.c
--- linux-5.10/3rdparty/rtl8821ce.orig/core/rtw_btcoex.c 2021-01-19 22:18:00.924067581 +0200
+++ linux-5.10/3rdparty/rtl8821ce/core/rtw_btcoex.c 2021-01-19 22:22:20.057518961 +0200
@@ -1474,15 +1474,20 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *
udpmsg.msg_control = NULL;
udpmsg.msg_controllen = 0;
udpmsg.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL;
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg);
#else
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg, msg_size);
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
+#endif
if (error < 0) {
RTW_INFO("Error when sendimg msg, error:%d\n", error);
return _FAIL;
diff -urp linux-5.10/3rdparty/rtl8821ce.orig/core/rtw_wlan_util.c linux-5.10/3rdparty/rtl8821ce/core/rtw_wlan_util.c
--- linux-5.10/3rdparty/rtl8821ce.orig/core/rtw_wlan_util.c 2021-01-19 22:18:00.937068206 +0200
+++ linux-5.10/3rdparty/rtl8821ce/core/rtw_wlan_util.c 2021-01-19 22:22:20.067519442 +0200
@@ -4751,8 +4751,10 @@ int rtw_dev_nlo_info_set(struct pno_nlo_
return 0;
}
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0))
fs = get_fs();
set_fs(KERNEL_DS);
+#endif
source = rtw_zmalloc(2048);
@@ -4762,7 +4764,9 @@ int rtw_dev_nlo_info_set(struct pno_nlo_
rtw_mfree(source, 2048);
}
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0))
set_fs(fs);
+#endif
filp_close(fp, NULL);
RTW_INFO("-%s-\n", __func__);
diff -urp linux-5.10/3rdparty/rtl8821ce.orig/os_dep/linux/os_intfs.c linux-5.10/3rdparty/rtl8821ce/os_dep/linux/os_intfs.c
--- linux-5.10/3rdparty/rtl8821ce.orig/os_dep/linux/os_intfs.c 2021-01-19 22:18:01.078074981 +0200
+++ linux-5.10/3rdparty/rtl8821ce/os_dep/linux/os_intfs.c 2021-01-19 22:22:20.068519490 +0200
@@ -4008,14 +4008,18 @@ static int route_dump(u32 *gw_addr , int
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
err = sock_sendmsg(sock, &msg);
#else
err = sock_sendmsg(sock, &msg, sizeof(req));
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
+#endif
if (err < 0)
goto out_sock;
@@ -4040,14 +4044,18 @@ restart:
iov_iter_init(&msg.msg_iter, READ, &iov, 1, PAGE_SIZE);
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
err = sock_recvmsg(sock, &msg, MSG_DONTWAIT);
#else
err = sock_recvmsg(sock, &msg, PAGE_SIZE, MSG_DONTWAIT);
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
+#endif
if (err < 0)
goto out_sock_pg;
@@ -4118,14 +4126,18 @@ done:
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
err = sock_sendmsg(sock, &msg);
#else
err = sock_sendmsg(sock, &msg, sizeof(req));
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
+#endif
if (err > 0)
goto restart;
diff -urp linux-5.10/3rdparty/rtl8821ce.orig/os_dep/osdep_service.c linux-5.10/3rdparty/rtl8821ce/os_dep/osdep_service.c
--- linux-5.10/3rdparty/rtl8821ce.orig/os_dep/osdep_service.c 2021-01-19 22:18:01.081075125 +0200
+++ linux-5.10/3rdparty/rtl8821ce/os_dep/osdep_service.c 2021-01-19 22:22:20.068519490 +0200
@@ -2200,8 +2200,10 @@ static int isFileReadable(const char *pa
if (IS_ERR(fp))
ret = PTR_ERR(fp);
else {
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
+ #endif
if (1 != readFile(fp, &buf, 1))
ret = PTR_ERR(fp);
@@ -2214,7 +2216,9 @@ static int isFileReadable(const char *pa
#endif
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
+#endif
filp_close(fp, NULL);
}
return ret;
@@ -2238,10 +2242,14 @@ static int retriveFromFile(const char *p
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
+ #endif
ret = readFile(fp, buf, sz);
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
+ #endif
closeFile(fp);
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
@@ -2273,10 +2281,14 @@ static int storeToFile(const char *path,
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
+ #endif
ret = writeFile(fp, buf, sz);
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
+ #endif
closeFile(fp);
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
@@ -1,12 +0,0 @@
diff -urp linux/3rdparty/rtl8821ce.orig/os_dep/linux/recv_linux.c linux/3rdparty/rtl8821ce/os_dep/linux/recv_linux.c
--- linux/3rdparty/rtl8821ce.orig/os_dep/linux/recv_linux.c 2021-04-26 18:35:37.690041052 +0300
+++ linux/3rdparty/rtl8821ce/os_dep/linux/recv_linux.c 2021-04-26 18:53:23.534295732 +0300
@@ -353,7 +353,7 @@ static int napi_recv(_adapter *padapter,
rx_ok = _FALSE;
-#ifdef CONFIG_RTW_GRO
+#if defined(CONFIG_RTW_GRO) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
if (pregistrypriv->en_gro) {
if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP)
rx_ok = _TRUE;
@@ -1,66 +0,0 @@
From:
https://github.com/aircrack-ng/rtl8812au/commit/47a38b7c736dd9e9baac9eb07a6dceb83429fb49
diff -Nurp linux-5.15/3rdparty/rtl8821ce.orig/core/rtw_br_ext.c linux-5.15/3rdparty/rtl8821ce/core/rtw_br_ext.c
--- linux-5.15/3rdparty/rtl8821ce.orig/core/rtw_br_ext.c 2021-11-08 23:40:48.236272741 +0200
+++ linux-5.15/3rdparty/rtl8821ce/core/rtw_br_ext.c 2021-11-08 23:49:12.118046953 +0200
@@ -17,7 +17,10 @@
#ifdef __KERNEL__
#include <linux/if_arp.h>
#include <net/ip.h>
+ #include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
#include <net/ipx.h>
+#endif
#include <linux/atalk.h>
#include <linux/udp.h>
#include <linux/if_pppox.h>
@@ -169,6 +172,7 @@ static __inline__ void __nat25_generate_
}
+#ifdef _NET_INET_IPX_H_
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
{
@@ -189,6 +193,7 @@ static __inline__ void __nat25_generate_
memcpy(networkAddr + 1, (unsigned char *)ipxNetAddr, 4);
memcpy(networkAddr + 5, (unsigned char *)ipxSocketAddr, 2);
}
+#endif
static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
@@ -330,6 +335,7 @@ static __inline__ int __nat25_network_ha
x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
return x & (NAT25_HASH_SIZE - 1);
+#ifdef _NET_INET_IPX_H_
} else if (networkAddr[0] == NAT25_IPX) {
unsigned long x;
@@ -337,6 +343,7 @@ static __inline__ int __nat25_network_ha
networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
return x & (NAT25_HASH_SIZE - 1);
+#endif
} else if (networkAddr[0] == NAT25_APPLE) {
unsigned long x;
@@ -889,6 +896,7 @@ int nat25_db_handle(_adapter *priv, stru
}
}
+#ifdef _NET_INET_IPX_H_
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
@@ -1109,6 +1117,7 @@ int nat25_db_handle(_adapter *priv, stru
return -1;
}
+#endif
/*---------------------------------------------------*/
/* Handle PPPoE frame */
@@ -1,189 +0,0 @@
3rdparty/viahss/Kconfig | 14 +++++++
3rdparty/viahss/Makefile | 3 +
3rdparty/viahss/README.html | 68 ++++++++++++++++++++++++++++++++++++
3rdparty/viahss/viahss.c | 83 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 168 insertions(+)
diff -Nurp linux-2.6.37/3rdparty/viahss/Kconfig linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig
--- linux-2.6.37/3rdparty/viahss/Kconfig 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig 2003-12-01 01:53:51.000000000 +0200
@@ -0,0 +1,14 @@
+config VIAHSS
+ tristate "VIA High Speed Serial"
+ depends on SERIAL_CORE && m
+ ---help---
+ VIA High Speed Serial is a little kernel module (1 KB) which enables
+ high speed serial port modes of VIA VT82C686A or VT82C686B
+ southbridge-equipped motherboards. With this module, you can use the
+ serial port at 230400 bit/s so that you can get the full 128000 bit/s
+ from ISDN-TA. The module has been tested with both 686A and 686B
+ chipsets.
+
+ To compile this driver as a module, choose M here: the
+ module will be called viahss.
+
diff -Nurp linux-2.6.37/3rdparty/viahss/Makefile linux-2.6.37.3rdparty/3rdparty/viahss/Makefile
--- linux-2.6.37/3rdparty/viahss/Makefile 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Makefile 2003-12-01 01:43:23.000000000 +0200
@@ -0,0 +1,3 @@
+
+obj-$(CONFIG_VIAHSS) += viahss.o
+
diff -Nurp linux-2.6.37/3rdparty/viahss/README.html linux-2.6.37.3rdparty/3rdparty/viahss/README.html
--- linux-2.6.37/3rdparty/viahss/README.html 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/README.html 2003-12-01 01:58:23.000000000 +0200
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+ <title>High speed serial port for VIA VT82C686 chipsets for linux</title>
+</head>
+<body>
+<H3>Setting the serial port speed over 115,200bps</H3>
+<br>
+If you have motherboard which has VIA VT82C686A or VT82C686B chipset
+you can set serial ports in high speed mode with this kernel module.
+I use module with external ISDN-TA and haven't had any problems
+so far but I cannot guarantee that you won't have buffer overflows if
+you use full 230K or 460K speed all the time (FIFO's are still 16550A size).
+ISDN with two channels maxes out at 128 Kb which means that it doesn't
+really stress serial ports at 230400. Unlike SHSMOD-patches you don't have
+to patch serial driver and module takes only 1KB of memory when it's
+loaded which should leave enough room for other programs. It should
+be also possible to make this work from userspace but accessing
+pci devices is so much easier from kernel.
+
+<H3>How to use module</H3>
+Get the <A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>package</A>
+and compile it using included makefiles.
+<H3>For 2.4</H3>
+If you have kernel in some other location than /usr/src/linux edit Makefile
+before compiling. You can also install module with "make install". After
+you have loaded module in kernel (use modprobe or insmod) you can set serial
+ports to use high speed modes with setserial.<br>
+<H3>For 2.5/2.6</H3>
+Copy Makefile-2.6 on top of Makefile and do make. After loading module set
+serial speed with setserial. (NOTE: This gives a warning on depracated
+method).
+
+<br>
+# setserial /dev/ttyS0 spd_cust divisor 0x8002
+<br><br>
+which sets COM1: speed to 230400. With 0x8001 you should get 460800
+but I haven't tested it. If you want to use COM2: use ttyS1 instead of ttyS0.
+
+After this you should set program which you are using to use 38400 bps
+speed which is now actually 230K or 460K. For more information check
+setserial man page (spd_cust).
+
+You can use serial port work as normal if you do<br>
+<br>
+# setserial /dev/ttyS0 spd_normal <br><br>
+After this you can also remove viahss module with rmmod if you need to. Module doesn't intefere with normal serial port usage so you can leave
+it loaded if you don't need that extra 1KB which module uses.
+<H3>Download</H3>
+<A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>viahss-0.92.tar.gz</A>
+
+<H3>Acknowledgments</H3>
+
+Thanks to Kimmo Rintala for help with divisor settings.<br>
+I also like to thank Jeff Garzik for help with VIA datasheets.<br>
+Port to 2.5/2.6 by Kingsly John with the help of <A href=http://lwn.net>LWN</A>
+
+<H3>Version History</H3>
+0.90 First release<br>
+0.91 Fixed Makefile <br>
+0.92 Fixed for 2.5/2.6<br>
+
+<H3>Contact</H3>
+
+You can reach me by email: <A href=mailto:jrauti@iki.fi>jrauti@iki.fi</A>
+</body>
+</html>
diff -Nurp linux-2.6.37/3rdparty/viahss/viahss.c linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c
--- linux-2.6.37/3rdparty/viahss/viahss.c 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c 2003-07-17 09:49:59.000000000 +0300
@@ -0,0 +1,83 @@
+/*
+ * VIA VT 82c686[AB] high speed serial port enabler
+ * Version 0.92
+ * Copyright (c) 2000-2001 Juhani Rautiainen <jrauti@iki.fi>
+ *
+ * 0.92:
+ * Ported to 2.5/2.6 by Kingsly John
+ * - Corrected locking (no more cli() and sti())
+ * - New makefile
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+*/
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+
+const unsigned short confindex=0x3F0,confdata=0x3F1;
+const unsigned char spcidx=0xEE;
+
+spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
+
+static int __init viahss_init(void)
+{
+ struct pci_dev *pcidev = NULL;
+ unsigned char confval,val;
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ if (pcidev) {
+ spin_lock_irq(&driver_lock);
+ /* start config */
+ pci_read_config_byte(pcidev,0x85,&confval);
+ confval |= 0x2;
+ pci_write_config_byte (pcidev, 0x85,confval);
+ /* activate high speed bits */
+ outb(spcidx,confindex); /* set index */
+ val = (unsigned char) inb(confdata);
+ val |= 0xC0; /* both ports on high speed*/
+ outb (spcidx,confindex);
+ outb (val,confdata);
+ /*stop config*/
+ confval &= ~0x2;
+ pci_write_config_byte(pcidev, 0x85, confval);
+ spin_unlock_irq(&driver_lock);
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed enabled\n");
+ }
+ else {
+ printk (KERN_INFO "Couldn't locate VIA chipset\n");
+ return -ENODEV;
+ }
+ return 0;
+}
+
+static void __exit viahss_exit(void)
+{
+ struct pci_dev *pcidev = NULL;
+ unsigned char confval,val;
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ if (pcidev) {
+ spin_lock_irq(&driver_lock);
+ /* start config */
+ pci_read_config_byte(pcidev,0x85,&confval);
+ confval |= 0x2;
+ pci_write_config_byte (pcidev, 0x85,confval);
+ /* activate high speed bits */
+ outb(spcidx,confindex); /* set index */
+ val = (unsigned char) inb(confdata);
+ val &= ~0xC0; /* both ports off high speed*/
+ outb (spcidx,confindex);
+ outb (val,confdata);
+ /*stop config*/
+ confval &= ~0x2;
+ pci_write_config_byte(pcidev, 0x85, confval);
+ spin_unlock_irq(&driver_lock);
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed disabled\n");
+ }
+}
+
+module_init(viahss_init);
+module_exit(viahss_exit);
+MODULE_DESCRIPTION("VIA VT82C686[AB] high speed serial port enabler");
+MODULE_AUTHOR("Juhani Rautiainen <jrauti@iki.fi>");
@@ -1,20 +0,0 @@
--- linux-2.6.35-rc6-git-mnb0.1/3rdparty/viahss/viahss.c.orig 2010-07-30 21:17:30.000000000 +0300
+++ linux-2.6.35-rc6-git-mnb0.1/3rdparty/viahss/viahss.c 2010-07-30 23:10:21.324978822 +0300
@@ -25,7 +25,7 @@ static int __init viahss_init(void)
{
struct pci_dev *pcidev = NULL;
unsigned char confval,val;
- pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ pcidev = pci_get_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
if (pcidev) {
spin_lock_irq(&driver_lock);
/* start config */
@@ -55,7 +55,7 @@ static void __exit viahss_exit(void)
{
struct pci_dev *pcidev = NULL;
unsigned char confval,val;
- pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ pcidev = pci_get_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
if (pcidev) {
spin_lock_irq(&driver_lock);
/* start config */
@@ -1,19 +0,0 @@
fix build with 3.0
Signed-off-by: Thomas Backlund <tmb@mageia.org>
3rdparty/viahss/viahss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/3rdparty/viahss/viahss.c.orig 2011-07-15 02:37:27.000000000 +0300
+++ a/3rdparty/viahss/viahss.c 2011-07-15 13:48:13.204291256 +0300
@@ -19,7 +19,7 @@
const unsigned short confindex=0x3F0,confdata=0x3F1;
const unsigned char spcidx=0xEE;
-spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(driver_lock);
static int __init viahss_init(void)
{
@@ -1,16 +0,0 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:33:39.796256889 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:37:16.378970236 +0300
@@ -5,5 +5,6 @@ menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
source "3rdparty/rtl8812au/Kconfig"
source "3rdparty/rtl8723de/Kconfig"
+source "3rdparty/viahss/Kconfig"
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:33:57.608644657 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:37:39.711477814 +0300
@@ -4,3 +4,4 @@ obj- := 3rdparty.o # Dummy rule to forc
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
obj-$(CONFIG_RTL8812AU) += rtl8812au/
obj-$(CONFIG_RTL8723DE) += rtl8723de/
+obj-$(CONFIG_VIAHSS) += viahss/
@@ -1,18 +0,0 @@
linux/config.h is gone in 2.6.21
---
3rdparty/viahss/viahss.c | 1 0 + 1 - 0 !
1 files changed, 1 deletion(-)
Index: linux-2.6.21/3rdparty/viahss/viahss.c
===================================================================
--- linux-2.6.21.orig/3rdparty/viahss/viahss.c 2003-07-17 08:49:59.000000000 +0200
+++ linux-2.6.21/3rdparty/viahss/viahss.c 2007-05-14 17:06:56.000000000 +0200
@@ -12,7 +12,6 @@
*/
#include <linux/module.h>
-#include <linux/config.h>
#include <linux/version.h>
#include <linux/init.h>
#include <linux/pci.h>
@@ -1,7 +0,0 @@
--- linux-2.6.25/3rdparty/viahss/viahss.c.orig 2008-06-28 22:50:05.000000000 +0300
+++ linux-2.6.25/3rdparty/viahss/viahss.c 2008-06-29 14:26:55.000000000 +0300
@@ -80,3 +80,4 @@ module_init(viahss_init);
module_exit(viahss_exit);
MODULE_DESCRIPTION("VIA VT82C686[AB] high speed serial port enabler");
MODULE_AUTHOR("Juhani Rautiainen <jrauti@iki.fi>");
+MODULE_LICENSE("GPL");
@@ -1,37 +0,0 @@
From 84ecc2f6eb1cb12e6d44818f94fa49b50f06e6ac Mon Sep 17 00:00:00 2001
From: Gen Zhang <blackgod016574@gmail.com>
Date: Thu, 23 May 2019 08:34:52 +0800
Subject: consolemap: Fix a memory leaking bug in drivers/tty/vt/consolemap.c
In function con_insert_unipair(), when allocation for p2 and p1[n]
fails, ENOMEM is returned, but previously allocated p1 is not freed,
remains as leaking memory. Thus we should free p1 as well when this
allocation fails.
Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/vt/consolemap.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index b28aa0d289f8..79fcc96cc7c0 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -489,7 +489,11 @@ con_insert_unipair(struct uni_pagedir *p, u_short unicode, u_short fontpos)
p2 = p1[n = (unicode >> 6) & 0x1f];
if (!p2) {
p2 = p1[n] = kmalloc_array(64, sizeof(u16), GFP_KERNEL);
- if (!p2) return -ENOMEM;
+ if (!p2) {
+ kfree(p1);
+ p->uni_pgdir[n] = NULL;
+ return -ENOMEM;
+ }
memset(p2, 0xff, 64*sizeof(u16)); /* No glyphs for the characters (yet) */
}
--
cgit 1.2-0.3.lf.el7
@@ -1,305 +0,0 @@
From MAILER-DAEMON Wed Oct 14 16:34:37 2020
From: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
To: netdev@vger.kernel.org
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Thadeu Lima de Souza Cascardo <cascardo@canonical.com>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, "Alexander A. Klimov" <grandmaster@al2klimov.de>, Kees Cook <keescook@chromium.org>, Eric Dumazet <edumazet@google.com>, Alexey Kodanev <alexey.kodanev@oracle.com>, dccp@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] dccp: ccid: move timers to struct dccp_sock
Date: Tue, 13 Oct 2020 19:18:48 +0200
Message-Id: <20201013171849.236025-2-kleber.souza@canonical.com>
In-Reply-To: <20201013171849.236025-1-kleber.souza@canonical.com>
References: <20201013171849.236025-1-kleber.souza@canonical.com>
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
When dccps_hc_tx_ccid is freed, ccid timers may still trigger. The reason
del_timer_sync can't be used is because this relies on keeping a reference
to struct sock. But as we keep a pointer to dccps_hc_tx_ccid and free that
during disconnect, the timer should really belong to struct dccp_sock.
This addresses CVE-2020-16119.
Fixes: 839a6094140a (net: dccp: Convert timers to use timer_setup())
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-bd: Richard Sailer <richard_siegfried@systemli.org>
---
include/linux/dccp.h | 2 ++
net/dccp/ccids/ccid2.c | 32 +++++++++++++++++++-------------
net/dccp/ccids/ccid3.c | 30 ++++++++++++++++++++----------
3 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 07e547c02fd8..504afa1a4be6 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -259,6 +259,7 @@ struct dccp_ackvec;
* @dccps_sync_scheduled - flag which signals "send out-of-band message soon"
* @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets
* @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing)
+ * @dccps_ccid_timer - used by the CCIDs
* @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
*/
struct dccp_sock {
@@ -303,6 +304,7 @@ struct dccp_sock {
__u8 dccps_sync_scheduled:1;
struct tasklet_struct dccps_xmitlet;
struct timer_list dccps_xmit_timer;
+ struct timer_list dccps_ccid_timer;
};
static inline struct dccp_sock *dccp_sk(const struct sock *sk)
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 3da1f77bd039..dbca1f1e2449 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -126,21 +126,26 @@ static void dccp_tasklet_schedule(struct sock *sk)
static void ccid2_hc_tx_rto_expire(struct timer_list *t)
{
- struct ccid2_hc_tx_sock *hc = from_timer(hc, t, tx_rtotimer);
- struct sock *sk = hc->sk;
- const bool sender_was_blocked = ccid2_cwnd_network_limited(hc);
+ struct dccp_sock *dp = from_timer(dp, t, dccps_ccid_timer);
+ struct sock *sk = (struct sock *)dp;
+ struct ccid2_hc_tx_sock *hc;
+ bool sender_was_blocked;
bh_lock_sock(sk);
+
+ if (inet_sk_state_load(sk) == DCCP_CLOSED)
+ goto out;
+
+ hc = ccid_priv(dp->dccps_hc_tx_ccid);
+ sender_was_blocked = ccid2_cwnd_network_limited(hc);
+
if (sock_owned_by_user(sk)) {
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + HZ / 5);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + HZ / 5);
goto out;
}
ccid2_pr_debug("RTO_EXPIRE\n");
- if (sk->sk_state == DCCP_CLOSED)
- goto out;
-
/* back-off timer */
hc->tx_rto <<= 1;
if (hc->tx_rto > DCCP_RTO_MAX)
@@ -166,7 +171,7 @@ static void ccid2_hc_tx_rto_expire(struct timer_list *t)
if (sender_was_blocked)
dccp_tasklet_schedule(sk);
/* restart backed-off timer */
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
out:
bh_unlock_sock(sk);
sock_put(sk);
@@ -330,7 +335,7 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, unsigned int len)
}
#endif
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
do {
@@ -700,9 +705,9 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
/* restart RTO timer if not all outstanding data has been acked */
if (hc->tx_pipe == 0)
- sk_stop_timer(sk, &hc->tx_rtotimer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
else
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
done:
/* check if incoming Acks allow pending packets to be sent */
if (sender_was_blocked && !ccid2_cwnd_network_limited(hc))
@@ -737,17 +742,18 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
hc->tx_last_cong = hc->tx_lsndtime = hc->tx_cwnd_stamp = ccid2_jiffies32;
hc->tx_cwnd_used = 0;
hc->sk = sk;
- timer_setup(&hc->tx_rtotimer, ccid2_hc_tx_rto_expire, 0);
+ timer_setup(&dp->dccps_ccid_timer, ccid2_hc_tx_rto_expire, 0);
INIT_LIST_HEAD(&hc->tx_av_chunks);
return 0;
}
static void ccid2_hc_tx_exit(struct sock *sk)
{
+ struct dccp_sock *dp = dccp_sk(sk);
struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk);
int i;
- sk_stop_timer(sk, &hc->tx_rtotimer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
for (i = 0; i < hc->tx_seqbufc; i++)
kfree(hc->tx_seqbuf[i]);
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index b9ee1a4a8955..685f4d046c0d 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -184,17 +184,24 @@ static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hc,
static void ccid3_hc_tx_no_feedback_timer(struct timer_list *t)
{
- struct ccid3_hc_tx_sock *hc = from_timer(hc, t, tx_no_feedback_timer);
- struct sock *sk = hc->sk;
+ struct dccp_sock *dp = from_timer(dp, t, dccps_ccid_timer);
+ struct ccid3_hc_tx_sock *hc;
+ struct sock *sk = (struct sock *)dp;
unsigned long t_nfb = USEC_PER_SEC / 5;
bh_lock_sock(sk);
+
+ if (inet_sk_state_load(sk) == DCCP_CLOSED)
+ goto out;
+
if (sock_owned_by_user(sk)) {
/* Try again later. */
/* XXX: set some sensible MIB */
goto restart_timer;
}
+ hc = ccid_priv(dp->dccps_hc_tx_ccid);
+
ccid3_pr_debug("%s(%p, state=%s) - entry\n", dccp_role(sk), sk,
ccid3_tx_state_name(hc->tx_state));
@@ -250,8 +257,8 @@ static void ccid3_hc_tx_no_feedback_timer(struct timer_list *t)
t_nfb = max(hc->tx_t_rto, 2 * hc->tx_t_ipi);
restart_timer:
- sk_reset_timer(sk, &hc->tx_no_feedback_timer,
- jiffies + usecs_to_jiffies(t_nfb));
+ sk_reset_timer(sk, &dp->dccps_ccid_timer,
+ jiffies + usecs_to_jiffies(t_nfb));
out:
bh_unlock_sock(sk);
sock_put(sk);
@@ -280,7 +287,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
return -EBADMSG;
if (hc->tx_state == TFRC_SSTATE_NO_SENT) {
- sk_reset_timer(sk, &hc->tx_no_feedback_timer, (jiffies +
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, (jiffies +
usecs_to_jiffies(TFRC_INITIAL_TIMEOUT)));
hc->tx_last_win_count = 0;
hc->tx_t_last_win_count = now;
@@ -354,6 +361,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, unsigned int len)
static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
{
struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk);
+ struct dccp_sock *dp = dccp_sk(sk);
struct tfrc_tx_hist_entry *acked;
ktime_t now;
unsigned long t_nfb;
@@ -420,7 +428,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
(unsigned int)(hc->tx_x >> 6));
/* unschedule no feedback timer */
- sk_stop_timer(sk, &hc->tx_no_feedback_timer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
/*
* As we have calculated new ipi, delta, t_nom it is possible
@@ -445,8 +453,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
"expire in %lu jiffies (%luus)\n",
dccp_role(sk), sk, usecs_to_jiffies(t_nfb), t_nfb);
- sk_reset_timer(sk, &hc->tx_no_feedback_timer,
- jiffies + usecs_to_jiffies(t_nfb));
+ sk_reset_timer(sk, &dp->dccps_ccid_timer,
+ jiffies + usecs_to_jiffies(t_nfb));
}
static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
@@ -488,21 +496,23 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk)
{
+ struct dccp_sock *dp = dccp_sk(sk);
struct ccid3_hc_tx_sock *hc = ccid_priv(ccid);
hc->tx_state = TFRC_SSTATE_NO_SENT;
hc->tx_hist = NULL;
hc->sk = sk;
- timer_setup(&hc->tx_no_feedback_timer,
+ timer_setup(&dp->dccps_ccid_timer,
ccid3_hc_tx_no_feedback_timer, 0);
return 0;
}
static void ccid3_hc_tx_exit(struct sock *sk)
{
+ struct dccp_sock *dp = dccp_sk(sk);
struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk);
- sk_stop_timer(sk, &hc->tx_no_feedback_timer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
tfrc_tx_hist_purge(&hc->tx_hist);
}
--
2.25.1
From MAILER-DAEMON Wed Oct 14 16:34:37 2020
From: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
To: netdev@vger.kernel.org
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Thadeu Lima de Souza Cascardo <cascardo@canonical.com>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, "Alexander A. Klimov" <grandmaster@al2klimov.de>, Kees Cook <keescook@chromium.org>, Eric Dumazet <edumazet@google.com>, Alexey Kodanev <alexey.kodanev@oracle.com>, dccp@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] Revert "dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect()"
Date: Tue, 13 Oct 2020 19:18:49 +0200
Message-Id: <20201013171849.236025-3-kleber.souza@canonical.com>
In-Reply-To: <20201013171849.236025-1-kleber.souza@canonical.com>
References: <20201013171849.236025-1-kleber.souza@canonical.com>
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
This reverts commit 2677d20677314101293e6da0094ede7b5526d2b1.
This fixes an issue that after disconnect, dccps_hc_tx_ccid will still be
kept, allowing the socket to be reused as a listener socket, and the cloned
socket will free its dccps_hc_tx_ccid, leading to a later use after free,
when the listener socket is closed.
This addresses CVE-2020-16119.
Fixes: 2677d2067731 (dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect())
Reported-by: Hadar Manor
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Richard Sailer <richard_siegfried@systemli.org>
---
net/dccp/proto.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 6d705d90c614..359e848dba6c 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -279,7 +279,9 @@ int dccp_disconnect(struct sock *sk, int flags)
dccp_clear_xmit_timers(sk);
ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
+ ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
dp->dccps_hc_rx_ccid = NULL;
+ dp->dccps_hc_tx_ccid = NULL;
__skb_queue_purge(&sk->sk_receive_queue);
__skb_queue_purge(&sk->sk_write_queue);
--
2.25.1
@@ -0,0 +1,33 @@
From 894c792e3e24c2c15d8aac15aa89ec144468e1b0 Mon Sep 17 00:00:00 2001
From: Palmer Dabbelt <palmer@rivosinc.com>
Date: Thu, 13 Oct 2022 14:46:36 -0700
Subject: [PATCH 2/6] MAINTAINERS: git://github -> https://github.com for
terrelln
Github deprecated the git:// links about a year ago, so let's move to
the https:// URLs instead.
Reported-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://github.blog/2021-09-01-improving-git-protocol-security-github/
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Nick Terrell <terrelln@fb.com>
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index e04d944005ba..4a2b7a9325dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22800,7 +22800,7 @@ ZSTD
M: Nick Terrell <terrelln@fb.com>
S: Maintained
B: https://github.com/facebook/zstd/issues
-T: git git://github.com/terrelln/linux.git
+T: git https://github.com/terrelln/linux.git
F: include/linux/zstd*
F: lib/zstd/
F: lib/decompress_unzstd.c
--
2.30.6
@@ -1,24 +0,0 @@
Allow aufs to be built as module.
Signed-off-by: Thomas Backlund <tmb@mageia.org>
--- a/fs/aufs/Kconfig
+++ b/fs/aufs/Kconfig
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
config AUFS_FS
- bool "Aufs (Advanced multi layered unification filesystem) support"
+ tristate "Aufs (Advanced multi layered unification filesystem) support"
help
Aufs is a stackable unification filesystem such as Unionfs,
which unifies several directories and provides a merged single
@@ -72,7 +72,7 @@ endchoice
config AUFS_EXPORT
bool "NFS-exportable aufs"
- depends on EXPORTFS = y
+ depends on EXPORTFS
help
If you want to export your mounted aufs via NFS, then enable this
option. There are several requirements for this configuration.
File diff suppressed because it is too large Load Diff
@@ -1,260 +0,0 @@
fs/dcache.c | 2 ++
fs/exec.c | 1 +
fs/fcntl.c | 1 +
fs/file_table.c | 2 ++
fs/namespace.c | 3 +++
fs/notify/group.c | 1 +
fs/open.c | 1 +
fs/read_write.c | 2 ++
fs/splice.c | 2 ++
fs/xattr.c | 1 +
kernel/locking/lockdep.c | 1 +
kernel/task_work.c | 1 +
security/security.c | 8 ++++++++
13 files changed, 26 insertions(+)
diff -Nurp linux-5.15.37-aufs/fs/dcache.c linux-5.15.37-aufs-mod/fs/dcache.c
--- linux-5.15.37-aufs/fs/dcache.c 2022-04-08 20:22:30.617616719 +0300
+++ linux-5.15.37-aufs-mod/fs/dcache.c 2022-04-08 20:24:23.624148779 +0300
@@ -1450,6 +1450,7 @@ rename_retry:
seq = 1;
goto again;
}
+EXPORT_SYMBOL_GPL(d_walk);
struct check_mount {
struct vfsmount *mnt;
@@ -2995,6 +2996,7 @@ void d_exchange(struct dentry *dentry1,
write_sequnlock(&rename_lock);
}
+EXPORT_SYMBOL_GPL(d_exchange);
/**
* d_ancestor - search for an ancestor
diff -Nurp linux-5.15.37-aufs/fs/exec.c linux-5.15.37-aufs-mod/fs/exec.c
--- linux-5.15.37-aufs/fs/exec.c 2022-04-08 20:07:30.690498863 +0300
+++ linux-5.15.37-aufs-mod/fs/exec.c 2022-04-08 20:24:23.624148779 +0300
@@ -112,6 +112,7 @@ bool path_noexec(const struct path *path
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
}
+EXPORT_SYMBOL_GPL(path_noexec);
#ifdef CONFIG_USELIB
/*
diff -Nurp linux-5.15.37-aufs/fs/fcntl.c linux-5.15.37-aufs-mod/fs/fcntl.c
--- linux-5.15.37-aufs/fs/fcntl.c 2022-04-08 20:22:30.617616719 +0300
+++ linux-5.15.37-aufs-mod/fs/fcntl.c 2022-04-08 20:24:23.624148779 +0300
@@ -86,6 +86,7 @@ int setfl(int fd, struct file *filp, uns
out:
return error;
}
+EXPORT_SYMBOL_GPL(setfl);
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
int force)
diff -Nurp linux-5.15.37-aufs/fs/file_table.c linux-5.15.37-aufs-mod/fs/file_table.c
--- linux-5.15.37-aufs/fs/file_table.c 2022-03-20 22:14:17.000000000 +0200
+++ linux-5.15.37-aufs-mod/fs/file_table.c 2022-04-08 20:24:23.624148779 +0300
@@ -198,6 +198,7 @@ over:
}
return ERR_PTR(-ENFILE);
}
+EXPORT_SYMBOL_GPL(alloc_empty_file);
/*
* Variant of alloc_empty_file() that doesn't check and modify nr_files.
@@ -412,6 +413,7 @@ void __fput_sync(struct file *file)
}
EXPORT_SYMBOL(fput);
+EXPORT_SYMBOL_GPL(__fput_sync);
void __init files_init(void)
{
diff -Nurp linux-5.15.37-aufs/fs/namespace.c linux-5.15.37-aufs-mod/fs/namespace.c
--- linux-5.15.37-aufs/fs/namespace.c 2022-04-08 20:22:30.617616719 +0300
+++ linux-5.15.37-aufs-mod/fs/namespace.c 2022-04-08 20:24:23.624148779 +0300
@@ -440,6 +440,7 @@ void __mnt_drop_write(struct vfsmount *m
mnt_dec_writers(real_mount(mnt));
preempt_enable();
}
+EXPORT_SYMBOL_GPL(__mnt_drop_write);
/**
* mnt_drop_write - give up write access to a mount
@@ -844,6 +845,7 @@ int is_current_mnt_ns(struct vfsmount *m
{
return check_mnt(real_mount(mnt));
}
+EXPORT_SYMBOL_GPL(is_current_mnt_ns);
/*
* vfsmount lock must be held for write
@@ -2047,6 +2049,7 @@ int iterate_mounts(int (*f)(struct vfsmo
}
return 0;
}
+EXPORT_SYMBOL_GPL(iterate_mounts);
static void lock_mnt_tree(struct mount *mnt)
{
diff -Nurp linux-5.15.37-aufs/fs/notify/group.c linux-5.15.37-aufs-mod/fs/notify/group.c
--- linux-5.15.37-aufs/fs/notify/group.c 2022-03-20 22:14:17.000000000 +0200
+++ linux-5.15.37-aufs-mod/fs/notify/group.c 2022-04-08 20:24:23.624148779 +0300
@@ -100,6 +100,7 @@ void fsnotify_get_group(struct fsnotify_
{
refcount_inc(&group->refcnt);
}
+EXPORT_SYMBOL_GPL(fsnotify_get_group);
/*
* Drop a reference to a group. Free it if it's through.
diff -Nurp linux-5.15.37-aufs/fs/open.c linux-5.15.37-aufs-mod/fs/open.c
--- linux-5.15.37-aufs/fs/open.c 2022-03-20 22:14:17.000000000 +0200
+++ linux-5.15.37-aufs-mod/fs/open.c 2022-04-08 20:24:23.625148828 +0300
@@ -66,6 +66,7 @@ int do_truncate(struct user_namespace *m
inode_unlock(dentry->d_inode);
return ret;
}
+EXPORT_SYMBOL_GPL(do_truncate);
long vfs_truncate(const struct path *path, loff_t length)
{
diff -Nurp linux-5.15.37-aufs/fs/read_write.c linux-5.15.37-aufs-mod/fs/read_write.c
--- linux-5.15.37-aufs/fs/read_write.c 2022-03-20 22:14:17.000000000 +0200
+++ linux-5.15.37-aufs-mod/fs/read_write.c 2022-04-08 20:24:23.625148828 +0300
@@ -488,6 +488,7 @@ ssize_t vfs_read(struct file *file, char
inc_syscr(current);
return ret;
}
+EXPORT_SYMBOL_GPL(vfs_read);
static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
{
@@ -598,6 +599,7 @@ ssize_t vfs_write(struct file *file, con
file_end_write(file);
return ret;
}
+EXPORT_SYMBOL_GPL(vfs_write);
/* file_ppos returns &file->f_pos or NULL if file is stream */
static inline loff_t *file_ppos(struct file *file)
diff -Nurp linux-5.15.37-aufs/fs/splice.c linux-5.15.37-aufs-mod/fs/splice.c
--- linux-5.15.37-aufs/fs/splice.c 2022-04-08 20:22:30.617616719 +0300
+++ linux-5.15.37-aufs-mod/fs/splice.c 2022-04-08 20:24:23.625148828 +0300
@@ -766,6 +766,7 @@ long do_splice_from(struct pipe_inode_in
return warn_unsupported(out, "write");
return out->f_op->splice_write(pipe, out, ppos, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_from);
/*
* Attempt to initiate a splice from a file to a pipe.
@@ -795,6 +796,7 @@ long do_splice_to(struct file *in, loff_
return warn_unsupported(in, "read");
return in->f_op->splice_read(in, ppos, pipe, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_to);
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff -Nurp linux-5.15.37-aufs/fs/xattr.c linux-5.15.37-aufs-mod/fs/xattr.c
--- linux-5.15.37-aufs/fs/xattr.c 2022-03-20 22:14:17.000000000 +0200
+++ linux-5.15.37-aufs-mod/fs/xattr.c 2022-04-08 20:24:23.625148828 +0300
@@ -384,6 +384,7 @@ vfs_getxattr_alloc(struct user_namespace
*xattr_value = value;
return error;
}
+EXPORT_SYMBOL_GPL(vfs_getxattr_alloc);
ssize_t
__vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,
diff -Nurp linux-5.15.37-aufs/kernel/locking/lockdep.c linux-5.15.37-aufs-mod/kernel/locking/lockdep.c
--- linux-5.15.37-aufs/kernel/locking/lockdep.c 2022-04-08 20:22:30.619616817 +0300
+++ linux-5.15.37-aufs-mod/kernel/locking/lockdep.c 2022-04-08 20:24:23.625148828 +0300
@@ -208,6 +208,7 @@ inline struct lock_class *lockdep_hlock_
*/
return lock_classes + class_idx;
}
+EXPORT_SYMBOL_GPL(lockdep_hlock_class);
#define hlock_class(hlock) lockdep_hlock_class(hlock)
#ifdef CONFIG_LOCK_STAT
diff -Nurp linux-5.15.37-aufs/kernel/task_work.c linux-5.15.37-aufs-mod/kernel/task_work.c
--- linux-5.15.37-aufs/kernel/task_work.c 2022-03-20 22:14:17.000000000 +0200
+++ linux-5.15.37-aufs-mod/kernel/task_work.c 2022-04-08 20:24:23.625148828 +0300
@@ -167,3 +167,4 @@ void task_work_run(void)
} while (work);
}
}
+EXPORT_SYMBOL_GPL(task_work_run);
diff -Nurp linux-5.15.37-aufs/security/security.c linux-5.15.37-aufs-mod/security/security.c
--- linux-5.15.37-aufs/security/security.c 2022-04-08 20:07:30.718500239 +0300
+++ linux-5.15.37-aufs-mod/security/security.c 2022-04-08 20:24:23.626148877 +0300
@@ -1164,6 +1164,7 @@ int security_path_rmdir(const struct pat
return 0;
return call_int_hook(path_rmdir, 0, dir, dentry);
}
+EXPORT_SYMBOL_GPL(security_path_rmdir);
int security_path_unlink(const struct path *dir, struct dentry *dentry)
{
@@ -1180,6 +1181,7 @@ int security_path_symlink(const struct p
return 0;
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
}
+EXPORT_SYMBOL_GPL(security_path_symlink);
int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
struct dentry *new_dentry)
@@ -1188,6 +1190,7 @@ int security_path_link(struct dentry *ol
return 0;
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
}
+EXPORT_SYMBOL_GPL(security_path_link);
int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
const struct path *new_dir, struct dentry *new_dentry,
@@ -1215,6 +1218,7 @@ int security_path_truncate(const struct
return 0;
return call_int_hook(path_truncate, 0, path);
}
+EXPORT_SYMBOL_GPL(security_path_truncate);
int security_path_chmod(const struct path *path, umode_t mode)
{
@@ -1222,6 +1226,7 @@ int security_path_chmod(const struct pat
return 0;
return call_int_hook(path_chmod, 0, path, mode);
}
+EXPORT_SYMBOL_GPL(security_path_chmod);
int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
{
@@ -1229,6 +1234,7 @@ int security_path_chown(const struct pat
return 0;
return call_int_hook(path_chown, 0, path, uid, gid);
}
+EXPORT_SYMBOL_GPL(security_path_chown);
int security_path_chroot(const struct path *path)
{
@@ -1329,6 +1335,7 @@ int security_inode_permission(struct ino
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
+EXPORT_SYMBOL_GPL(security_inode_permission);
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
@@ -1526,6 +1533,7 @@ int security_file_permission(struct file
return fsnotify_perm(file, mask);
}
+EXPORT_SYMBOL_GPL(security_file_permission);
int security_file_alloc(struct file *file)
{
@@ -1,24 +0,0 @@
Allow aufs to be built as module.
Signed-off-by: Thomas Backlund <tmb@mageia.org>
--- a/fs/aufs/Kconfig
+++ b/fs/aufs/Kconfig
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
config AUFS_FS
- bool "Aufs (Advanced multi layered unification filesystem) support"
+ tristate "Aufs (Advanced multi layered unification filesystem) support"
help
Aufs is a stackable unification filesystem such as Unionfs,
which unifies several directories and provides a merged single
@@ -72,7 +72,7 @@ endchoice
config AUFS_EXPORT
bool "NFS-exportable aufs"
- depends on EXPORTFS = y
+ depends on EXPORTFS
help
If you want to export your mounted aufs via NFS, then enable this
option. There are several requirements for this configuration.
@@ -1,36 +0,0 @@
From 435664ed44c4a17e6715d007061e2b155d3535c8 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 1 Oct 2021 13:38:15 +1000
Subject: procfs: do not list TID 0 in /proc/<pid>/task
If a task exits concurrently, task_pid_nr_ns may return 0.
Link: https://lkml.kernel.org/r/8735pn5dx7.fsf@oldenburg.str.redhat.com
Signed-off-by: Florian Weimer <fweimer@redhat.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
fs/proc/base.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 533d5836eb9a4..54f29399088f0 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3800,6 +3800,9 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx)
char name[10 + 1];
unsigned int len;
tid = task_pid_nr_ns(task, ns);
+ if (!tid)
+ /* The task has just exited. */
+ continue;
len = snprintf(name, sizeof(name), "%u", tid);
if (!proc_fill_cache(file, ctx, name, len,
proc_task_instantiate, task, NULL)) {
--
cgit 1.2.3-1.el7
@@ -0,0 +1,17 @@
tools/tracing/rtla/Makefile | 5 -----
1 file changed, 5 deletions(-)
--- linux-6.1/tools/tracing/rtla/Makefile.orig
+++ linux-6.1/tools/tracing/rtla/Makefile
@@ -124,11 +124,6 @@ install: doc_install
.PHONY: clean tarball
clean: doc_clean
- @test ! -f rtla || rm rtla
- @test ! -f rtla-static || rm rtla-static
- @test ! -f src/rtla.o || rm src/rtla.o
- @test ! -f $(TARBALL) || rm -f $(TARBALL)
- @rm -rf *~ $(OBJ) *.tar.$(CEXT)
tarball: clean
rm -rf $(NAME)-$(VERSION) && mkdir $(NAME)-$(VERSION)
@@ -0,0 +1,42 @@
From: Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>
Subject: [PATCH] iwlwifi: cfg: Add missing MODULE_FIRMWARE() for *.pnvm
Date: Wed, 5 Apr 2023 08:35:46 +0200
A few models require *.pnvm files while we don't declare them via
MODULE_FIRMWARE(). This resulted in the breakage of WiFi on the
system that relies on the information from modinfo (e.g. openSUSE
installer image).
This patch adds those missing MODULE_FIRMWARE() entries for *.pnvm
files.
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1207553
Signed-off-by: Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>
---
The fix is obviously ad hoc.
Here I added the lines with the explicit string since *_PRE definition
contains the tailing dash and can't be used for *.pnvm file.
Alternatively, we may put a single line
MODULE_FIRMWARE("iwlwifi-*.pnvm");
to catch all, too.
drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
index 3bdd6774716d..3c6dc3601784 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
@@ -1065,3 +1065,7 @@ MODULE_FIRMWARE(IWL_BNJ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
MODULE_FIRMWARE(IWL_BZ_A_FM4_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
MODULE_FIRMWARE(IWL_GL_B_FM_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
MODULE_FIRMWARE(IWL_BNJ_B_FM_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
+
+MODULE_FIRMWARE("iwlwifi-so-a0-gf4-a0.pnvm");
+MODULE_FIRMWARE("iwlwifi-so-a0-gf-a0.pnvm");
+MODULE_FIRMWARE("iwlwifi-ty-a0-gf-a0.pnvm");
--
2.35.3
@@ -0,0 +1,29 @@
From 19d7df98472851e1d2d11e00c177988d0f49683d Mon Sep 17 00:00:00 2001
From: Xin Gao <gaoxin@cdjrlc.com>
Date: Mon, 17 Oct 2022 15:18:59 -0700
Subject: [PATCH 4/6] lib: zstd: Fix comment typo
The double `when' is duplicated in line 999, remove one.
Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
Signed-off-by: Nick Terrell <terrelln@fb.com>
---
lib/zstd/decompress/zstd_decompress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/zstd/decompress/zstd_decompress.c b/lib/zstd/decompress/zstd_decompress.c
index b4d81d84479a..6928e85f9d19 100644
--- a/lib/zstd/decompress/zstd_decompress.c
+++ b/lib/zstd/decompress/zstd_decompress.c
@@ -996,7 +996,7 @@ size_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t sr
size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx) { return dctx->expected; }
/*
- * Similar to ZSTD_nextSrcSizeToDecompress(), but when when a block input can be streamed,
+ * Similar to ZSTD_nextSrcSizeToDecompress(), but when a block input can be streamed,
* we allow taking a partial block as the input. Currently only raw uncompressed blocks can
* be streamed.
*
--
2.30.6
@@ -0,0 +1,38 @@
From 88a309465b3f05a100c3b81966982c0f9f5d23a6 Mon Sep 17 00:00:00 2001
From: Tom Rix <trix@redhat.com>
Date: Thu, 20 Jan 2022 05:20:06 -0800
Subject: [PATCH 1/6] lib: zstd: clean up double word in comment.
Remove the second 'a' and 'into'.
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Nick Terrell <terrelln@fb.com>
---
include/linux/zstd_lib.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/zstd_lib.h b/include/linux/zstd_lib.h
index b8c7dbf98390..6b91758b61af 100644
--- a/include/linux/zstd_lib.h
+++ b/include/linux/zstd_lib.h
@@ -1330,7 +1330,7 @@ ZSTDLIB_API size_t ZSTD_generateSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs,
/*! ZSTD_mergeBlockDelimiters() :
* Given an array of ZSTD_Sequence, remove all sequences that represent block delimiters/last literals
- * by merging them into into the literals of the next sequence.
+ * by merging them into the literals of the next sequence.
*
* As such, the final generated result has no explicit representation of block boundaries,
* and the final last literals segment is not represented in the sequences.
@@ -1377,7 +1377,7 @@ ZSTDLIB_API size_t ZSTD_compressSequences(ZSTD_CCtx* const cctx, void* dst, size
/*! ZSTD_writeSkippableFrame() :
* Generates a zstd skippable frame containing data given by src, and writes it to dst buffer.
*
- * Skippable frames begin with a a 4-byte magic number. There are 16 possible choices of magic number,
+ * Skippable frames begin with a 4-byte magic number. There are 16 possible choices of magic number,
* ranging from ZSTD_MAGIC_SKIPPABLE_START to ZSTD_MAGIC_SKIPPABLE_START+15.
* As such, the parameter magicVariant controls the exact skippable frame magic number variant used, so
* the magic number used will be ZSTD_MAGIC_SKIPPABLE_START + magicVariant.
--
2.30.6
@@ -0,0 +1,29 @@
From 7486f5c6e7b197400678f1bb603ac9e4027fb830 Mon Sep 17 00:00:00 2001
From: Jilin Yuan <yuanjilin@cdjrlc.com>
Date: Fri, 2 Sep 2022 09:32:12 +0800
Subject: [PATCH 3/6] lib: zstd: fix repeated words in comments
Delete the redundant word 'the'.
Signed-off-by: Jilin Yuan <yuanjilin@cdjrlc.com>
Signed-off-by: Nick Terrell <terrelln@fb.com>
---
lib/zstd/compress/zstd_compress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/zstd/compress/zstd_compress.c b/lib/zstd/compress/zstd_compress.c
index a4e916008b3a..73fff4c60149 100644
--- a/lib/zstd/compress/zstd_compress.c
+++ b/lib/zstd/compress/zstd_compress.c
@@ -4441,7 +4441,7 @@ static size_t ZSTD_validateSequence(U32 offCode, U32 matchLength,
size_t posInSrc, U32 windowLog, size_t dictSize, U32 minMatch) {
size_t offsetBound;
U32 windowSize = 1 << windowLog;
- /* posInSrc represents the amount of data the the decoder would decode up to this point.
+ /* posInSrc represents the amount of data the decoder would decode up to this point.
* As long as the amount of data decoded is less than or equal to window size, offsets may be
* larger than the total length of output decoded in order to reference the dict, even larger than
* window size. After output surpasses windowSize, we're limited to windowSize offsets again.
--
2.30.6
@@ -0,0 +1,31 @@
From: Alex Hung <alex.hung-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Subject: [PATCH] iwlwifi: add new pci id for 6235
Date: Mon, 22 Mar 2021 01:11:21 -0600
lspci output:
Network controller [0280]: Intel Corporation Centrino Advanced-N6235
[8086:088f] (rev 24)
Subsystem: Intel Corporation Centrino Advanced-N 6235 [8086:526a]
Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Alex Hung <alex.hung-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index ffaf973..f85fe36 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -200,6 +200,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
{IWL_PCI_DEVICE(0x088E, 0x446A, iwl6035_2agn_sff_cfg)},
{IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)},
{IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)},
+ {IWL_PCI_DEVICE(0x088F, 0x526A, iwl6035_2agn_cfg)},
/* 105 Series */
{IWL_PCI_DEVICE(0x0894, 0x0022, iwl105_bgn_cfg)},
--
2.7.4
File diff suppressed because it is too large Load Diff
@@ -1,74 +0,0 @@
From c1afb26727d9e507d3e17a9890e7aaf7fc85cd55 Mon Sep 17 00:00:00 2001
From: Po-Hao Huang <phhuang@realtek.com>
Date: Fri, 17 Dec 2021 09:27:08 +0800
Subject: rtw88: 8822c: update rx settings to prevent potential hw deadlock
These settings enables mac to detect and recover when rx fifo
circuit deadlock occurs. Previous version missed this, so we fix it.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211217012708.8623-1-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/main.c | 2 +-
drivers/net/wireless/realtek/rtw88/rtw8821c.h | 2 +-
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 2 +-
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 78fcbc20942db..274e0af959177 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1869,7 +1869,7 @@ int rtw_core_init(struct rtw_dev *rtwdev)
/* default rx filter setting */
rtwdev->hal.rcr = BIT_APP_FCS | BIT_APP_MIC | BIT_APP_ICV |
- BIT_HTC_LOC_CTRL | BIT_APP_PHYSTS |
+ BIT_PKTCTL_DLEN | BIT_HTC_LOC_CTRL | BIT_APP_PHYSTS |
BIT_AB | BIT_AM | BIT_APM;
ret = rtw_load_firmware(rtwdev, RTW_NORMAL_FW);
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.h b/drivers/net/wireless/realtek/rtw88/rtw8821c.h
index 112faa60f653e..d9fbddd7b0f35 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.h
@@ -131,7 +131,7 @@ _rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data)
#define WLAN_TX_FUNC_CFG2 0x30
#define WLAN_MAC_OPT_NORM_FUNC1 0x98
#define WLAN_MAC_OPT_LB_FUNC1 0x80
-#define WLAN_MAC_OPT_FUNC2 0x30810041
+#define WLAN_MAC_OPT_FUNC2 0xb0810041
#define WLAN_SIFS_CFG (WLAN_SIFS_CCK_CONT_TX | \
(WLAN_SIFS_OFDM_CONT_TX << BIT_SHIFT_SIFS_OFDM_CTX) | \
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
index a4cbcc6bdcd14..dd4fbb82750d5 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -205,7 +205,7 @@ static void rtw8822b_phy_set_param(struct rtw_dev *rtwdev)
#define WLAN_TX_FUNC_CFG2 0x30
#define WLAN_MAC_OPT_NORM_FUNC1 0x98
#define WLAN_MAC_OPT_LB_FUNC1 0x80
-#define WLAN_MAC_OPT_FUNC2 0x30810041
+#define WLAN_MAC_OPT_FUNC2 0xb0810041
#define WLAN_SIFS_CFG (WLAN_SIFS_CCK_CONT_TX | \
(WLAN_SIFS_OFDM_CONT_TX << BIT_SHIFT_SIFS_OFDM_CTX) | \
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
index a8b95dcdb8e90..e01d61b5d104b 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -1962,7 +1962,7 @@ static void rtw8822c_phy_set_param(struct rtw_dev *rtwdev)
#define WLAN_TX_FUNC_CFG2 0x30
#define WLAN_MAC_OPT_NORM_FUNC1 0x98
#define WLAN_MAC_OPT_LB_FUNC1 0x80
-#define WLAN_MAC_OPT_FUNC2 0x30810041
+#define WLAN_MAC_OPT_FUNC2 0xb0810041
#define WLAN_MAC_INT_MIG_CFG 0x33330000
#define WLAN_SIFS_CFG (WLAN_SIFS_CCK_CONT_TX | \
--
cgit 1.2.3-1.el7
@@ -0,0 +1,14 @@
Replace 3rdparty 8723de driver by the new rtw88 driver.
Add a module alias to keep upgrade path.
Signed-off-by: Thomas Backlund <tmb@mageia.org>
--- a/drivers/net/wireless/realtek/rtw88/rtw8723de.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723de.c
@@ -28,3 +28,4 @@ module_pci_driver(rtw_8723de_driver);
MODULE_AUTHOR("Realtek Corporation");
MODULE_DESCRIPTION("Realtek 802.11n wireless 8723de driver");
MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("8723de");
@@ -1,143 +0,0 @@
From a3fd1f9aa79a7d3885faa486acb02c838533f332 Mon Sep 17 00:00:00 2001
From: Chin-Yen Lee <timlee@realtek.com>
Date: Fri, 17 Dec 2021 09:24:21 +0800
Subject: rtw88: don't check CRC of VHT-SIG-B in 802.11ac signal
Currently all realtek wifi chip is set to check CRC of VHT-SIG-B
in 802.11ac signal, but some AP don't calculate the CRC and packets
from these AP can't be received and lead to disconnection.
We disable the check defaultly to avoid this case.
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211217012421.7859-1-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/bf.c | 14 +++++++++-----
drivers/net/wireless/realtek/rtw88/bf.h | 7 +++++--
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 3 ++-
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 2 ++
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 2 ++
5 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/bf.c b/drivers/net/wireless/realtek/rtw88/bf.c
index aff70e4ae0288..df750b3a35e9d 100644
--- a/drivers/net/wireless/realtek/rtw88/bf.c
+++ b/drivers/net/wireless/realtek/rtw88/bf.c
@@ -130,7 +130,8 @@ void rtw_bf_cfg_sounding(struct rtw_dev *rtwdev, struct rtw_vif *vif,
BIT_WMAC_USE_NDPARATE |
(csi_rsc << 13);
- rtw_write8(rtwdev, REG_SND_PTCL_CTRL, RTW_SND_CTRL_SOUNDING);
+ rtw_write8_mask(rtwdev, REG_SND_PTCL_CTRL, BIT_MASK_BEAMFORM,
+ RTW_SND_CTRL_SOUNDING);
rtw_write8(rtwdev, REG_SND_PTCL_CTRL + 3, 0x26);
rtw_write8_clr(rtwdev, REG_RXFLTMAP1, BIT_RXFLTMAP1_BF_REPORT_POLL);
rtw_write8_clr(rtwdev, REG_RXFLTMAP4, BIT_RXFLTMAP4_BF_REPORT_POLL);
@@ -177,7 +178,7 @@ void rtw_bf_del_bfer_entry_mu(struct rtw_dev *rtwdev)
void rtw_bf_del_sounding(struct rtw_dev *rtwdev)
{
- rtw_write8(rtwdev, REG_SND_PTCL_CTRL, 0);
+ rtw_write8_mask(rtwdev, REG_SND_PTCL_CTRL, BIT_MASK_BEAMFORM, 0);
}
void rtw_bf_enable_bfee_su(struct rtw_dev *rtwdev, struct rtw_vif *vif,
@@ -204,7 +205,8 @@ void rtw_bf_enable_bfee_su(struct rtw_dev *rtwdev, struct rtw_vif *vif,
}
/* Sounding protocol control */
- rtw_write8(rtwdev, REG_SND_PTCL_CTRL, RTW_SND_CTRL_SOUNDING);
+ rtw_write8_mask(rtwdev, REG_SND_PTCL_CTRL, BIT_MASK_BEAMFORM,
+ RTW_SND_CTRL_SOUNDING);
/* MAC address/Partial AID of Beamformer */
for (i = 0; i < ETH_ALEN; i++)
@@ -273,7 +275,8 @@ void rtw_bf_remove_bfee_su(struct rtw_dev *rtwdev,
struct rtw_bf_info *bfinfo = &rtwdev->bf_info;
rtw_dbg(rtwdev, RTW_DBG_BF, "remove as a su bfee\n");
- rtw_write8(rtwdev, REG_SND_PTCL_CTRL, RTW_SND_CTRL_REMOVE);
+ rtw_write8_mask(rtwdev, REG_SND_PTCL_CTRL, BIT_MASK_BEAMFORM,
+ RTW_SND_CTRL_REMOVE);
switch (bfee->su_reg_index) {
case 0:
@@ -298,7 +301,8 @@ void rtw_bf_remove_bfee_mu(struct rtw_dev *rtwdev,
{
struct rtw_bf_info *bfinfo = &rtwdev->bf_info;
- rtw_write8(rtwdev, REG_SND_PTCL_CTRL, RTW_SND_CTRL_REMOVE);
+ rtw_write8_mask(rtwdev, REG_SND_PTCL_CTRL, BIT_MASK_BEAMFORM,
+ RTW_SND_CTRL_REMOVE);
rtw_bf_del_bfer_entry_mu(rtwdev);
diff --git a/drivers/net/wireless/realtek/rtw88/bf.h b/drivers/net/wireless/realtek/rtw88/bf.h
index 17855edb5006a..7b40c2c038560 100644
--- a/drivers/net/wireless/realtek/rtw88/bf.h
+++ b/drivers/net/wireless/realtek/rtw88/bf.h
@@ -13,6 +13,9 @@
#define REG_ASSOCIATED_BFMER1_INFO 0x06EC
#define REG_TX_CSI_RPT_PARAM_BW20 0x06F4
#define REG_SND_PTCL_CTRL 0x0718
+#define BIT_DIS_CHK_VHTSIGB_CRC BIT(6)
+#define BIT_DIS_CHK_VHTSIGA_CRC BIT(5)
+#define BIT_MASK_BEAMFORM (GENMASK(4, 0) | BIT(7))
#define REG_MU_TX_CTL 0x14C0
#define REG_MU_STA_GID_VLD 0x14C4
#define REG_MU_STA_USER_POS_INFO 0x14C8
@@ -42,8 +45,8 @@
#define BIT_RXFLTMAP4_BF_REPORT_POLL BIT(4)
#define RTW_NDP_RX_STANDBY_TIME 0x70
-#define RTW_SND_CTRL_REMOVE 0xD8
-#define RTW_SND_CTRL_SOUNDING 0xDB
+#define RTW_SND_CTRL_REMOVE 0x98
+#define RTW_SND_CTRL_SOUNDING 0x9B
enum csi_seg_len {
HAL_CSI_SEG_4K = 0,
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
index 80a6f4da6acd9..db078df63f855 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -223,7 +223,8 @@ static int rtw8821c_mac_init(struct rtw_dev *rtwdev)
rtw_write8(rtwdev, REG_TCR + 1, WLAN_TX_FUNC_CFG1);
rtw_write8(rtwdev, REG_ACKTO_CCK, 0x40);
rtw_write8_set(rtwdev, REG_WMAC_TRXPTCL_CTL_H, BIT(1));
- rtw_write8_set(rtwdev, REG_SND_PTCL_CTRL, BIT(6));
+ rtw_write8_set(rtwdev, REG_SND_PTCL_CTRL,
+ BIT_DIS_CHK_VHTSIGB_CRC);
rtw_write32(rtwdev, REG_WMAC_OPTION_FUNCTION + 8, WLAN_MAC_OPT_FUNC2);
rtw_write8(rtwdev, REG_WMAC_OPTION_FUNCTION + 4, WLAN_MAC_OPT_NORM_FUNC1);
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
index c409c8c29ec8b..a4cbcc6bdcd14 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -262,6 +262,8 @@ static int rtw8822b_mac_init(struct rtw_dev *rtwdev)
rtw_write8(rtwdev, REG_TCR + 1, WLAN_TX_FUNC_CFG1);
rtw_write32(rtwdev, REG_WMAC_OPTION_FUNCTION + 8, WLAN_MAC_OPT_FUNC2);
rtw_write8(rtwdev, REG_WMAC_OPTION_FUNCTION + 4, WLAN_MAC_OPT_NORM_FUNC1);
+ rtw_write8_set(rtwdev, REG_SND_PTCL_CTRL,
+ BIT_DIS_CHK_VHTSIGB_CRC);
return 0;
}
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
index 46b881e8e4feb..a8b95dcdb8e90 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -2102,6 +2102,8 @@ static int rtw8822c_mac_init(struct rtw_dev *rtwdev)
BIT_RXPSF_CONT_ERRCHKEN);
value16 = BIT_SET_RXPSF_ERRTHR(value16, 0x07);
rtw_write16(rtwdev, REG_RXPSF_CTRL, value16);
+ rtw_write8_set(rtwdev, REG_SND_PTCL_CTRL,
+ BIT_DIS_CHK_VHTSIGB_CRC);
/* Interrupt migration configuration */
rtw_write32(rtwdev, REG_INT_MIG, WLAN_MAC_INT_MIG_CFG);
--
cgit 1.2.3-1.el7
File diff suppressed because it is too large Load Diff
@@ -1421,18 +1421,18 @@ diff -Nurp linux-5.15.1/drivers/platform/x86/shuttle-wmi.c linux-5.15.1-shuttle/
+
+module_init(shuttle_wmi_init);
+module_exit(shuttle_wmi_exit);
diff -Nurp linux-5.15.1/MAINTAINERS linux-5.15.1-shuttle/MAINTAINERS
--- linux-5.15.1/MAINTAINERS 2021-10-31 22:53:10.000000000 +0200
+++ linux-5.15.1-shuttle/MAINTAINERS 2021-11-08 23:24:45.469092275 +0200
@@ -16993,6 +16993,12 @@ S: Orphan
F: drivers/media/platform/sh_vou.c
diff -Nurp linux-5.18/MAINTAINERS.orig linux-5.18/MAINTAINERS
--- linux-5.18/MAINTAINERS.orig
+++ linux-5.18/MAINTAINERS
@@ -17888,6 +17888,12 @@
F: drivers/media/platform/renesas/sh_vou.c
F: include/media/drv-intf/sh_vou.h
+SHUTTLE WMI EXTRAS DRIVER
+M: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
+L: platform-driver-x86@vger.kernel.org
+S: Maintained
+F: drivers/platform/x86/shuttle-wmi.c
+M: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
+L: platform-driver-x86@vger.kernel.org
+S: Maintained
+F: drivers/platform/x86/shuttle-wmi.c
+
SI2157 MEDIA DRIVER
M: Antti Palosaari <crope@iki.fi>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,33 @@
Hook up to module buildsystem.
Signed-off-by: Thomas Backlund <tmb@mageia.org>
---
drivers/staging/Kconfig | 2 ++
drivers/staging/Makefile | 1 +
2 files changed, 3 insertions(+)
diff -Nurp linux-6.3/drivers/staging/Kconfig linux-6.3.rtl/drivers/staging/Kconfig
--- linux-6.3/drivers/staging/Kconfig 2023-04-23 22:02:52.000000000 +0300
+++ linux-6.3.rtl/drivers/staging/Kconfig 2023-04-24 20:35:51.404482116 +0300
@@ -36,6 +36,8 @@ source "drivers/staging/rtl8723bs/Kconfi
source "drivers/staging/rtl8712/Kconfig"
+source "drivers/staging/rtl8812au/Kconfig"
+
source "drivers/staging/rts5208/Kconfig"
source "drivers/staging/octeon/Kconfig"
diff -Nurp linux-6.3/drivers/staging/Makefile linux-6.3.rtl/drivers/staging/Makefile
--- linux-6.3/drivers/staging/Makefile 2023-04-23 22:02:52.000000000 +0300
+++ linux-6.3.rtl/drivers/staging/Makefile 2023-04-24 20:36:34.117485089 +0300
@@ -8,6 +8,7 @@ obj-$(CONFIG_RTL8192U) += rtl8192u/
obj-$(CONFIG_RTL8192E) += rtl8192e/
obj-$(CONFIG_RTL8723BS) += rtl8723bs/
obj-$(CONFIG_R8712U) += rtl8712/
+obj-$(CONFIG_RTL8812AU) += rtl8812au/
obj-$(CONFIG_RTS5208) += rts5208/
obj-$(CONFIG_OCTEON_ETHERNET) += octeon/
obj-$(CONFIG_VT6655) += vt6655/
@@ -0,0 +1,78 @@
Adjust driver bits so it keeps the name of the replaced driver
Signed-off-by: Thomas Backlund <tmb@mageia.org>
---
drivers/staging/rtl8812au/Kconfig | 7 +++----
drivers/staging/rtl8812au/Makefile | 8 ++++----
drivers/staging/rtl8812au/hal/hal_com.c | 2 +-
drivers/staging/rtl8812au/os_dep/linux/ioctl_cfg80211.c | 2 +-
4 files changed, 9 insertions(+), 10 deletions(-)
diff -Nurp linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/hal/hal_com.c linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/hal/hal_com.c
--- linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/hal/hal_com.c 2023-05-26 22:35:36.543136899 +0300
+++ linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/hal/hal_com.c 2023-05-26 22:45:07.045079148 +0300
@@ -12719,7 +12719,7 @@ bypass_hw_pg:
_rtw_memset(hal_data->EEPROMMACAddr, 0, ETH_ALEN);
ret = _FAIL;
exit:
- dev_info(&udev->dev, "88XXau %pM hw_info[%02x]", hw_addr, addr_offset);
+ dev_info(&udev->dev, "8812au %pM hw_info[%02x]", hw_addr, addr_offset);
return ret;
}
diff -Nurp linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/Kconfig linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/Kconfig
--- linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/Kconfig 2022-01-28 22:59:35.486648197 +0200
+++ linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/Kconfig 2023-05-26 22:45:07.045079148 +0300
@@ -1,6 +1,5 @@
-config 88XXAU
- tristate "Realtek 88XXau USB WiFi"
+config RTL8812AU
+ tristate "Realtek 8812au USB WiFi"
depends on USB
help
- Help message of 88XXau
-
+ Help message of 8812au
diff -Nurp linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/Makefile linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/Makefile
--- linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/Makefile 2023-05-26 22:35:36.539136900 +0300
+++ linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/Makefile 2023-05-26 22:45:07.045079148 +0300
@@ -185,9 +185,9 @@ endif
ifeq ($(CONFIG_RTL8812A)_$(CONFIG_RTL8821A)_$(CONFIG_RTL8814A), y_y_y)
-EXTRA_CFLAGS += -DDRV_NAME=\"rtl88XXau\"
+EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
ifeq ($(CONFIG_USB_HCI), y)
-USER_MODULE_NAME = 88XXau
+USER_MODULE_NAME = 8812au
endif
else
EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
@@ -1712,11 +1712,11 @@ $(MODULE_NAME)-y += $(_PLATFORM_FILES)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o
-obj-$(CONFIG_88XXAU) := $(MODULE_NAME).o
+obj-$(CONFIG_RTL8812AU) := $(MODULE_NAME).o
else
-export CONFIG_88XXAU = m
+export CONFIG_RTL8812AU = m
all: modules
diff -Nurp linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/os_dep/linux/ioctl_cfg80211.c linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/os_dep/linux/ioctl_cfg80211.c
--- linux-6.3.4-rtl8812au/drivers/staging/rtl8812au/os_dep/linux/ioctl_cfg80211.c 2023-05-26 22:35:36.547136899 +0300
+++ linux-6.3.4-rtl8812au-rename/drivers/staging/rtl8812au/os_dep/linux/ioctl_cfg80211.c 2023-05-26 22:45:07.046079148 +0300
@@ -2682,7 +2682,7 @@ void rtw_cfg80211_unlink_bss(_adapter *p
#endif
if (!wiphy) {
- pr_info("88XXAU: rtw_cfg80211_unlink_bss: wiphy is NULL\n");
+ pr_info("8812AU: rtw_cfg80211_unlink_bss: wiphy is NULL\n");
return;
}
@@ -0,0 +1,34 @@
From: Arend van Spriel <arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Subject: [PATCH V2] wifi: brcmfmac: fix regression for Broadcom PCIe wifi devices
Date: Wed, 11 Jan 2023 12:24:19 +0100
A sanity check was introduced considering maximum flowrings above
256 as insane and effectively aborting the device probe. This
resulted in regression for number of users as the value turns out
to be sane after all.
Fixes: 2aca4f3734bd ("brcmfmac: return error when getting invalid max_flowrings from dongle")
Reported-by: chainofflowers <chainofflowers-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
Link: https://lore.kernel.org/all/4781984.GXAFRqVoOG@luna/
Reported-by: Christian Marillat <marillat-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216894
Signed-off-by: Arend van Spriel <arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index ae57a9a3ab05..b67f6d0810b6 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -1228,7 +1228,7 @@ static int brcmf_pcie_init_ringbuffers(struct brcmf_pciedev_info *devinfo)
BRCMF_NROF_H2D_COMMON_MSGRINGS;
max_completionrings = BRCMF_NROF_D2H_COMMON_MSGRINGS;
}
- if (max_flowrings > 256) {
+ if (max_flowrings > 512) {
brcmf_err(bus, "invalid max_flowrings(%d)\n", max_flowrings);
return -EIO;
}
--
2.32.0
@@ -0,0 +1,46 @@
From 5b16c1aaae72edd3f895da027a532ee6a740df7b Mon Sep 17 00:00:00 2001
From: Sasha Levin <sashal@kernel.org>
Date: Tue, 13 Dec 2022 23:15:04 +0200
Subject: wifi: iwlwifi: fw: skip PPAG for JF
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 1c4c0b28b517d778d37900deedfe91088839f07a ]
For JF RFs we don't support PPAG, but many firmware
images lie about it. Always skip support for JF to
avoid firmware errors when sending the command.
Reported-and-tested-by: Íñigo Huguet <ihuguet@redhat.com>
Link: https://lore.kernel.org/linux-wireless/CACT4oufQsqHGp6bah2c4+jPn2wG1oZqY=UKa_TmPx=F6Lxng8Q@mail.gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221213225723.2a43415d8990.I9ac210740a45b41f1b2e15274e1daf4284f2808a@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index e6d64152c81a..a02e5a67b706 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -1106,6 +1106,11 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c
int i, j, num_sub_bands;
s8 *gain;
+ /* many firmware images for JF lie about this */
+ if (CSR_HW_RFID_TYPE(fwrt->trans->hw_rf_id) ==
+ CSR_HW_RFID_TYPE(CSR_HW_RF_ID_TYPE_JF))
+ return -EOPNOTSUPP;
+
if (!fw_has_capa(&fwrt->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_PPAG)) {
IWL_DEBUG_RADIO(fwrt,
"PPAG capability not supported by FW, command not sent.\n");
--
2.35.1
@@ -0,0 +1,33 @@
From: Aiden Leong <aiden.leong-PRyJKUU44DAAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v2] wifi: iwlwifi: pcie: add support for AX101NGW
Date: Fri, 6 Jan 2023 13:05:48 +0800
Fix a bug introduced by:
commit 32ed101aa140 ("iwlwifi: convert all Qu with Jf devices to the new
config table"), so now we pick the FIRST matching config.
Signed-off-by: Aiden Leong <aiden.leong-PRyJKUU44DAAvxtiuMwx3w@public.gmane.org>
---
I split patchset v1 to two standalone patches, since there are not that
strongly related to each other.
---
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index a46df1320372..5d74adbd49cf 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1461,7 +1461,7 @@ iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
if (!num_devices)
return NULL;
- for (i = num_devices - 1; i >= 0; i--) {
+ for (i = 0; i < num_devices; i++) {
const struct iwl_dev_info *dev_info = &iwl_dev_info_table[i];
if (dev_info->device != (u16)IWL_CFG_ANY &&
--
2.39.0
@@ -0,0 +1,451 @@
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: [PATCH v4] wifi: mac80211: fix initialization of rx->link and rx->link_sta
Date: Sat, 17 Dec 2022 09:56:24 +0100
There are some codepaths that do not initialize rx->link_sta properly. This
causes a crash in places which assume that rx->link_sta is valid if rx->sta
is valid.
One known instance is triggered by __ieee80211_rx_h_amsdu being called from
fast-rx. It results in a crash like this one:
BUG: kernel NULL pointer dereference, address: 00000000000000a8
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page PGD 0 P4D 0
Oops: 0002 [#1] PREEMPT SMP PTI
CPU: 1 PID: 506 Comm: mt76-usb-rx phy Tainted: G E 6.1.0-debian64x+1.7 #3
Hardware name: ZOTAC ZBOX-ID92/ZBOX-IQ01/ZBOX-ID92/ZBOX-IQ01, BIOS B220P007 05/21/2014
RIP: 0010:ieee80211_deliver_skb+0x62/0x1f0 [mac80211]
Code: 00 48 89 04 24 e8 9e a7 c3 df 89 c0 48 03 1c c5 a0 ea 39 a1 4c 01 6b 08 48 ff 03 48
83 7d 28 00 74 11 48 8b 45 30 48 63 55 44 <48> 83 84 d0 a8 00 00 00 01 41 8b 86 c0
11 00 00 8d 50 fd 83 fa 01
RSP: 0018:ffff999040803b10 EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffffb9903f496480 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff999040803ce0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8d21828ac900
R13: 000000000000004a R14: ffff8d2198ed89c0 R15: ffff8d2198ed8000
FS: 0000000000000000(0000) GS:ffff8d24afe80000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000000a8 CR3: 0000000429810002 CR4: 00000000001706e0
Call Trace:
<TASK>
__ieee80211_rx_h_amsdu+0x1b5/0x240 [mac80211]
? ieee80211_prepare_and_rx_handle+0xcdd/0x1320 [mac80211]
? __local_bh_enable_ip+0x3b/0xa0
ieee80211_prepare_and_rx_handle+0xcdd/0x1320 [mac80211]
? prepare_transfer+0x109/0x1a0 [xhci_hcd]
ieee80211_rx_list+0xa80/0xda0 [mac80211]
mt76_rx_complete+0x207/0x2e0 [mt76]
mt76_rx_poll_complete+0x357/0x5a0 [mt76]
mt76u_rx_worker+0x4f5/0x600 [mt76_usb]
? mt76_get_min_avg_rssi+0x140/0x140 [mt76]
__mt76_worker_fn+0x50/0x80 [mt76]
kthread+0xed/0x120
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x22/0x30
Since the initialization of rx->link and rx->link_sta is rather convoluted
and duplicated in many places, clean it up by using a helper function to
set it.
Fixes: ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling")
Fixes: b320d6c456ff ("wifi: mac80211: use correct rx link_sta instead of default")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
v4: fix regression in handling mgmt frames with AP_VLAN
v3: include crash log
v2: fix uninitialized variable
net/mac80211/rx.c | 218 ++++++++++++++++++++--------------------------
1 file changed, 95 insertions(+), 123 deletions(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 3fa7b36d4324..09cd0caded16 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4091,6 +4091,56 @@ static void ieee80211_invoke_rx_handlers(struct ieee80211_rx_data *rx)
#undef CALL_RXH
}
+static bool
+ieee80211_rx_is_valid_sta_link_id(struct ieee80211_sta *sta, u8 link_id)
+{
+ if (!sta->mlo)
+ return false;
+
+ return !!(sta->valid_links & BIT(link_id));
+}
+
+static bool ieee80211_rx_data_set_link(struct ieee80211_rx_data *rx,
+ u8 link_id)
+{
+ if (!ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta, link_id))
+ return false;
+
+ rx->link_id = link_id;
+ rx->link = rcu_dereference(rx->sdata->link[link_id]);
+ rx->link_sta = rcu_dereference(rx->sta->link[link_id]);
+
+ return rx->link && rx->link_sta;
+}
+
+static bool ieee80211_rx_data_set_sta(struct ieee80211_rx_data *rx,
+ struct ieee80211_sta *pubsta,
+ int link_id)
+{
+ struct sta_info *sta;
+
+ sta = container_of(pubsta, struct sta_info, sta);
+
+ rx->link_id = link_id;
+ rx->sta = sta;
+
+ if (sta) {
+ rx->local = sta->sdata->local;
+ if (!rx->sdata)
+ rx->sdata = sta->sdata;
+ rx->link_sta = &sta->deflink;
+
+ if (link_id >= 0 &&
+ !ieee80211_rx_data_set_link(rx, link_id))
+ return false;
+ }
+
+ if (link_id < 0)
+ rx->link = &rx->sdata->deflink;
+
+ return true;
+}
+
/*
* This function makes calls into the RX path, therefore
* it has to be invoked under RCU read lock.
@@ -4099,16 +4149,19 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid)
{
struct sk_buff_head frames;
struct ieee80211_rx_data rx = {
- .sta = sta,
- .sdata = sta->sdata,
- .local = sta->local,
/* This is OK -- must be QoS data frame */
.security_idx = tid,
.seqno_idx = tid,
- .link_id = -1,
};
struct tid_ampdu_rx *tid_agg_rx;
- u8 link_id;
+ int link_id = -1;
+
+ /* FIXME: statistics won't be right with this */
+ if (sta->sta.valid_links)
+ link_id = ffs(sta->sta.valid_links) - 1;
+
+ if (!ieee80211_rx_data_set_sta(&rx, &sta->sta, link_id))
+ return;
tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
if (!tid_agg_rx)
@@ -4128,10 +4181,6 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid)
};
drv_event_callback(rx.local, rx.sdata, &event);
}
- /* FIXME: statistics won't be right with this */
- link_id = sta->sta.valid_links ? ffs(sta->sta.valid_links) - 1 : 0;
- rx.link = rcu_dereference(sta->sdata->link[link_id]);
- rx.link_sta = rcu_dereference(sta->link[link_id]);
ieee80211_rx_handlers(&rx, &frames);
}
@@ -4147,7 +4196,6 @@ void ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *pubsta, u8 tid,
/* This is OK -- must be QoS data frame */
.security_idx = tid,
.seqno_idx = tid,
- .link_id = -1,
};
int i, diff;
@@ -4158,10 +4206,8 @@ void ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *pubsta, u8 tid,
sta = container_of(pubsta, struct sta_info, sta);
- rx.sta = sta;
- rx.sdata = sta->sdata;
- rx.link = &rx.sdata->deflink;
- rx.local = sta->local;
+ if (!ieee80211_rx_data_set_sta(&rx, pubsta, -1))
+ return;
rcu_read_lock();
tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
@@ -4548,15 +4594,6 @@ void ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata)
mutex_unlock(&local->sta_mtx);
}
-static bool
-ieee80211_rx_is_valid_sta_link_id(struct ieee80211_sta *sta, u8 link_id)
-{
- if (!sta->mlo)
- return false;
-
- return !!(sta->valid_links & BIT(link_id));
-}
-
static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
struct ieee80211_fast_rx *fast_rx,
int orig_len)
@@ -4667,7 +4704,6 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
struct sk_buff *skb = rx->skb;
struct ieee80211_hdr *hdr = (void *)skb->data;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
- struct sta_info *sta = rx->sta;
int orig_len = skb->len;
int hdrlen = ieee80211_hdrlen(hdr->frame_control);
int snap_offs = hdrlen;
@@ -4679,7 +4715,6 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
u8 da[ETH_ALEN];
u8 sa[ETH_ALEN];
} addrs __aligned(2);
- struct link_sta_info *link_sta;
struct ieee80211_sta_rx_stats *stats;
/* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write
@@ -4782,18 +4817,10 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
drop:
dev_kfree_skb(skb);
- if (rx->link_id >= 0) {
- link_sta = rcu_dereference(sta->link[rx->link_id]);
- if (!link_sta)
- return true;
- } else {
- link_sta = &sta->deflink;
- }
-
if (fast_rx->uses_rss)
- stats = this_cpu_ptr(link_sta->pcpu_rx_stats);
+ stats = this_cpu_ptr(rx->link_sta->pcpu_rx_stats);
else
- stats = &link_sta->rx_stats;
+ stats = &rx->link_sta->rx_stats;
stats->dropped++;
return true;
@@ -4811,8 +4838,8 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
struct ieee80211_local *local = rx->local;
struct ieee80211_sub_if_data *sdata = rx->sdata;
struct ieee80211_hdr *hdr = (void *)skb->data;
- struct link_sta_info *link_sta = NULL;
- struct ieee80211_link_data *link;
+ struct link_sta_info *link_sta = rx->link_sta;
+ struct ieee80211_link_data *link = rx->link;
rx->skb = skb;
@@ -4834,35 +4861,6 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
if (!ieee80211_accept_frame(rx))
return false;
- if (rx->link_id >= 0) {
- link = rcu_dereference(rx->sdata->link[rx->link_id]);
-
- /* we might race link removal */
- if (!link)
- return true;
- rx->link = link;
-
- if (rx->sta) {
- rx->link_sta =
- rcu_dereference(rx->sta->link[rx->link_id]);
- if (!rx->link_sta)
- return true;
- }
- } else {
- if (rx->sta)
- rx->link_sta = &rx->sta->deflink;
-
- rx->link = &sdata->deflink;
- }
-
- if (unlikely(!is_multicast_ether_addr(hdr->addr1) &&
- rx->link_id >= 0 && rx->sta && rx->sta->sta.mlo)) {
- link_sta = rcu_dereference(rx->sta->link[rx->link_id]);
-
- if (WARN_ON_ONCE(!link_sta))
- return true;
- }
-
if (!consume) {
struct skb_shared_hwtstamps *shwt;
@@ -4882,7 +4880,7 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
shwt->hwtstamp = skb_hwtstamps(skb)->hwtstamp;
}
- if (unlikely(link_sta)) {
+ if (unlikely(rx->sta && rx->sta->sta.mlo)) {
/* translate to MLD addresses */
if (ether_addr_equal(link->conf->addr, hdr->addr1))
ether_addr_copy(hdr->addr1, rx->sdata->vif.addr);
@@ -4912,6 +4910,7 @@ static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw,
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_fast_rx *fast_rx;
struct ieee80211_rx_data rx;
+ int link_id = -1;
memset(&rx, 0, sizeof(rx));
rx.skb = skb;
@@ -4928,12 +4927,8 @@ static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw,
if (!pubsta)
goto drop;
- rx.sta = container_of(pubsta, struct sta_info, sta);
- rx.sdata = rx.sta->sdata;
-
- if (status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(pubsta, status->link_id))
- goto drop;
+ if (status->link_valid)
+ link_id = status->link_id;
/*
* TODO: Should the frame be dropped if the right link_id is not
@@ -4942,19 +4937,8 @@ static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw,
* link_id is used only for stats purpose and updating the stats on
* the deflink is fine?
*/
- if (status->link_valid)
- rx.link_id = status->link_id;
-
- if (rx.link_id >= 0) {
- struct ieee80211_link_data *link;
-
- link = rcu_dereference(rx.sdata->link[rx.link_id]);
- if (!link)
- goto drop;
- rx.link = link;
- } else {
- rx.link = &rx.sdata->deflink;
- }
+ if (!ieee80211_rx_data_set_sta(&rx, pubsta, link_id))
+ goto drop;
fast_rx = rcu_dereference(rx.sta->fast_rx);
if (!fast_rx)
@@ -4972,6 +4956,8 @@ static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx,
{
struct link_sta_info *link_sta;
struct ieee80211_hdr *hdr = (void *)skb->data;
+ struct sta_info *sta;
+ int link_id = -1;
/*
* Look up link station first, in case there's a
@@ -4981,24 +4967,19 @@ static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx,
*/
link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2);
if (link_sta) {
- rx->sta = link_sta->sta;
- rx->link_id = link_sta->link_id;
+ sta = link_sta->sta;
+ link_id = link_sta->link_id;
} else {
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
- rx->sta = sta_info_get_bss(rx->sdata, hdr->addr2);
- if (rx->sta) {
- if (status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta,
- status->link_id))
- return false;
-
- rx->link_id = status->link_valid ? status->link_id : -1;
- } else {
- rx->link_id = -1;
- }
+ sta = sta_info_get_bss(rx->sdata, hdr->addr2);
+ if (status->link_valid)
+ link_id = status->link_id;
}
+ if (!ieee80211_rx_data_set_sta(rx, &sta->sta, link_id))
+ return false;
+
return ieee80211_prepare_and_rx_handle(rx, skb, consume);
}
@@ -5057,19 +5038,15 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
if (ieee80211_is_data(fc)) {
struct sta_info *sta, *prev_sta;
- u8 link_id = status->link_id;
+ int link_id = -1;
- if (pubsta) {
- rx.sta = container_of(pubsta, struct sta_info, sta);
- rx.sdata = rx.sta->sdata;
+ if (status->link_valid)
+ link_id = status->link_id;
- if (status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(pubsta, link_id))
+ if (pubsta) {
+ if (!ieee80211_rx_data_set_sta(&rx, pubsta, link_id))
goto out;
- if (status->link_valid)
- rx.link_id = status->link_id;
-
/*
* In MLO connection, fetch the link_id using addr2
* when the driver does not pass link_id in status.
@@ -5087,7 +5064,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
if (!link_sta)
goto out;
- rx.link_id = link_sta->link_id;
+ ieee80211_rx_data_set_link(&rx, link_sta->link_id);
}
if (ieee80211_prepare_and_rx_handle(&rx, skb, true))
@@ -5103,30 +5080,25 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
continue;
}
- if ((status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(&prev_sta->sta,
- link_id)) ||
- (!status->link_valid && prev_sta->sta.mlo))
+ if (!ieee80211_rx_data_set_sta(&rx, &prev_sta->sta,
+ link_id))
+ goto out;
+
+ if (!status->link_valid && prev_sta->sta.mlo)
continue;
- rx.link_id = status->link_valid ? link_id : -1;
- rx.sta = prev_sta;
- rx.sdata = prev_sta->sdata;
ieee80211_prepare_and_rx_handle(&rx, skb, false);
prev_sta = sta;
}
if (prev_sta) {
- if ((status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(&prev_sta->sta,
- link_id)) ||
- (!status->link_valid && prev_sta->sta.mlo))
+ if (!ieee80211_rx_data_set_sta(&rx, &prev_sta->sta,
+ link_id))
goto out;
- rx.link_id = status->link_valid ? link_id : -1;
- rx.sta = prev_sta;
- rx.sdata = prev_sta->sdata;
+ if (!status->link_valid && prev_sta->sta.mlo)
+ goto out;
if (ieee80211_prepare_and_rx_handle(&rx, skb, true))
return;
@@ -0,0 +1,58 @@
From: Olaf Dabrunz <od@suse.de>
Subject: [apm] default to "power_off" when SMP kernel is used on single processo
r machines
Reference: SUSE221667
This patch turns on support for the APM power_off function by default when the
SMP kernel is used on single processor machines.
It is a bit ugly to use a separate variable to make sure the default value is
only used when needed and the power_off variable is not initialized twice. But
I did not find a better way to do this with the way the current initialization
system works.
Signed-off-by: Olaf Dabrunz <od@suse.de>
arch/x86/kernel/apm_32.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -388,6 +388,7 @@ static bool smp __read_mostly;
static int apm_disabled = -1;
#ifdef CONFIG_SMP
static bool power_off;
+static int power_off_set;
#else
static bool power_off = 1;
#endif
@@ -1843,6 +1844,14 @@ static int apm(void *unused)
}
}
+#ifdef CONFIG_SMP
+ if (!power_off_set) {
+ power_off = (num_online_cpus() == 1);
+ /* remember not to initialize (with default value) again */
+ power_off_set = 1;
+ }
+#endif
+
/* Install our power off handler.. */
if (power_off)
pm_power_off = apm_power_off;
@@ -1886,8 +1895,12 @@ static int __init apm_setup(char *str)
if (strncmp(str, "debug", 5) == 0)
debug = !invert;
if ((strncmp(str, "power-off", 9) == 0) ||
- (strncmp(str, "power_off", 9) == 0))
+ (strncmp(str, "power_off", 9) == 0)) {
power_off = !invert;
+#ifdef CONFIG_SMP
+ power_off_set = 1;
+#endif
+ }
if (strncmp(str, "smp", 3) == 0) {
smp = !invert;
idle_threshold = 100;
@@ -0,0 +1,29 @@
The Toshiba Equium A6 Laptop needs pci-assign-busses in order to detect
the Wireless card Netgear MA521
More info here: http://qa.mandriva.com/show_bug.cgi?id=18989
Signed-off-by: Thomas Backlund <tmb@mandriva.org>
---
arch/x86/pci/common.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -245,6 +245,14 @@ static const struct dmi_system_id __devi
DMI_MATCH(DMI_PRODUCT_NAME, "SX20S"),
},
},
+ {
+ .callback = assign_all_busses,
+ .ident = "Toshiba Equium A6 Laptop",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Equium A60"),
+ },
+ },
#endif /* __i386__ */
{
.callback = set_bf_sort,
@@ -0,0 +1,163 @@
From 4782c725c1538aa9ef894ae4a3938db40be7f02c Mon Sep 17 00:00:00 2001
From: Nick Terrell <terrelln@fb.com>
Date: Fri, 14 Oct 2022 14:47:04 -0700
Subject: [PATCH 5/6] zstd: Move zstd-common module exports to
zstd_common_module.c
The zstd codebase is imported from the upstream zstd repo, and is over-written on
every update. Upstream keeps the kernel specific code separate from the main
library. So the module definition is moved into the zstd_common_module.c file.
This matches the pattern followed by the zstd-compress and zstd-decompress files.
I've done build and boot testing on x86-64, i386, and aarch64. I've
verified that zstd built both as modules and built-in build and boot.
Signed-off-by: Nick Terrell <terrelln@fb.com>
---
lib/zstd/Makefile | 1 +
lib/zstd/common/entropy_common.c | 4 ----
lib/zstd/common/zstd_common.c | 10 ----------
lib/zstd/zstd_common_module.c | 32 ++++++++++++++++++++++++++++++++
4 files changed, 33 insertions(+), 14 deletions(-)
create mode 100644 lib/zstd/zstd_common_module.c
diff --git a/lib/zstd/Makefile b/lib/zstd/Makefile
index 440bd0007ae2..20f08c644b71 100644
--- a/lib/zstd/Makefile
+++ b/lib/zstd/Makefile
@@ -35,6 +35,7 @@ zstd_decompress-y := \
decompress/zstd_decompress_block.o \
zstd_common-y := \
+ zstd_common_module.o \
common/debug.o \
common/entropy_common.o \
common/error_private.o \
diff --git a/lib/zstd/common/entropy_common.c b/lib/zstd/common/entropy_common.c
index a311808c0d56..6353249de614 100644
--- a/lib/zstd/common/entropy_common.c
+++ b/lib/zstd/common/entropy_common.c
@@ -15,7 +15,6 @@
/* *************************************
* Dependencies
***************************************/
-#include <linux/module.h>
#include "mem.h"
#include "error_private.h" /* ERR_*, ERROR */
#define FSE_STATIC_LINKING_ONLY /* FSE_MIN_TABLELOG */
@@ -240,7 +239,6 @@ size_t FSE_readNCount(
{
return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);
}
-EXPORT_SYMBOL_GPL(FSE_readNCount);
/*! HUF_readStats() :
Read compact Huffman tree, saved by HUF_writeCTable().
@@ -256,7 +254,6 @@ size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats,
U32 wksp[HUF_READ_STATS_WORKSPACE_SIZE_U32];
return HUF_readStats_wksp(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, wksp, sizeof(wksp), /* bmi2 */ 0);
}
-EXPORT_SYMBOL_GPL(HUF_readStats);
FORCE_INLINE_TEMPLATE size_t
HUF_readStats_body(BYTE* huffWeight, size_t hwSize, U32* rankStats,
@@ -357,4 +354,3 @@ size_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, U32* rankStats,
(void)bmi2;
return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
}
-EXPORT_SYMBOL_GPL(HUF_readStats_wksp);
diff --git a/lib/zstd/common/zstd_common.c b/lib/zstd/common/zstd_common.c
index 0f1f63be25d9..3d7e35b309b5 100644
--- a/lib/zstd/common/zstd_common.c
+++ b/lib/zstd/common/zstd_common.c
@@ -13,7 +13,6 @@
/*-*************************************
* Dependencies
***************************************/
-#include <linux/module.h>
#define ZSTD_DEPS_NEED_MALLOC
#include "zstd_deps.h" /* ZSTD_malloc, ZSTD_calloc, ZSTD_free, ZSTD_memset */
#include "error_private.h"
@@ -36,17 +35,14 @@ const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
* tells if a return value is an error code
* symbol is required for external callers */
unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
-EXPORT_SYMBOL_GPL(ZSTD_isError);
/*! ZSTD_getErrorName() :
* provides error code string from function result (useful for debugging) */
const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }
-EXPORT_SYMBOL_GPL(ZSTD_getErrorName);
/*! ZSTD_getError() :
* convert a `size_t` function result into a proper ZSTD_errorCode enum */
ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }
-EXPORT_SYMBOL_GPL(ZSTD_getErrorCode);
/*! ZSTD_getErrorString() :
* provides error code string from enum */
@@ -63,7 +59,6 @@ void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem)
return customMem.customAlloc(customMem.opaque, size);
return ZSTD_malloc(size);
}
-EXPORT_SYMBOL_GPL(ZSTD_customMalloc);
void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)
{
@@ -76,7 +71,6 @@ void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)
}
return ZSTD_calloc(1, size);
}
-EXPORT_SYMBOL_GPL(ZSTD_customCalloc);
void ZSTD_customFree(void* ptr, ZSTD_customMem customMem)
{
@@ -87,7 +81,3 @@ void ZSTD_customFree(void* ptr, ZSTD_customMem customMem)
ZSTD_free(ptr);
}
}
-EXPORT_SYMBOL_GPL(ZSTD_customFree);
-
-MODULE_LICENSE("Dual BSD/GPL");
-MODULE_DESCRIPTION("Zstd Common");
diff --git a/lib/zstd/zstd_common_module.c b/lib/zstd/zstd_common_module.c
new file mode 100644
index 000000000000..22686e367e6f
--- /dev/null
+++ b/lib/zstd/zstd_common_module.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
+/*
+ * Copyright (c) Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under both the BSD-style license (found in the
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found
+ * in the COPYING file in the root directory of this source tree).
+ * You may select, at your option, one of the above-listed licenses.
+ */
+
+#include <linux/module.h>
+
+#include "common/huf.h"
+#include "common/fse.h"
+#include "common/zstd_internal.h"
+
+// Export symbols shared by compress and decompress into a common module
+
+#undef ZSTD_isError /* defined within zstd_internal.h */
+EXPORT_SYMBOL_GPL(FSE_readNCount);
+EXPORT_SYMBOL_GPL(HUF_readStats);
+EXPORT_SYMBOL_GPL(HUF_readStats_wksp);
+EXPORT_SYMBOL_GPL(ZSTD_isError);
+EXPORT_SYMBOL_GPL(ZSTD_getErrorName);
+EXPORT_SYMBOL_GPL(ZSTD_getErrorCode);
+EXPORT_SYMBOL_GPL(ZSTD_customMalloc);
+EXPORT_SYMBOL_GPL(ZSTD_customCalloc);
+EXPORT_SYMBOL_GPL(ZSTD_customFree);
+
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_DESCRIPTION("Zstd Common");
--
2.30.6
File diff suppressed because it is too large Load Diff
+28 -61
View File
@@ -12,7 +12,7 @@
<IsA>kernel</IsA>
<Summary>The Linux kernel (the core of the Linux operating system) for Pisi Linux</Summary>
<Description>kernel contains the Linux kernel, the core of any Linux operating system. The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc.</Description>
<Archive sha1sum="01961045127c21f8a9dbaa9e7705dbb9e4cffbaa" type="targz">https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.15.tar.gz</Archive>
<Archive sha1sum="026a9f37b498ab533f843d4a3a85c40f9d108431" type="targz">https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.6.tar.gz</Archive>
<AdditionalFiles>
<AdditionalFile target="configs/kernel-x86_64-config">configs/kernel-x86_64-config</AdditionalFile>
<AdditionalFile permission="0755" target="generate-module-list">scripts/generate-module-list</AdditionalFile>
@@ -33,71 +33,38 @@
</BuildDependencies>
<Patches>
<!-- Linux patches -->
<Patch level="1" compressionType="xz">patches/linux/patch-5.15.158.xz</Patch>
<Patch level="1" compressionType="xz">patches/linux/patch-6.6.30.xz</Patch>
<!-- aufs5 patchec -->
<Patch level="1">patches/aufs5/aufs5.15.41-20230828.patch</Patch>
<Patch level="1">patches/aufs5/aufs5-base.patch</Patch>
<Patch level="1">patches/aufs5/aufs5-loopback.patch</Patch>
<Patch level="1">patches/aufs5/aufs5-kbuild.patch</Patch>
<Patch level="1">patches/aufs5/lockdep-debug.patch</Patch>
<Patch level="1">patches/aufs5/aufs5-mmap.patch</Patch>
<Patch level="1">patches/aufs5/tmpfs-idr.patch</Patch>
<Patch level="1">patches/aufs5/vfs-ino.patch</Patch>
<Patch level="1">patches/aufs5/aufs5-standalone.patch</Patch>
<!-- aufs6 patchec -->
<Patch level="1">patches/aufs6/aufs6.6-20240226.patch</Patch>
<Patch level="1">patches/aufs6/aufs6-base.patch</Patch>
<Patch level="1">patches/aufs6/aufs6-kbuild.patch</Patch>
<Patch level="1">patches/aufs6/aufs6-loopback.patch</Patch>
<Patch level="1">patches/aufs6/aufs6-mmap.patch</Patch>
<Patch level="1">patches/aufs6/tmpfs-idr.patch</Patch>
<Patch level="1">patches/aufs6/vfs-ino.patch</Patch>
<Patch level="1">patches/aufs6/aufs6-standalone.patch</Patch>
<!-- Mageia Linux patches-->
<Patch level="1">patches/mageia/fs-procfs-do-not-list-TID-0-in-proc-pid-task.patch</Patch>
<Patch level="1">patches/mageia/CVE-2019-12379.patch</Patch>
<Patch level="1">patches/mageia/CVE-2020-16119-DCCP-CCID-structure-use-after-free.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-add-shuttle-wmi-driver.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-drop-devinit-exit.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-4.2-buildfix.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-4.13-buildfix.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-kernel-5.5.patch</Patch>
<Patch level="1">patches/mageia/3rd-3rdparty-tree.patch</Patch>
<Patch level="1">patches/mageia/3rd-3rdparty-merge.patch</Patch>
<Patch level="1">patches/mageia/3rd-ndiswrapper-1.63.patch</Patch>
<Patch level="1">patches/mageia/3rd-ndiswrapper-Kconfig.patch</Patch>
<Patch level="1">patches/mageia/3rd-ndiswrapper-Makefile-build-fix.patch</Patch>
<Patch level="1">patches/mageia/3rd-niswrapper-Kconfig-Makefile.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8812au.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8812au-Kconfig-Makefile.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8812au-rename.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8812au-kernel-5.12.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8812au-kernel-5.15.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8723de.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8723de-Kconfig-Makefile.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8723de-fix-redefine.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8723de-nodebug.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8223de-kernel-5.6.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8723de-add-kernel-5.8-support.patch</Patch>
<Patch level="1">patches/mageia/3rd-viahss-0.92.patch</Patch>
<Patch level="1">patches/mageia/3rd-viahss-config.patch</Patch>
<Patch level="1">patches/mageia/3rd-viahss-module-license.patch</Patch>
<Patch level="1">patches/mageia/3rd-viahss-2.6.35-buildfix.patch</Patch>
<Patch level="1">patches/mageia/3rd-viahss-3.0-buildfix.patch</Patch>
<Patch level="1">patches/mageia/3rd-viahss-Kconfig-Makefile.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8821ce.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8821ce-Kconfig-Makefile.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8821ce-5.8-fix.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8821ce-kernel-5.10.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8821ce-kernel-5.12.patch</Patch>
<Patch level="1">patches/mageia/3rd-rtl8821ce-kernel-5.15.patch</Patch>
<Patch level="1">patches/mageia/3rd-fix-kconfig.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-4.13-buildfix.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-4.2-buildfix.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-drop-devinit-exit.patch</Patch>
<Patch level="1">patches/mageia/platform-x86-shuttle-wmi-kernel-5.5.patch</Patch>
<Patch level="1">patches/mageia/net-wireless-rtw88-dont-check-CRC-of-VHT-SIG-B-in-802.11ac-signal.patch</Patch>
<Patch level="1">patches/mageia/net-wireless-rtw89-add-Realtek-802.11ax-driver.patch</Patch>
<Patch level="1">patches/mageia/staging-rtl8812au.patch</Patch>
<Patch level="1">patches/mageia/staging-rtl8812au-rename.patch</Patch>
<Patch level="1">patches/mageia/staging-rtl8812au-Kconfig-Makefile.patch</Patch>
<Patch level="1">patches/mageia/staging-rtl8812au-20231117.patch</Patch>
<Patch level="1">patches/mageia/net-wireless-rtw88-add-8723de-alias.patch</Patch>
<Patch level="1">patches/mageia/net-wireless-rtw88-add-r8822be-alias.patch</Patch>
<Patch level="1">patches/mageia/net-wireless-iwlwifi-add-new-pci-id-for-6235.patch</Patch>
<Patch level="1">patches/mageia/wifi-iwlwifi-pcie-add-support-for-AX101NGW.patch</Patch>
<!-- <Patch level="1">patches/mageia/iwlwifi-cfg-Add-missing-MODULE_FIRMWARE-for-pnvm.patch</Patch> -->
<Patch level="1">patches/mageia/x86-pci-toshiba-equium-a60-assign-busses.patch</Patch>
</Patches>
</Source>
@@ -158,7 +125,7 @@
<History>
<Update release="90">
<Date>2024-05-04</Date>
<Version>5.15.158</Version>
<Version>6.6.30</Version>
<Comment>Version bump</Comment>
<Type package="kernel">security</Type>
<Requires>