Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321699
b: refs/heads/master
c: 7612bfe
h: refs/heads/master
i:
  321697: 4a2bf06
  321695: 31afef7
v: v3
  • Loading branch information
Kees Cook authored and James Morris committed Aug 17, 2012
1 parent 9c9b770 commit 5805126
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 68 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d0f8140fc8a723af4eb1ec4d757847515649574
refs/heads/master: 7612bfeecc197bbb6629842b5c6ff1967f0a9b70
1 change: 0 additions & 1 deletion trunk/arch/c6x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
config C6X
def_bool y
select CLKDEV_LOOKUP
select GENERIC_ATOMIC64
select GENERIC_IRQ_SHOW
select HAVE_ARCH_TRACEHOOK
select HAVE_DMA_API_DEBUG
Expand Down
16 changes: 5 additions & 11 deletions trunk/arch/c6x/include/asm/cache.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Port on Texas Instruments TMS320C6x architecture
*
* Copyright (C) 2005, 2006, 2009, 2010, 2012 Texas Instruments Incorporated
* Copyright (C) 2005, 2006, 2009, 2010 Texas Instruments Incorporated
* Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -16,14 +16,9 @@
/*
* Cache line size
*/
#define L1D_CACHE_SHIFT 6
#define L1D_CACHE_BYTES (1 << L1D_CACHE_SHIFT)

#define L1P_CACHE_SHIFT 5
#define L1P_CACHE_BYTES (1 << L1P_CACHE_SHIFT)

#define L2_CACHE_SHIFT 7
#define L2_CACHE_BYTES (1 << L2_CACHE_SHIFT)
#define L1D_CACHE_BYTES 64
#define L1P_CACHE_BYTES 32
#define L2_CACHE_BYTES 128

/*
* L2 used as cache
Expand All @@ -34,8 +29,7 @@
* For practical reasons the L1_CACHE_BYTES defines should not be smaller than
* the L2 line size
*/
#define L1_CACHE_SHIFT L2_CACHE_SHIFT
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
#define L1_CACHE_BYTES L2_CACHE_BYTES

#define L2_CACHE_ALIGN_LOW(x) \
(((x) & ~(L2_CACHE_BYTES - 1)))
Expand Down
5 changes: 5 additions & 0 deletions trunk/fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
DPRINTK("checking mountpoint %p %.*s",
dentry, (int)dentry->d_name.len, dentry->d_name.name);

/* Path walk currently on this dentry? */
ino_count = atomic_read(&ino->count) + 2;
if (dentry->d_count > ino_count)
goto next;

/* Can we umount this guy */
if (autofs4_mount_busy(mnt, dentry))
goto next;
Expand Down
62 changes: 25 additions & 37 deletions trunk/fs/ext4/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,14 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb,
return desc;
}

/*
* Return the block number which was discovered to be invalid, or 0 if
* the block bitmap is valid.
*/
static ext4_fsblk_t ext4_valid_block_bitmap(struct super_block *sb,
struct ext4_group_desc *desc,
unsigned int block_group,
struct buffer_head *bh)
static int ext4_valid_block_bitmap(struct super_block *sb,
struct ext4_group_desc *desc,
unsigned int block_group,
struct buffer_head *bh)
{
ext4_grpblk_t offset;
ext4_grpblk_t next_zero_bit;
ext4_fsblk_t blk;
ext4_fsblk_t bitmap_blk;
ext4_fsblk_t group_first_block;

if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
Expand All @@ -301,33 +297,37 @@ static ext4_fsblk_t ext4_valid_block_bitmap(struct super_block *sb,
* or it has to also read the block group where the bitmaps
* are located to verify they are set.
*/
return 0;
return 1;
}
group_first_block = ext4_group_first_block_no(sb, block_group);

/* check whether block bitmap block number is set */
blk = ext4_block_bitmap(sb, desc);
offset = blk - group_first_block;
bitmap_blk = ext4_block_bitmap(sb, desc);
offset = bitmap_blk - group_first_block;
if (!ext4_test_bit(offset, bh->b_data))
/* bad block bitmap */
return blk;
goto err_out;

/* check whether the inode bitmap block number is set */
blk = ext4_inode_bitmap(sb, desc);
offset = blk - group_first_block;
bitmap_blk = ext4_inode_bitmap(sb, desc);
offset = bitmap_blk - group_first_block;
if (!ext4_test_bit(offset, bh->b_data))
/* bad block bitmap */
return blk;
goto err_out;

/* check whether the inode table block number is set */
blk = ext4_inode_table(sb, desc);
offset = blk - group_first_block;
bitmap_blk = ext4_inode_table(sb, desc);
offset = bitmap_blk - group_first_block;
next_zero_bit = ext4_find_next_zero_bit(bh->b_data,
offset + EXT4_SB(sb)->s_itb_per_group,
offset);
if (next_zero_bit < offset + EXT4_SB(sb)->s_itb_per_group)
/* bad bitmap for inode tables */
return blk;
if (next_zero_bit >= offset + EXT4_SB(sb)->s_itb_per_group)
/* good bitmap for inode tables */
return 1;

err_out:
ext4_error(sb, "Invalid block bitmap - block_group = %d, block = %llu",
block_group, bitmap_blk);
return 0;
}

Expand All @@ -336,26 +336,14 @@ void ext4_validate_block_bitmap(struct super_block *sb,
unsigned int block_group,
struct buffer_head *bh)
{
ext4_fsblk_t blk;

if (buffer_verified(bh))
return;

ext4_lock_group(sb, block_group);
blk = ext4_valid_block_bitmap(sb, desc, block_group, bh);
if (unlikely(blk != 0)) {
ext4_unlock_group(sb, block_group);
ext4_error(sb, "bg %u: block %llu: invalid block bitmap",
block_group, blk);
return;
}
if (unlikely(!ext4_block_bitmap_csum_verify(sb, block_group,
desc, bh, EXT4_BLOCKS_PER_GROUP(sb) / 8))) {
ext4_unlock_group(sb, block_group);
ext4_error(sb, "bg %u: bad block bitmap checksum", block_group);
return;
}
set_buffer_verified(bh);
if (ext4_valid_block_bitmap(sb, desc, block_group, bh) &&
ext4_block_bitmap_csum_verify(sb, block_group, desc, bh,
EXT4_BLOCKS_PER_GROUP(sb) / 8))
set_buffer_verified(bh);
ext4_unlock_group(sb, block_group);
}

Expand Down
1 change: 1 addition & 0 deletions trunk/fs/ext4/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ int ext4_block_bitmap_csum_verify(struct super_block *sb, ext4_group_t group,
if (provided == calculated)
return 1;

ext4_error(sb, "Bad block bitmap checksum: block_group = %u", group);
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion trunk/fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,6 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
}
path[0].p_depth = depth;
path[0].p_hdr = ext_inode_hdr(inode);
i = 0;

if (ext4_ext_check(inode, path[0].p_hdr, depth)) {
err = -EIO;
Expand Down
6 changes: 0 additions & 6 deletions trunk/fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
ei->i_reserved_meta_blocks = 0;
ei->i_allocated_meta_blocks = 0;
ei->i_da_metadata_calc_len = 0;
ei->i_da_metadata_calc_last_lblock = 0;
spin_lock_init(&(ei->i_block_reservation_lock));
#ifdef CONFIG_QUOTA
ei->i_reserved_quota = 0;
Expand Down Expand Up @@ -3109,10 +3108,6 @@ static int count_overhead(struct super_block *sb, ext4_group_t grp,
ext4_group_t i, ngroups = ext4_get_groups_count(sb);
int s, j, count = 0;

if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_BIGALLOC))
return (ext4_bg_has_super(sb, grp) + ext4_bg_num_gdb(sb, grp) +
sbi->s_itb_per_group + 2);

first_block = le32_to_cpu(sbi->s_es->s_first_data_block) +
(grp * EXT4_BLOCKS_PER_GROUP(sb));
last_block = first_block + EXT4_BLOCKS_PER_GROUP(sb) - 1;
Expand Down Expand Up @@ -4424,7 +4419,6 @@ static void ext4_clear_journal_err(struct super_block *sb,
ext4_commit_super(sb, 1);

jbd2_journal_clear_err(journal);
jbd2_journal_update_sb_errno(journal);
}
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/jbd2/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ static void jbd2_mark_journal_empty(journal_t *journal)
* Update a journal's errno. Write updated superblock to disk waiting for IO
* to complete.
*/
void jbd2_journal_update_sb_errno(journal_t *journal)
static void jbd2_journal_update_sb_errno(journal_t *journal)
{
journal_superblock_t *sb = journal->j_superblock;

Expand All @@ -1390,7 +1390,6 @@ void jbd2_journal_update_sb_errno(journal_t *journal)

jbd2_write_superblock(journal, WRITE_SYNC);
}
EXPORT_SYMBOL(jbd2_journal_update_sb_errno);

/*
* Read the superblock for a given journal, performing initial
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/jbd2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,6 @@ extern int jbd2_journal_destroy (journal_t *);
extern int jbd2_journal_recover (journal_t *journal);
extern int jbd2_journal_wipe (journal_t *, int);
extern int jbd2_journal_skip_recovery (journal_t *);
extern void jbd2_journal_update_sb_errno(journal_t *);
extern void jbd2_journal_update_sb_log_tail (journal_t *, tid_t,
unsigned long, int);
extern void __jbd2_journal_abort_hard (journal_t *);
Expand Down
10 changes: 2 additions & 8 deletions trunk/security/yama/yama_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,9 @@ static int yama_ptrace_access_check(struct task_struct *child,
}

if (rc) {
char name[sizeof(current->comm)];
printk_ratelimited(KERN_NOTICE
"ptrace of pid %d was attempted by: %s (pid %d)\n",
child->pid,
get_task_comm(name, current),
current->pid);
child->pid, current->comm, current->pid);
}

return rc;
Expand Down Expand Up @@ -319,12 +316,9 @@ static int yama_ptrace_traceme(struct task_struct *parent)
}

if (rc) {
char name[sizeof(current->comm)];
printk_ratelimited(KERN_NOTICE
"ptraceme of pid %d was attempted by: %s (pid %d)\n",
current->pid,
get_task_comm(name, parent),
parent->pid);
current->pid, parent->comm, parent->pid);
}

return rc;
Expand Down

0 comments on commit 5805126

Please sign in to comment.