Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Android msm bullhead 3.10 o preview 2 #6

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
c57495e
Backport ioctl for getting descriptors.
Oct 25, 2016
4664e70
Added support for multiple ffs functions in android.c
Oct 25, 2016
1acdf27
Fixed bug in f_fs.c where reuse of a condition caused a race.
Oct 25, 2016
4bada81
Use vmalloc to allow for larger buffer sizes in ffs r/w.
Oct 25, 2016
73ab712
Fix max_t arguments.
Nov 1, 2016
1f19a27
Revert "Fix max_t arguments."
Nov 1, 2016
d6dfee6
Revert "Use vmalloc to allow for larger buffer sizes in ffs r/w."
Nov 1, 2016
6201de2
Revert "Fixed bug in f_fs.c where reuse of a condition caused a race."
Nov 1, 2016
ca088fa
Revert "Added support for multiple ffs functions in android.c"
Nov 1, 2016
e54305d
Revert "Backport ioctl for getting descriptors."
Nov 1, 2016
9eb81af
android: binder: split flat_binder_object.
Jul 13, 2016
089fe8e
android: binder: support multiple context managers.
Sep 30, 2016
8d15919
android: binder: deal with contexts in debugfs.
Oct 17, 2016
c72516e
android: binder: support multiple /dev instances.
Sep 30, 2016
b16a449
android: binder: refactor binder_transact()
Sep 29, 2016
f71aea5
android: binder: add extra size to allocator.
Sep 30, 2016
e044e40
android: binder: support for scatter-gather.
Sep 30, 2016
6ecfa65
android: binder: support for file-descriptor arrays.
Oct 18, 2016
ea754f6
android: binder: use copy_from_user_preempt_disabled
Oct 25, 2016
02111bc
arm64/configs: bullhead: enable hwbinder domain.
Oct 26, 2016
991db66
UPSTREAM: procfs: fixes pthread cross-thread naming if !PR_DUMPABLE
Sep 29, 2016
8d8b94b
arm64/configs: bullhead: add CONFIG_QUOTA
pattjin Nov 7, 2016
eaf4086
Merge branch android-msm-bullhead-3.10-nyc-mr2 into android-msm-bullh…
pattjin Nov 16, 2016
ef07b32
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
pattjin Nov 17, 2016
6ceb956
BACKPORT: security: fix typo in security_task_prctl
thejh Sep 18, 2015
a756dc0
UPSTREAM: capabilities: ambient capabilities
amluto Sep 4, 2015
8e84af9
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
pattjin Dec 7, 2016
488f3bd
Merge branch android-msm-bullhead-3.10-nyc-mr2 into android-msm-bullh…
pattjin Dec 14, 2016
2f6156c
usb: gadget: f_fs: add ioctl returning ep descriptor
Sep 9, 2014
c932a94
usb: gadget: f_fs: Fixed condition race on endpoints, updated logging
Oct 25, 2016
899e4a6
usb: gadget: android: Add support for multiple ffs functions
Nov 11, 2016
ab4be69
usb: gadget: f_fs: Add ioctl for allocating endpoint buffers.
Nov 11, 2016
2bf7c2a
net: ipv6: make "ip -6 route get mark xyz" work.
lcolitti May 15, 2014
30b0ec7
tcp: fix more NULL deref after prequeue changes
Dec 9, 2014
cfe7272
Revert "Handle 'sk' being NULL in UID-based routing."
lcolitti Dec 12, 2016
e813633
Revert "net: core: Support UID-based routing."
lcolitti Dec 14, 2016
90bd7a9
net: core: Add a UID field to struct sock.
lcolitti Nov 3, 2016
a66ad98
net: core: add UID to flows, rules, and routes
lcolitti Nov 3, 2016
807911d
net: inet: Support UID-based routing in IP protocols.
lcolitti Nov 3, 2016
9a6bf0c
net: ipv4: Don't crash if passing a null sk to ip_rt_update_pmtu.
lcolitti Nov 29, 2016
9518b70
Merge branch android-msm-bullhead-3.10-nyc-mr2 into android-msm-bullh…
pattjin Jan 5, 2017
4cf0e34
Fixing an issue that caused DEVPORT to always be set.
MaxBires Jan 5, 2017
ce2919b
net: socket: don't set sk_uid to garbage value in ->setattr()
ebiggers Dec 30, 2016
fcb795b
arm64: bullhead_defconfig: Unsetting DEVPORT from bullhead configurat…
MaxBires Jan 6, 2017
cd1852d
sdcardfs: override umask on mkdir and create
drosen-google Apr 13, 2016
ee67a8d
sdcardfs: Check for other cases on path lookup
drosen-google Apr 27, 2016
3b1c1cb
sdcardfs: Fix locking for permission fix up
drosen-google Aug 16, 2016
4b3a2b9
sdcardfs: Switch package list to RCU
drosen-google May 10, 2016
c978379
sdcardfs: Added top to sdcardfs_inode_info
drosen-google May 18, 2016
28f82bb
sdcardfs: fix external storage exporting incorrect uid
Sep 19, 2016
40a5282
sdcardfs: Move directory unlock before touch
drosen-google Sep 26, 2016
70c8b04
mnt: Add filesystem private data to mount points
drosen-google Oct 26, 2016
b804216
vfs: Allow filesystems to access their private mount data
drosen-google Oct 26, 2016
11cf20b
vfs: Add permission2 for filesystems with per mount permissions
drosen-google Oct 26, 2016
26920bd
vfs: Add setattr2 for filesystems with per mount permissions
drosen-google Oct 26, 2016
682e443
sdcardfs: User new permission2 functions
drosen-google Oct 26, 2016
22e96f1
sdcardfs: Add gid and mask to private mount data
drosen-google Oct 27, 2016
e118933
sdcardfs: Use per mount permissions
drosen-google Oct 27, 2016
c3797a0
sdcardfs: Change magic value
drosen-google Nov 15, 2016
19ae540
BACKPORT: don't bother with propagate_mnt() unless the target is shared
Mar 21, 2014
a85e9d8
BACKPORT: smarter propagate_mnt()
Feb 27, 2014
ea268d0
ANDROID: vfs: Missed updating truncate to truncate2
drosen-google Dec 28, 2016
f490323
ANDROID: sdcardfs: Fix locking issue with permision fix up
drosen-google Dec 27, 2016
8889caa
ANDROID: mnt: remount should propagate to slaves of slaves
drosen-google Jan 5, 2017
b5ea994
ANDROID: fix uninitilized variable
weivincewang Dec 12, 2016
b5d992c
usb: gadget: android: Acquire ffs_configs_lock before dev lock
Jan 10, 2017
5d36c53
usb: gadget: f_fs: Modify endpoint_alloc, check size input
Jan 10, 2017
4ba200a
usb: gadget: f_fs: Free buffer on epfile cleanup
Jan 12, 2017
415ccac
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
pattjin Jan 18, 2017
1add38c
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
pattjin Jan 19, 2017
6f4585f
usb: gadget: f_fs: Don't change buf_len if alloc fails
Jan 18, 2017
2e956a2
ANDROID: lib: vsprintf: additional kernel pointer filtering options
Jan 11, 2017
19c833e
ANDROID: lib: vsprintf: whitelist stack traces
Jan 12, 2017
ec1ff88
ANDROID: lib: vsprintf: physical address kernel pointer filtering opt…
Jan 12, 2017
e085fb2
ANDROID: lib: vsprintf: default kptr_restrict to the maximum value
Jan 12, 2017
a848c65
Merge branch android-msm-bullhead-3.10-nyc-mr2 into android-msm-bullh…
pattjin Jan 26, 2017
78f3ee9
Revert "audio: mbhc fix"
dtwlin Jan 26, 2017
d899943
ANDROID: Support to disable arm32 Kuser_Helpers
mspectorgoogle Jan 18, 2017
b99b788
ANDROID: Fix for building non-arm64
mspectorgoogle Jan 18, 2017
0c0a72a
ANDROID: Fixing incorrect return value on error
mspectorgoogle Jan 27, 2017
d2c3b3b
Merge branch android-msm-bullhead-3.10-nyc-mr2 into android-msm-bullh…
pattjin Feb 1, 2017
e61a629
msm: vidc: Check ion_handle for errors
Oct 11, 2016
855098c
usb: gadget: f_fs: Unlock before allocating endpoint buffer
Jan 27, 2017
034a220
ANDROID: sdcardfs: Allow non-owners to touch
drosen-google Jan 20, 2017
b311d4f
ANDROID: sdcardfs: Refactor configfs interface
drosen-google Jan 21, 2017
7c2424f
ANDROID: sdcardfs: add support for user permission isolation
drosen-google Jan 22, 2017
f25953f
ANDROID: sdcardfs: Remove redundant operation
drosen-google Jan 27, 2017
df99087
ANDROID: sdcardfs: Add GID Derivation to sdcardfs
drosen-google Jan 25, 2017
6d6e828
ANDROID: sdcardfs: switch to full_name_hash and qstr
drosen-google Jan 28, 2017
f8d78a6
ANDROID: sdcardfs: Switch strcasecmp for internal call
drosen-google Feb 1, 2017
c7494d3
ANDROID: Put KUSER_HELPERS disable behind config
mspectorgoogle Feb 7, 2017
60ac2b4
usb: gadget: f_fs: Increase EP_ALLOC ioctl number
Feb 9, 2017
f7f849f
BACKPORT: hw_breakpoint: Allow watchpoint of length 3,5,6 and 7
Nov 14, 2016
fdfc65f
UPSTREAM: arm64: Allow hw watchpoint at varied offset from base address
Nov 14, 2016
51ab85d
BACKPORT: arm64: hw_breakpoint: Handle inexact watchpoint addresses
Nov 14, 2016
a474fad
UPSTREAM: arm64: Allow hw watchpoint of length 3,5,6 and 7
Nov 14, 2016
af8dd23
qcacld-2.0: Remove WIPHY_VENDOR_CMD_NEED_RUNNING flag
Dec 21, 2016
e0c238d
qcacld-2.0: wlan host driver upgrade to 4.4.23.015
Feb 16, 2017
3a3fbe3
cfg80211: refactor nl80211_start_sched_scan so it can be reused
Oct 26, 2016
823815f
cfg80211: allow drivers to support random MAC addresses for scan
Oct 27, 2016
51b2a85
cfg80211: Define macro to indicate support for random mac address for…
Nov 6, 2016
2af5448
qcacld-2.0: Update firmware interface files
Jan 9, 2017
4dc66cb
qcacld-2.0: Add support to randomize probe req SA and Seq number
Nov 4, 2016
2b47144
qcacld-2.0: Add support to include selective scan IEs only
Nov 5, 2016
f17c5d8
qcacld-2.0: Disable ie whitelisting in connected state
Dec 15, 2016
8ffb64c
qcacld-2.0: Fix memory leak caused by IE white listing
Jan 5, 2017
34a2133
qcacld-2.0: Fix buff ovfw in prb-req ie whitelisting
Dec 25, 2016
b6de176
qcacld-2.0: wlan host driver upgrade to 4.4.23.016
Feb 16, 2017
2d1b781
ANDROID: sdcardfs: Fix incorrect hash
drosen-google Feb 15, 2017
2930341
ANDROID: sdcardfs: Add missing path_put
drosen-google Feb 17, 2017
948c662
ANDROID: sdcardfs: Don't bother deleting freelist
drosen-google Feb 22, 2017
9688bef
usb: gadget: f_fs: move frees in epfile_release to before data_clear
Feb 22, 2017
383afae
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
Feb 24, 2017
20bc5d0
ANDROID: sdcardfs: implement vm_ops->page_mkwrite
drosen-google Feb 24, 2017
898da5f
ANDROID: sdcardfs: support direct-IO (DIO) operations
drosen-google Feb 24, 2017
3d16337
defconfig: enable PROC_DEVICETREE for bullhead
patils Feb 28, 2017
f6ac9ad
devicetree: add early mount nodes in DT to mount system and vendor early
patils Feb 28, 2017
b75a24e
Revert "devicetree: add early mount nodes in DT to mount system and v…
patils Feb 28, 2017
cc1182d
BACKPORT: commoncap: don't alloc the credential unless needed in cap_…
Jul 22, 2014
03e7d8c
nanohub: fix out of bounds write in nanohub_spi_read
bfennema Mar 1, 2017
d8b8b99
ASoC: msm-cpe-lsm: Fix out of bounds write in msm_cpe_lsm_ioctl_compat
Mar 7, 2017
d0e43cb
Driver to create cld80211 nl family at bootup time
Feb 16, 2017
40f8945
bullhead: Enable cnss_genl driver compilation
Mar 1, 2017
b7912b0
qcacld-2.0: Add support to use generic netlink sockets for userspace …
Feb 17, 2017
95a71ef
qcacld-2.0: Remove BTC code to reduce driver size
Feb 20, 2017
b019cff
qcacld-2.0: Print cmd in hostapd_ioctl
Mar 1, 2017
f9a04fc
qcacld-2.0: Change the log level in limProcessMlmDisassocReqNtf
Mar 1, 2017
0628b9b
qcacld-2.0: Update correct msg length in oemData_SendMBOemDataReq API
Mar 2, 2017
7ddc05d
qcacld-2.0: wlan host driver upgrade to 4.4.23.017
Mar 1, 2017
b6ad97c
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
eccopark Mar 16, 2017
16d933a
ANDROID: sdcardfs: Fix case insensitive lookup
drosen-google Mar 2, 2017
e184f31
ANDROID: sdcardfs: rate limit warning print
drosen-google Mar 3, 2017
9db3dd7
ANDROID: sdcardfs: Replace get/put with d_lock
drosen-google Mar 2, 2017
4a04790
ANDROID: sdcardfs: Use spin_lock_nested
drosen-google Mar 9, 2017
330704c
ANDROID: sdcardfs: Switch to internal case insensitive compare
drosen-google Mar 9, 2017
da6317f
ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisve
drosen-google Mar 9, 2017
3a17a00
ANDROID: sdcardfs: Get the blocksize from the lower fs
drosen-google Mar 10, 2017
cf8b5ea
ANDROID: sdcardfs: declare MODULE_ALIAS_FS
drosen-google Mar 10, 2017
86526fb
ANDROID: sdcardfs: Use case insensitive hash function
drosen-google Mar 10, 2017
05485b2
ANDROID: sdcardfs: move path_put outside of spinlock
drosen-google Mar 10, 2017
b5945fb
ANDROID: sdcardfs: Remove uninformative prints
drosen-google Mar 11, 2017
d98c557
ANDROID: sdcardfs: Use tabs instead of spaces in multiuser.h
drosen-google Mar 13, 2017
52322ca
ANDROID: sdcardfs: Fix gid issue
drosen-google Mar 13, 2017
3bcf2d9
Revert "msm: mdss: Install sync fences after user copy"
eccopark Mar 21, 2017
e2ab755
android: binder: add padding to binder_fd_array_object.
Mar 7, 2017
45e7b0e
binder: use group leader instead of open thread
toddkjos Mar 6, 2017
cd0befa
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
eccopark Mar 21, 2017
8d150ae
arm64/configs: bullhead: make savedefconfig
pattjin Mar 23, 2017
5a19ee6
build: add defconfig testing
pattjin Mar 23, 2017
8c18ed4
Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bul…
eccopark Mar 24, 2017
7f1c36b
fix the deadlock in xt_qtaguid when enable DDEBUG
Mar 23, 2017
cb9eaaa
ANDROID: sdcardfs: correct order of descriptors
drosen-google Mar 21, 2017
7a270db
ANDROID: sdcardfs: Fix formatting
drosen-google Mar 17, 2017
4357819
ANDROID: sdcardfs: Fix style issues with comments
drosen-google Mar 17, 2017
2c1de02
ANDROID: sdcardfs: remove unneeded null check
drosen-google Mar 21, 2017
6c6daf6
ANDROID: sdcardfs: Use pr_[...] instead of printk
drosen-google Mar 17, 2017
3a2e0ec
ANDROID: sdcardfs: Use to kstrout
drosen-google Mar 17, 2017
1f51600
ANDROID: sdcardfs: Use seq_puts over seq_printf
drosen-google Mar 22, 2017
f6a4c35
ANDROID: sdcardfs: Fix style issues in macros
drosen-google Mar 22, 2017
f955207
seccomp: always propagate NO_NEW_PRIVS on tsync
thejh Dec 26, 2015
64698c4
ANDROID: usb: gadget: f_accessory: Enabled Zero Length Packet (ZLP) f…
DextersHub Jun 23, 2014
98fc392
qcacld-2.0: Add radio_id change
Mar 14, 2017
e29230a
net: ipv6: Add sysctl for minimum prefix len acceptable in RIOs.
Mar 22, 2017
3e5882a
UPSTREAM: usb: gadget: f_fs: add "no_disconnect" mode
Apr 7, 2017
dad6493
BACKPORT: ipv6 addrconf: implement RFC7559 router solicitation backoff
zenczykowski Sep 28, 2016
9adb43d
qcacld-2.0: Add BSSID entry even if mismatch is seen
Apr 10, 2017
9c04880
qcacld-2.0: wlan host driver upgrade to 4.4.23.018
Apr 10, 2017
8e54cc9
ANDROID: sdcardfs: remove unnecessary call to do_munmap
drosen-google Mar 10, 2017
20ec5cf
ANDROID: sdcardfs: copy lower inode attributes in ->ioctl
drosen-google Mar 10, 2017
77cd44e
ANDROID: sdcardfs: fix ->llseek to update upper and lower offset
drosen-google Mar 10, 2017
5df605f
ANDROID: sdcardfs: use d_splice_alias
drosen-google Mar 10, 2017
2735f95
ANDROID: sdcardfs: update module info
drosen-google Mar 10, 2017
52e0a27
ANDROID: sdcardfs: Directly pass lower file for mmap
drosen-google Apr 11, 2017
9bc4da1
qcacld-2.0: Fix stripping of IEs in p2p scan
Apr 12, 2017
0ab10c4
usb: gadget: f_fs: Guard epfile->error
Apr 15, 2017
dad7efc
Android: sdcardfs: Change cache GID value
drosen-google Apr 18, 2017
57c3748
ANDROID: sdcardfs: ->iget fixes
drosen-google Apr 18, 2017
663d2dc
Android: sdcardfs: Don't do d_add for lower fs
drosen-google Apr 19, 2017
f2fe78d
Android: sdcardfs: Don't complain in fixup_lower_ownership
drosen-google Apr 19, 2017
4f5e8fc
Revert "Android: sdcardfs: Don't do d_add for lower fs"
drosen-google Apr 20, 2017
263f212
msm: kgsl: Allow draw context to perform only replay on recovery
Apr 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Documentation/networking/ip-sysctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1167,11 +1167,20 @@ accept_ra_pinfo - BOOLEAN
Functional default: enabled if accept_ra is enabled.
disabled if accept_ra is disabled.

accept_ra_rt_info_min_plen - INTEGER
Minimum prefix length of Route Information in RA.

Route Information w/ prefix smaller than this variable shall
be ignored.

Functional default: 0 if accept_ra_rtr_pref is enabled.
-1 if accept_ra_rtr_pref is disabled.

accept_ra_rt_info_max_plen - INTEGER
Maximum prefix length of Route Information in RA.

Route Information w/ prefix larger than or equal to this
variable shall be ignored.
Route Information w/ prefix larger than this variable shall
be ignored.

Functional default: 0 if accept_ra_rtr_pref is enabled.
-1 if accept_ra_rtr_pref is disabled.
Expand Down
5 changes: 5 additions & 0 deletions Documentation/printk-formats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Kernel Pointers:
users. The behaviour of %pK depends on the kptr_restrict sysctl - see
Documentation/sysctl/kernel.txt for more details.

%pP 0x01234567 or 0x0123456789abcdef

For printing kernel pointers which should always be shown, even to
unprivileged users.

Struct Resources:

%pr [mem 0x60000000-0x6fffffff flags 0x2200] or
Expand Down
9 changes: 9 additions & 0 deletions Documentation/sysctl/kernel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ values to unprivileged users is a concern.
When kptr_restrict is set to (2), kernel pointers printed using
%pK will be replaced with 0's regardless of privileges.

When kptr_restrict is set to (3), kernel pointers printed using
%p and %pK will be replaced with 0's regardless of privileges,
however kernel pointers printed using %pP will continue to be printed.

When kptr_restrict is set to (4), kernel pointers printed with
%p, %pK, %pa, and %p[rR] will be replaced with 0's regardless of
privileges. Kernel pointers printed using %pP will continue to be
printed.

==============================================================

kstack_depth_to_print: (X86 only)
Expand Down
18 changes: 18 additions & 0 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,24 @@ source "drivers/cpuidle/Kconfig"

endmenu

menu "Expermimental Security Enhancements"

config KUSER_HELPERS_SELECTIVE_DISABLE
bool "Disable KUSER_HELPERS selectively"
depends on ARM64
help
Kuser_Helpers is a set of functions in the vector page at a fixed address that
are used to support applications compiled for legacy ARM <7. These functions
being at a fixed address creates an ASLR bypass.

Do not enable this feature unless you know what you are doing, this is
experimental, and will break any application that uses the Kuser_Helpers or
registers a signal handler and uses the kernel trampolines.

If unsure, say N.

endmenu

source "net/Kconfig"

source "drivers/Kconfig"
Expand Down
6 changes: 6 additions & 0 deletions arch/arm64/configs/bullhead_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ CONFIG_IPC_ROUTER=y
CONFIG_IPC_ROUTER_SECURITY=y
CONFIG_CMA=y
CONFIG_ARM_CCI=y
CONFIG_PROC_DEVICETREE=y
CONFIG_ZRAM=y
CONFIG_ZRAM_LZ4_COMPRESS=y
CONFIG_BLK_DEV_LOOP=y
Expand Down Expand Up @@ -271,6 +272,7 @@ CONFIG_CNSS_PCI=y
CONFIG_CNSS_MAC_BUG=y
CONFIG_CLD_LL_CORE=y
CONFIG_BUS_AUTO_SUSPEND=y
CONFIG_CNSS_GENL=y
# CONFIG_INPUT_MOUSEDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_KEYBOARD_ATKBD is not set
Expand Down Expand Up @@ -314,6 +316,7 @@ CONFIG_SERIAL_MSM_HSL=y
CONFIG_SERIAL_MSM_HSL_CONSOLE=y
CONFIG_SERIAL_MSM_SMD=y
CONFIG_HW_RANDOM_MSM=y
# CONFIG_DEVPORT is not set
CONFIG_MSM_SMD_PKT=y
CONFIG_MSM_ADSPRPC=y
CONFIG_I2C=y
Expand Down Expand Up @@ -517,6 +520,7 @@ CONFIG_UIO_MSM_SHAREDMEM=y
CONFIG_STAGING=y
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder"
CONFIG_ASHMEM=y
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
CONFIG_ANDROID_INTF_ALARM_DEV=y
Expand Down Expand Up @@ -612,6 +616,8 @@ CONFIG_MSM_TZ_LOG=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_EXT4_FS_ENCRYPTION=y
CONFIG_QUOTA=y
# CONFIG_PRINT_QUOTA_WARNING is not set
CONFIG_FUSE_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
Expand Down
6 changes: 5 additions & 1 deletion arch/arm64/include/asm/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ static inline void decode_ctrl_reg(u32 reg,
/* Lengths */
#define ARM_BREAKPOINT_LEN_1 0x1
#define ARM_BREAKPOINT_LEN_2 0x3
#define ARM_BREAKPOINT_LEN_3 0x7
#define ARM_BREAKPOINT_LEN_4 0xf
#define ARM_BREAKPOINT_LEN_5 0x1f
#define ARM_BREAKPOINT_LEN_6 0x3f
#define ARM_BREAKPOINT_LEN_7 0x7f
#define ARM_BREAKPOINT_LEN_8 0xff

/* Kernel stepping */
Expand Down Expand Up @@ -107,7 +111,7 @@ struct perf_event;
struct pmu;

extern int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl,
int *gen_len, int *gen_type);
int *gen_len, int *gen_type, int *offset);
extern int arch_check_bp_in_kernelspace(struct perf_event *bp);
extern int arch_validate_hwbkpt_settings(struct perf_event *bp);
extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
Expand Down
153 changes: 115 additions & 38 deletions arch/arm64/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,21 @@ static int get_hbp_len(u8 hbp_len)
case ARM_BREAKPOINT_LEN_2:
len_in_bytes = 2;
break;
case ARM_BREAKPOINT_LEN_3:
len_in_bytes = 3;
break;
case ARM_BREAKPOINT_LEN_4:
len_in_bytes = 4;
break;
case ARM_BREAKPOINT_LEN_5:
len_in_bytes = 5;
break;
case ARM_BREAKPOINT_LEN_6:
len_in_bytes = 6;
break;
case ARM_BREAKPOINT_LEN_7:
len_in_bytes = 7;
break;
case ARM_BREAKPOINT_LEN_8:
len_in_bytes = 8;
break;
Expand Down Expand Up @@ -343,7 +355,7 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp)
* to generic breakpoint descriptions.
*/
int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl,
int *gen_len, int *gen_type)
int *gen_len, int *gen_type, int *offset)
{
/* Type */
switch (ctrl.type) {
Expand All @@ -363,17 +375,33 @@ int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl,
return -EINVAL;
}

if (!ctrl.len)
return -EINVAL;
*offset = __ffs(ctrl.len);

/* Len */
switch (ctrl.len) {
switch (ctrl.len >> *offset) {
case ARM_BREAKPOINT_LEN_1:
*gen_len = HW_BREAKPOINT_LEN_1;
break;
case ARM_BREAKPOINT_LEN_2:
*gen_len = HW_BREAKPOINT_LEN_2;
break;
case ARM_BREAKPOINT_LEN_3:
*gen_len = HW_BREAKPOINT_LEN_3;
break;
case ARM_BREAKPOINT_LEN_4:
*gen_len = HW_BREAKPOINT_LEN_4;
break;
case ARM_BREAKPOINT_LEN_5:
*gen_len = HW_BREAKPOINT_LEN_5;
break;
case ARM_BREAKPOINT_LEN_6:
*gen_len = HW_BREAKPOINT_LEN_6;
break;
case ARM_BREAKPOINT_LEN_7:
*gen_len = HW_BREAKPOINT_LEN_7;
break;
case ARM_BREAKPOINT_LEN_8:
*gen_len = HW_BREAKPOINT_LEN_8;
break;
Expand Down Expand Up @@ -417,9 +445,21 @@ static int arch_build_bp_info(struct perf_event *bp)
case HW_BREAKPOINT_LEN_2:
info->ctrl.len = ARM_BREAKPOINT_LEN_2;
break;
case HW_BREAKPOINT_LEN_3:
info->ctrl.len = ARM_BREAKPOINT_LEN_3;
break;
case HW_BREAKPOINT_LEN_4:
info->ctrl.len = ARM_BREAKPOINT_LEN_4;
break;
case HW_BREAKPOINT_LEN_5:
info->ctrl.len = ARM_BREAKPOINT_LEN_5;
break;
case HW_BREAKPOINT_LEN_6:
info->ctrl.len = ARM_BREAKPOINT_LEN_6;
break;
case HW_BREAKPOINT_LEN_7:
info->ctrl.len = ARM_BREAKPOINT_LEN_7;
break;
case HW_BREAKPOINT_LEN_8:
info->ctrl.len = ARM_BREAKPOINT_LEN_8;
break;
Expand Down Expand Up @@ -511,18 +551,17 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
default:
return -EINVAL;
}

info->address &= ~alignment_mask;
info->ctrl.len <<= offset;
} else {
if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE)
alignment_mask = 0x3;
else
alignment_mask = 0x7;
if (info->address & alignment_mask)
return -EINVAL;
offset = info->address & alignment_mask;
}

info->address &= ~alignment_mask;
info->ctrl.len <<= offset;

/*
* Disallow per-task kernel breakpoints since these would
* complicate the stepping code.
Expand Down Expand Up @@ -653,12 +692,47 @@ static int breakpoint_handler(unsigned long unused, unsigned int esr,
return 0;
}

/*
* Arm64 hardware does not always report a watchpoint hit address that matches
* one of the watchpoints set. It can also report an address "near" the
* watchpoint if a single instruction access both watched and unwatched
* addresses. There is no straight-forward way, short of disassembling the
* offending instruction, to map that address back to the watchpoint. This
* function computes the distance of the memory access from the watchpoint as a
* heuristic for the likelyhood that a given access triggered the watchpoint.
*
* See Section D2.10.5 "Determining the memory location that caused a Watchpoint
* exception" of ARMv8 Architecture Reference Manual for details.
*
* The function returns the distance of the address from the bytes watched by
* the watchpoint. In case of an exact match, it returns 0.
*/
static u64 get_distance_from_watchpoint(unsigned long addr, u64 val,
struct arch_hw_breakpoint_ctrl *ctrl)
{
u64 wp_low, wp_high;
u32 lens, lene;

lens = __ffs(ctrl->len);
lene = __fls(ctrl->len);

wp_low = val + lens;
wp_high = val + lene;
if (addr < wp_low)
return wp_low - addr;
else if (addr > wp_high)
return addr - wp_high;
else
return 0;
}

static int watchpoint_handler(unsigned long addr, unsigned int esr,
struct pt_regs *regs)
{
int i, step = 0, *kernel_step, access;
int i, step = 0, *kernel_step, access, closest_match = 0;
u64 min_dist = -1, dist;
u32 ctrl_reg;
u64 val, alignment_mask;
u64 val;
struct perf_event *wp, **slots;
struct debug_info *debug_info;
struct arch_hw_breakpoint *info;
Expand All @@ -667,35 +741,15 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr,
slots = this_cpu_ptr(wp_on_reg);
debug_info = &current->thread.debug;

/*
* Find all watchpoints that match the reported address. If no exact
* match is found. Attribute the hit to the closest watchpoint.
*/
rcu_read_lock();
for (i = 0; i < core_num_wrps; ++i) {
rcu_read_lock();

wp = slots[i];

if (wp == NULL)
goto unlock;

info = counter_arch_bp(wp);
/* AArch32 watchpoints are either 4 or 8 bytes aligned. */
if (is_compat_task()) {
if (info->ctrl.len == ARM_BREAKPOINT_LEN_8)
alignment_mask = 0x7;
else
alignment_mask = 0x3;
} else {
alignment_mask = 0x7;
}

/* Check if the watchpoint value matches. */
val = read_wb_reg(AARCH64_DBG_REG_WVR, i);
if (val != (addr & ~alignment_mask))
goto unlock;

/* Possible match, check the byte address select to confirm. */
ctrl_reg = read_wb_reg(AARCH64_DBG_REG_WCR, i);
decode_ctrl_reg(ctrl_reg, &ctrl);
if (!((1 << (addr & alignment_mask)) & ctrl.len))
goto unlock;
continue;

/*
* Check that the access type matches.
Expand All @@ -704,18 +758,41 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr,
access = (esr & AARCH64_ESR_ACCESS_MASK) ? HW_BREAKPOINT_W :
HW_BREAKPOINT_R;
if (!(access & hw_breakpoint_type(wp)))
goto unlock;
continue;

/* Check if the watchpoint value and byte select match. */
val = read_wb_reg(AARCH64_DBG_REG_WVR, i);
ctrl_reg = read_wb_reg(AARCH64_DBG_REG_WCR, i);
decode_ctrl_reg(ctrl_reg, &ctrl);
dist = get_distance_from_watchpoint(addr, val, &ctrl);
if (dist < min_dist) {
min_dist = dist;
closest_match = i;
}
/* Is this an exact match? */
if (dist != 0)
continue;

info = counter_arch_bp(wp);
info->trigger = addr;
perf_bp_event(wp, regs);

/* Do we need to handle the stepping? */
if (!wp->overflow_handler)
step = 1;
}
if (min_dist > 0 && min_dist != -1) {
/* No exact match found. */
wp = slots[closest_match];
info = counter_arch_bp(wp);
info->trigger = addr;
perf_bp_event(wp, regs);

unlock:
rcu_read_unlock();
/* Do we need to handle the stepping? */
if (!wp->overflow_handler)
step = 1;
}
rcu_read_unlock();

if (!step)
return 0;
Expand Down
Loading