You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge commit 'v2.6.28-rc8' into sched/core
This commit is contained in:
+22
-10
@@ -61,8 +61,11 @@
|
||||
|
||||
#include "audit.h"
|
||||
|
||||
/* No auditing will take place until audit_initialized != 0.
|
||||
/* No auditing will take place until audit_initialized == AUDIT_INITIALIZED.
|
||||
* (Initialization happens after skb_init is called.) */
|
||||
#define AUDIT_DISABLED -1
|
||||
#define AUDIT_UNINITIALIZED 0
|
||||
#define AUDIT_INITIALIZED 1
|
||||
static int audit_initialized;
|
||||
|
||||
#define AUDIT_OFF 0
|
||||
@@ -965,6 +968,9 @@ static int __init audit_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (audit_initialized == AUDIT_DISABLED)
|
||||
return 0;
|
||||
|
||||
printk(KERN_INFO "audit: initializing netlink socket (%s)\n",
|
||||
audit_default ? "enabled" : "disabled");
|
||||
audit_sock = netlink_kernel_create(&init_net, NETLINK_AUDIT, 0,
|
||||
@@ -976,7 +982,7 @@ static int __init audit_init(void)
|
||||
|
||||
skb_queue_head_init(&audit_skb_queue);
|
||||
skb_queue_head_init(&audit_skb_hold_queue);
|
||||
audit_initialized = 1;
|
||||
audit_initialized = AUDIT_INITIALIZED;
|
||||
audit_enabled = audit_default;
|
||||
audit_ever_enabled |= !!audit_default;
|
||||
|
||||
@@ -999,13 +1005,21 @@ __initcall(audit_init);
|
||||
static int __init audit_enable(char *str)
|
||||
{
|
||||
audit_default = !!simple_strtol(str, NULL, 0);
|
||||
printk(KERN_INFO "audit: %s%s\n",
|
||||
audit_default ? "enabled" : "disabled",
|
||||
audit_initialized ? "" : " (after initialization)");
|
||||
if (audit_initialized) {
|
||||
if (!audit_default)
|
||||
audit_initialized = AUDIT_DISABLED;
|
||||
|
||||
printk(KERN_INFO "audit: %s", audit_default ? "enabled" : "disabled");
|
||||
|
||||
if (audit_initialized == AUDIT_INITIALIZED) {
|
||||
audit_enabled = audit_default;
|
||||
audit_ever_enabled |= !!audit_default;
|
||||
} else if (audit_initialized == AUDIT_UNINITIALIZED) {
|
||||
printk(" (after initialization)");
|
||||
} else {
|
||||
printk(" (until reboot)");
|
||||
}
|
||||
printk("\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1107,9 +1121,7 @@ unsigned int audit_serial(void)
|
||||
static inline void audit_get_stamp(struct audit_context *ctx,
|
||||
struct timespec *t, unsigned int *serial)
|
||||
{
|
||||
if (ctx)
|
||||
auditsc_get_stamp(ctx, t, serial);
|
||||
else {
|
||||
if (!ctx || !auditsc_get_stamp(ctx, t, serial)) {
|
||||
*t = CURRENT_TIME;
|
||||
*serial = audit_serial();
|
||||
}
|
||||
@@ -1146,7 +1158,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
|
||||
int reserve;
|
||||
unsigned long timeout_start = jiffies;
|
||||
|
||||
if (!audit_initialized)
|
||||
if (audit_initialized != AUDIT_INITIALIZED)
|
||||
return NULL;
|
||||
|
||||
if (unlikely(audit_filter_type(type)))
|
||||
|
||||
+21
-3
@@ -1459,7 +1459,6 @@ void audit_free(struct task_struct *tsk)
|
||||
|
||||
/**
|
||||
* audit_syscall_entry - fill in an audit record at syscall entry
|
||||
* @tsk: task being audited
|
||||
* @arch: architecture type
|
||||
* @major: major syscall type (function)
|
||||
* @a1: additional syscall register 1
|
||||
@@ -1548,9 +1547,25 @@ void audit_syscall_entry(int arch, int major,
|
||||
context->ppid = 0;
|
||||
}
|
||||
|
||||
void audit_finish_fork(struct task_struct *child)
|
||||
{
|
||||
struct audit_context *ctx = current->audit_context;
|
||||
struct audit_context *p = child->audit_context;
|
||||
if (!p || !ctx || !ctx->auditable)
|
||||
return;
|
||||
p->arch = ctx->arch;
|
||||
p->major = ctx->major;
|
||||
memcpy(p->argv, ctx->argv, sizeof(ctx->argv));
|
||||
p->ctime = ctx->ctime;
|
||||
p->dummy = ctx->dummy;
|
||||
p->auditable = ctx->auditable;
|
||||
p->in_syscall = ctx->in_syscall;
|
||||
p->filterkey = kstrdup(ctx->filterkey, GFP_KERNEL);
|
||||
p->ppid = current->pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* audit_syscall_exit - deallocate audit context after a system call
|
||||
* @tsk: task being audited
|
||||
* @valid: success/failure flag
|
||||
* @return_code: syscall return value
|
||||
*
|
||||
@@ -1942,15 +1957,18 @@ EXPORT_SYMBOL_GPL(__audit_inode_child);
|
||||
*
|
||||
* Also sets the context as auditable.
|
||||
*/
|
||||
void auditsc_get_stamp(struct audit_context *ctx,
|
||||
int auditsc_get_stamp(struct audit_context *ctx,
|
||||
struct timespec *t, unsigned int *serial)
|
||||
{
|
||||
if (!ctx->in_syscall)
|
||||
return 0;
|
||||
if (!ctx->serial)
|
||||
ctx->serial = audit_serial();
|
||||
t->tv_sec = ctx->ctime.tv_sec;
|
||||
t->tv_nsec = ctx->ctime.tv_nsec;
|
||||
*serial = ctx->serial;
|
||||
ctx->auditable = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* global counter which is incremented every time something logs in */
|
||||
|
||||
+10
-6
@@ -315,17 +315,20 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
|
||||
file = tmp->vm_file;
|
||||
if (file) {
|
||||
struct inode *inode = file->f_path.dentry->d_inode;
|
||||
struct address_space *mapping = file->f_mapping;
|
||||
|
||||
get_file(file);
|
||||
if (tmp->vm_flags & VM_DENYWRITE)
|
||||
atomic_dec(&inode->i_writecount);
|
||||
|
||||
/* insert tmp into the share list, just after mpnt */
|
||||
spin_lock(&file->f_mapping->i_mmap_lock);
|
||||
spin_lock(&mapping->i_mmap_lock);
|
||||
if (tmp->vm_flags & VM_SHARED)
|
||||
mapping->i_mmap_writable++;
|
||||
tmp->vm_truncate_count = mpnt->vm_truncate_count;
|
||||
flush_dcache_mmap_lock(file->f_mapping);
|
||||
flush_dcache_mmap_lock(mapping);
|
||||
/* insert tmp into the share list, just after mpnt */
|
||||
vma_prio_tree_add(tmp, mpnt);
|
||||
flush_dcache_mmap_unlock(file->f_mapping);
|
||||
spin_unlock(&file->f_mapping->i_mmap_lock);
|
||||
flush_dcache_mmap_unlock(mapping);
|
||||
spin_unlock(&mapping->i_mmap_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1398,6 +1401,7 @@ long do_fork(unsigned long clone_flags,
|
||||
init_completion(&vfork);
|
||||
}
|
||||
|
||||
audit_finish_fork(p);
|
||||
tracehook_report_clone(trace, regs, clone_flags, nr, p);
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ static int lstats_show(struct seq_file *m, void *v)
|
||||
latency_record[i].time,
|
||||
latency_record[i].max);
|
||||
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
|
||||
char sym[KSYM_NAME_LEN];
|
||||
char sym[KSYM_SYMBOL_LEN];
|
||||
char *c;
|
||||
if (!latency_record[i].backtrace[q])
|
||||
break;
|
||||
|
||||
@@ -167,6 +167,7 @@ static const struct tnt tnts[] = {
|
||||
* 'M' - System experienced a machine check exception.
|
||||
* 'B' - System has hit bad_page.
|
||||
* 'U' - Userspace-defined naughtiness.
|
||||
* 'D' - Kernel has oopsed before
|
||||
* 'A' - ACPI table overridden.
|
||||
* 'W' - Taint on warning.
|
||||
* 'C' - modules from drivers/staging are loaded.
|
||||
|
||||
@@ -311,7 +311,7 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
|
||||
struct task_cputime cputime;
|
||||
|
||||
thread_group_cputime(p, &cputime);
|
||||
switch (which_clock) {
|
||||
switch (CPUCLOCK_WHICH(which_clock)) {
|
||||
default:
|
||||
return -EINVAL;
|
||||
case CPUCLOCK_PROF:
|
||||
|
||||
+1
-1
@@ -633,7 +633,7 @@ void swsusp_close(fmode_t mode)
|
||||
return;
|
||||
}
|
||||
|
||||
blkdev_put(resume_bdev, mode); /* move up */
|
||||
blkdev_put(resume_bdev, mode);
|
||||
}
|
||||
|
||||
static int swsusp_header_init(void)
|
||||
|
||||
+2
-5
@@ -1317,12 +1317,9 @@ static ssize_t relay_file_splice_read(struct file *in,
|
||||
if (ret < 0)
|
||||
break;
|
||||
else if (!ret) {
|
||||
if (spliced)
|
||||
break;
|
||||
if (flags & SPLICE_F_NONBLOCK) {
|
||||
if (flags & SPLICE_F_NONBLOCK)
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
*ppos += ret;
|
||||
|
||||
@@ -6564,7 +6564,9 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
|
||||
req = list_entry(rq->migration_queue.next,
|
||||
struct migration_req, list);
|
||||
list_del_init(&req->list);
|
||||
spin_unlock_irq(&rq->lock);
|
||||
complete(&req->done);
|
||||
spin_lock_irq(&rq->lock);
|
||||
}
|
||||
spin_unlock_irq(&rq->lock);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ static void check_hung_task(struct task_struct *t, unsigned long now)
|
||||
if ((long)(now - t->last_switch_timestamp) <
|
||||
sysctl_hung_task_timeout_secs)
|
||||
return;
|
||||
if (sysctl_hung_task_warnings < 0)
|
||||
if (!sysctl_hung_task_warnings)
|
||||
return;
|
||||
sysctl_hung_task_warnings--;
|
||||
|
||||
|
||||
@@ -176,6 +176,9 @@ extern struct ctl_table random_table[];
|
||||
#ifdef CONFIG_INOTIFY_USER
|
||||
extern struct ctl_table inotify_table[];
|
||||
#endif
|
||||
#ifdef CONFIG_EPOLL
|
||||
extern struct ctl_table epoll_table[];
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
|
||||
int sysctl_legacy_va_layout;
|
||||
@@ -1325,6 +1328,13 @@ static struct ctl_table fs_table[] = {
|
||||
.child = inotify_table,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_EPOLL
|
||||
{
|
||||
.procname = "epoll",
|
||||
.mode = 0555,
|
||||
.child = epoll_table,
|
||||
},
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
.ctl_name = KERN_SETUID_DUMPABLE,
|
||||
|
||||
@@ -518,6 +518,28 @@ void update_wall_time(void)
|
||||
/* correct the clock when NTP error is too big */
|
||||
clocksource_adjust(offset);
|
||||
|
||||
/*
|
||||
* Since in the loop above, we accumulate any amount of time
|
||||
* in xtime_nsec over a second into xtime.tv_sec, its possible for
|
||||
* xtime_nsec to be fairly small after the loop. Further, if we're
|
||||
* slightly speeding the clocksource up in clocksource_adjust(),
|
||||
* its possible the required corrective factor to xtime_nsec could
|
||||
* cause it to underflow.
|
||||
*
|
||||
* Now, we cannot simply roll the accumulated second back, since
|
||||
* the NTP subsystem has been notified via second_overflow. So
|
||||
* instead we push xtime_nsec forward by the amount we underflowed,
|
||||
* and add that amount into the error.
|
||||
*
|
||||
* We'll correct this error next time through this function, when
|
||||
* xtime_nsec is not as small.
|
||||
*/
|
||||
if (unlikely((s64)clock->xtime_nsec < 0)) {
|
||||
s64 neg = -(s64)clock->xtime_nsec;
|
||||
clock->xtime_nsec = 0;
|
||||
clock->error += neg << (NTP_SCALE_SHIFT - clock->shift);
|
||||
}
|
||||
|
||||
/* store full nanoseconds into xtime after rounding it up and
|
||||
* add the remainder to the error difference.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user