Skip to content

Commit 7b39491

Browse files
committed
Merge branch 'android-3.10' into android-3.10.y
Change-Id: I43f5dacce5916566e94dd7e524af267081fc6df5
2 parents 0c99201 + d4ecd64 commit 7b39491

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5716
-222
lines changed

Documentation/device-mapper/boot.txt

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Boot time creation of mapped devices
2+
===================================
3+
4+
It is possible to configure a device mapper device to act as the root
5+
device for your system in two ways.
6+
7+
The first is to build an initial ramdisk which boots to a minimal
8+
userspace which configures the device, then pivot_root(8) in to it.
9+
10+
For simple device mapper configurations, it is possible to boot directly
11+
using the following kernel command line:
12+
13+
dm="<name> <uuid> <ro>,table line 1,...,table line n"
14+
15+
name = the name to associate with the device
16+
after boot, udev, if used, will use that name to label
17+
the device node.
18+
uuid = may be 'none' or the UUID desired for the device.
19+
ro = may be "ro" or "rw". If "ro", the device and device table will be
20+
marked read-only.
21+
22+
Each table line may be as normal when using the dmsetup tool except for
23+
two variations:
24+
1. Any use of commas will be interpreted as a newline
25+
2. Quotation marks cannot be escaped and cannot be used without
26+
terminating the dm= argument.
27+
28+
Unless renamed by udev, the device node created will be dm-0 as the
29+
first minor number for the device-mapper is used during early creation.
30+
31+
Example
32+
=======
33+
34+
- Booting to a linear array made up of user-mode linux block devices:
35+
36+
dm="lroot none 0, 0 4096 linear 98:16 0, 4096 4096 linear 98:32 0" \
37+
root=/dev/dm-0
38+
39+
Will boot to a rw dm-linear target of 8192 sectors split across two
40+
block devices identified by their major:minor numbers. After boot, udev
41+
will rename this target to /dev/mapper/lroot (depending on the rules).
42+
No uuid was assigned.

Documentation/kernel-parameters.txt

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ parameter is applicable:
4646
BLACKFIN Blackfin architecture is enabled.
4747
CLK Common clock infrastructure is enabled.
4848
CMA Contiguous Memory Area support is enabled.
49+
DM Device mapper support is enabled.
4950
DRM Direct Rendering Management support is enabled.
5051
DYNAMIC_DEBUG Build in debug messages and enable them at runtime
5152
EDD BIOS Enhanced Disk Drive Services (EDD) is enabled
@@ -741,6 +742,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
741742
Disable PIN 1 of APIC timer
742743
Can be useful to work around chipset bugs.
743744

745+
dm= [DM] Allows early creation of a device-mapper device.
746+
See Documentation/device-mapper/boot.txt.
747+
748+
dmasound= [HW,OSS] Sound subsystem buffers
749+
744750
dma_debug=off If the kernel is compiled with DMA_API_DEBUG support,
745751
this option disables the debugging code at boot.
746752

android/configs/android-base.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ CONFIG_IPV6_PRIVACY=y
4242
CONFIG_IPV6_ROUTER_PREF=y
4343
CONFIG_IPV6_ROUTE_INFO=y
4444
CONFIG_IP_ADVANCED_ROUTER=y
45+
CONFIG_IP_MULTICAST=y
4546
CONFIG_IP_MULTIPLE_TABLES=y
4647
CONFIG_IP_NF_ARPFILTER=y
4748
CONFIG_IP_NF_ARPTABLES=y

android/configs/android-recommended.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
# CONFIG_PM_WAKELOCKS_GC is not set
77
# CONFIG_VT is not set
88
CONFIG_ANDROID_TIMED_GPIO=y
9+
CONFIG_ASYMMETRIC_KEY_TYPE=y
10+
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
911
CONFIG_BACKLIGHT_LCD_SUPPORT=y
1012
CONFIG_BLK_DEV_LOOP=y
1113
CONFIG_BLK_DEV_RAM=y
1214
CONFIG_BLK_DEV_RAM_SIZE=8192
1315
CONFIG_COMPACTION=y
16+
CONFIG_DM_ANDROID_VERITY=y
1417
CONFIG_DM_UEVENT=y
1518
CONFIG_DRAGONRISE_FF=y
1619
CONFIG_ENABLE_DEFAULT_TRACERS=y
@@ -81,6 +84,7 @@ CONFIG_JOYSTICK_XPAD=y
8184
CONFIG_JOYSTICK_XPAD_FF=y
8285
CONFIG_JOYSTICK_XPAD_LEDS=y
8386
CONFIG_KALLSYMS_ALL=y
87+
CONFIG_KEYS=y
8488
CONFIG_KSM=y
8589
CONFIG_LOGIG940_FF=y
8690
CONFIG_LOGIRUMBLEPAD2_FF=y
@@ -98,17 +102,23 @@ CONFIG_POWER_SUPPLY=y
98102
CONFIG_PSTORE=y
99103
CONFIG_PSTORE_CONSOLE=y
100104
CONFIG_PSTORE_RAM=y
105+
CONFIG_PUBLIC_KEY_ALGO_RSA=y
101106
CONFIG_SCHEDSTATS=y
102107
CONFIG_SMARTJOYPLUS_FF=y
103108
CONFIG_SND=y
104109
CONFIG_SOUND=y
105110
CONFIG_SUSPEND_TIME=y
111+
CONFIG_SYSTEM_TRUSTED_KEYRING=y
106112
CONFIG_TABLET_USB_ACECAD=y
107113
CONFIG_TABLET_USB_AIPTEK=y
108114
CONFIG_TABLET_USB_GTCO=y
109115
CONFIG_TABLET_USB_HANWANG=y
110116
CONFIG_TABLET_USB_KBTAB=y
111117
CONFIG_TABLET_USB_WACOM=y
118+
CONFIG_TASKSTATS=y
119+
CONFIG_TASK_DELAY_ACCT=y
120+
CONFIG_TASK_IO_ACCOUNTING=y
121+
CONFIG_TASK_XACCT=y
112122
CONFIG_TIMER_STATS=y
113123
CONFIG_TMPFS=y
114124
CONFIG_TMPFS_POSIX_ACL=y
@@ -119,3 +129,4 @@ CONFIG_USB_EHCI_HCD=y
119129
CONFIG_USB_HIDDEV=y
120130
CONFIG_USB_USBNET=y
121131
CONFIG_VFAT_FS=y
132+
CONFIG_X509_CERTIFICATE_PARSER=y

arch/arm/mm/mmap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
175175

176176
if ((current->flags & PF_RANDOMIZE) &&
177177
!(current->personality & ADDR_NO_RANDOMIZE))
178-
random_factor = (get_random_int() & ((1 << mmap_rnd_bits) - 1)) << PAGE_SHIFT;
178+
random_factor = (get_random_long() & ((1UL << mmap_rnd_bits) - 1)) << PAGE_SHIFT;
179179

180180
if (mmap_is_legacy()) {
181181
mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;

arch/arm64/kernel/debug-monitors.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int __cpuinit os_lock_notify(struct notifier_block *self,
145145
unsigned long action, void *data)
146146
{
147147
int cpu = (unsigned long)data;
148-
if (action == CPU_ONLINE)
148+
if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
149149
smp_call_function_single(cpu, clear_os_lock, NULL, 1);
150150
return NOTIFY_OK;
151151
}

arch/arm64/kernel/hw_breakpoint.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ static int __cpuinit hw_breakpoint_reset_notify(struct notifier_block *self,
826826
void *hcpu)
827827
{
828828
int cpu = (long)hcpu;
829-
if (action == CPU_ONLINE)
829+
if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
830830
smp_call_function_single(cpu, reset_ctrl_regs, NULL, 1);
831831
return NOTIFY_OK;
832832
}

arch/arm64/mm/mmap.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ static unsigned long mmap_rnd(void)
5454
if (current->flags & PF_RANDOMIZE) {
5555
#ifdef CONFIG_COMPAT
5656
if (test_thread_flag(TIF_32BIT))
57-
rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_compat_bits) - 1);
57+
rnd = get_random_long() & ((1UL << mmap_rnd_compat_bits) - 1);
5858
else
5959
#endif
60-
rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_bits) - 1);
60+
rnd = get_random_long() & ((1UL << mmap_rnd_bits) - 1);
6161
}
6262
return rnd << PAGE_SHIFT;
6363
}

arch/mips/mm/mmap.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
147147
unsigned long random_factor = 0UL;
148148

149149
if (current->flags & PF_RANDOMIZE) {
150-
random_factor = get_random_int();
150+
random_factor = get_random_long();
151151
random_factor = random_factor << PAGE_SHIFT;
152152
if (TASK_IS_32BIT_ADDR)
153153
random_factor &= 0xfffffful;
@@ -168,7 +168,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
168168

169169
static inline unsigned long brk_rnd(void)
170170
{
171-
unsigned long rnd = get_random_int();
171+
unsigned long rnd = get_random_long();
172172

173173
rnd = rnd << PAGE_SHIFT;
174174
/* 8MB for 32bit, 256MB for 64bit */

arch/powerpc/kernel/process.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1450,9 +1450,9 @@ static inline unsigned long brk_rnd(void)
14501450

14511451
/* 8MB for 32bit, 1GB for 64bit */
14521452
if (is_32bit_task())
1453-
rnd = (long)(get_random_int() % (1<<(23-PAGE_SHIFT)));
1453+
rnd = (get_random_long() % (1UL<<(23-PAGE_SHIFT)));
14541454
else
1455-
rnd = (long)(get_random_int() % (1<<(30-PAGE_SHIFT)));
1455+
rnd = (get_random_long() % (1UL<<(30-PAGE_SHIFT)));
14561456

14571457
return rnd << PAGE_SHIFT;
14581458
}

arch/powerpc/mm/mmap_64.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ static unsigned long mmap_rnd(void)
6060
if (current->flags & PF_RANDOMIZE) {
6161
/* 8MB for 32bit, 1GB for 64bit */
6262
if (is_32bit_task())
63-
rnd = (long)(get_random_int() % (1<<(23-PAGE_SHIFT)));
63+
rnd = get_random_long() % (1<<(23-PAGE_SHIFT));
6464
else
65-
rnd = (long)(get_random_int() % (1<<(30-PAGE_SHIFT)));
65+
rnd = get_random_long() % (1UL<<(30-PAGE_SHIFT));
6666
}
6767
return rnd << PAGE_SHIFT;
6868
}

arch/sparc/kernel/sys_sparc_64.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static unsigned long mmap_rnd(void)
265265
unsigned long rnd = 0UL;
266266

267267
if (current->flags & PF_RANDOMIZE) {
268-
unsigned long val = get_random_int();
268+
unsigned long val = get_random_long();
269269
if (test_thread_flag(TIF_32BIT))
270270
rnd = (val % (1UL << (23UL-PAGE_SHIFT)));
271271
else

arch/x86/mm/mmap.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ static unsigned long mmap_rnd(void)
7272
if (current->flags & PF_RANDOMIZE) {
7373
if (mmap_is_ia32())
7474
#ifdef CONFIG_COMPAT
75-
rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_compat_bits) - 1);
75+
rnd = get_random_long() & ((1UL << mmap_rnd_compat_bits) - 1);
7676
#else
77-
rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_bits) - 1);
77+
rnd = get_random_long() & ((1UL << mmap_rnd_bits) - 1);
7878
#endif
7979
else
80-
rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_bits) - 1);
80+
rnd = get_random_long() & ((1UL << mmap_rnd_bits) - 1);
8181
}
8282
return rnd << PAGE_SHIFT;
8383
}

drivers/char/random.c

+22
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,28 @@ unsigned int get_random_int(void)
14941494
}
14951495
EXPORT_SYMBOL(get_random_int);
14961496

1497+
/*
1498+
* Same as get_random_int(), but returns unsigned long.
1499+
*/
1500+
unsigned long get_random_long(void)
1501+
{
1502+
__u32 *hash;
1503+
unsigned long ret;
1504+
1505+
if (arch_get_random_long(&ret))
1506+
return ret;
1507+
1508+
hash = get_cpu_var(get_random_int_hash);
1509+
1510+
hash[0] += current->pid + jiffies + get_cycles();
1511+
md5_transform(hash, random_int_secret);
1512+
ret = *(unsigned long *)hash;
1513+
put_cpu_var(get_random_int_hash);
1514+
1515+
return ret;
1516+
}
1517+
EXPORT_SYMBOL(get_random_long);
1518+
14971519
/*
14981520
* randomize_range() returns a start address such that
14991521
*

drivers/md/Kconfig

+16
Original file line numberDiff line numberDiff line change
@@ -428,4 +428,20 @@ config DM_VERITY_FEC
428428

429429
If unsure, say N.
430430

431+
config DM_ANDROID_VERITY
432+
bool "Android verity target support"
433+
depends on DM_VERITY
434+
depends on X509_CERTIFICATE_PARSER
435+
depends on SYSTEM_TRUSTED_KEYRING
436+
depends on PUBLIC_KEY_ALGO_RSA
437+
depends on KEYS
438+
depends on ASYMMETRIC_KEY_TYPE
439+
depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
440+
---help---
441+
This device-mapper target is virtually a VERITY target. This
442+
target is setup by reading the metadata contents piggybacked
443+
to the actual data blocks in the block device. The signature
444+
of the metadata contents are verified against the key included
445+
in the system keyring. Upon success, the underlying verity
446+
target is setup.
431447
endif # MD

drivers/md/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ endif
6161
ifeq ($(CONFIG_DM_VERITY_FEC),y)
6262
dm-verity-objs += dm-verity-fec.o
6363
endif
64+
65+
ifeq ($(CONFIG_DM_ANDROID_VERITY),y)
66+
dm-verity-objs += dm-android-verity.o
67+
endif

0 commit comments

Comments
 (0)