diff options
| author | Johannes Berg <[email protected]> | 2025-03-18 08:45:23 +0000 |
|---|---|---|
| committer | Johannes Berg <[email protected]> | 2025-03-18 08:46:36 +0000 |
| commit | c924c5e9b8c65b3a479a90e5e37d74cc8cd9fe0a (patch) | |
| tree | 9626c13418dd3770f2772980a7dacdc110c442b6 /drivers/misc/ntsync.c | |
| parent | wifi: iwlwifi: Fix uninitialized variable with __free() (diff) | |
| parent | Merge branch 'net-phy-rework-linkmodes-handling-in-a-dedicated-file' (diff) | |
| download | kernel-c924c5e9b8c65b3a479a90e5e37d74cc8cd9fe0a.tar.gz kernel-c924c5e9b8c65b3a479a90e5e37d74cc8cd9fe0a.zip | |
Merge net-next/main to resolve conflicts
There are a few conflicts between the work that went
into wireless and that's here now, resolve them.
Signed-off-by: Johannes Berg <[email protected]>
Diffstat (limited to 'drivers/misc/ntsync.c')
| -rw-r--r-- | drivers/misc/ntsync.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c index 055395cde42b..999026a1ae04 100644 --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c @@ -873,6 +873,7 @@ static int setup_wait(struct ntsync_device *dev, { int fds[NTSYNC_MAX_WAIT_COUNT + 1]; const __u32 count = args->count; + size_t size = array_size(count, sizeof(fds[0])); struct ntsync_q *q; __u32 total_count; __u32 i, j; @@ -880,15 +881,14 @@ static int setup_wait(struct ntsync_device *dev, if (args->pad || (args->flags & ~NTSYNC_WAIT_REALTIME)) return -EINVAL; - if (args->count > NTSYNC_MAX_WAIT_COUNT) + if (size >= sizeof(fds)) return -EINVAL; total_count = count; if (args->alert) total_count++; - if (copy_from_user(fds, u64_to_user_ptr(args->objs), - array_size(count, sizeof(*fds)))) + if (copy_from_user(fds, u64_to_user_ptr(args->objs), size)) return -EFAULT; if (args->alert) fds[count] = args->alert; @@ -1208,6 +1208,7 @@ static struct miscdevice ntsync_misc = { .minor = MISC_DYNAMIC_MINOR, .name = NTSYNC_NAME, .fops = &ntsync_fops, + .mode = 0666, }; module_misc_device(ntsync_misc); |
