kernel-fxtec-pro1x/Documentation
Eric Biggers e470a75ebe BACKPORT: FROMLIST: fscrypt: add support for IV_INO_LBLK_32 policies
The eMMC inline crypto standard will only specify 32 DUN bits (a.k.a. IV
bits), unlike UFS's 64.  IV_INO_LBLK_64 is therefore not applicable, but
an encryption format which uses one key per policy and permits the
moving of encrypted file contents (as f2fs's garbage collector requires)
is still desirable.

To support such hardware, add a new encryption format IV_INO_LBLK_32
that makes the best use of the 32 bits: the IV is set to
'SipHash-2-4(inode_number) + file_logical_block_number mod 2^32', where
the SipHash key is derived from the fscrypt master key.  We hash only
the inode number and not also the block number, because we need to
maintain contiguity of DUNs to merge bios.

Unlike with IV_INO_LBLK_64, with this format IV reuse is possible; this
is unavoidable given the size of the DUN.  This means this format should
only be used where the requirements of the first paragraph apply.
However, the hash spreads out the IVs in the whole usable range, and the
use of a keyed hash makes it difficult for an attacker to determine
which files use which IVs.

Besides the above differences, this flag works like IV_INO_LBLK_64 in
that on ext4 it is only allowed if the stable_inodes feature has been
enabled to prevent inode numbers and the filesystem UUID from changing.

Signed-off-by: Eric Biggers <ebiggers@google.com>

Link: https://lore.kernel.org/r/20200515204141.251098-1-ebiggers@kernel.org

(Resolved conflicts with inline encryption support.  Besides the
 necessary "straightforward" merge resolutions, also made
 fscrypt_get_dun_bytes() aware of IV_INO_LBLK_32 and made IV_INO_LBLK_32
 usable with wrapped keys.)

Test: 'atest vts_kernel_encryption_test' on Cuttlefish with
      the IV_INO_LBLK_32 test added (http://aosp/1315024).

      Also tested enabling this in the fstab for Cuttlefish
      (using http://aosp/1315886).

      Also ran 'kvm-xfstests -c ext4,f2fs -g encrypt', including my
      work-in-progress xfstest for IV_INO_LBLK_32.

Bug: 144046242
Change-Id: I57df71d502bde0475efc906a0812102063ff2f2a
Signed-off-by: Eric Biggers <ebiggers@google.com>
Git-commit: 4286f44bea
Git-repo: https://android.googlesource.com/kernel/common/+/refs/heads/android-4.19
[neersoni@codeaurora.org: back ported and fixed the merged conflict]
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2020-07-25 21:10:18 +05:30
..
ABI Merge wakeup_source changes into msm-4.19 2020-05-23 05:22:24 -07:00
accelerators ocxl: Document new OCXL IOCTLs 2018-06-03 20:40:33 +10:00
accounting FROMLIST: psi: introduce psi monitor 2019-03-22 23:07:14 +00:00
acpi ACPI: property: graph: Update graph documentation to use generic references 2018-07-23 12:44:52 +02:00
admin-guide Merge android-4.19.112 (417d28a) into msm-4.19 2020-07-16 16:22:32 +05:30
aoe
arm msm: rdbg: Add snapshot of remote debugger driver 2019-06-08 10:30:42 +05:30
arm64 Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
auxdisplay Doc: misc-devices: move lcd-panel-cgram.txt to auxdisplay/ 2018-04-12 16:08:02 +02:00
backlight
block File and metadata encryption changes from android-4.19.96-107 2020-04-21 06:19:04 -07:00
blockdev zram: make deduplication feature optional 2019-08-01 22:24:02 -07:00
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2018-08-07 11:02:05 -07:00
bus-devices
cdrom
cgroup-v1 page cache: use xa_lock 2018-04-11 10:28:39 -07:00
cma
connector
console Documentation: corrections to console/console.txt 2018-08-10 16:09:40 -06:00
core-api idr: Change documentation license 2018-10-15 16:31:29 -04:00
cpu-freq cpufreq: Drop cpufreq_table_validate_and_show() 2018-04-10 08:40:45 +02:00
cpuidle cpuidle: Add definition of residency to sysfs documentation 2018-04-09 13:44:37 +02:00
crypto Revert existing FBE changes for ICE FBE 2020-04-24 15:19:09 -07:00
dev-tools UPSTREAM: kcov: fix struct layout for kcov_remote_arg 2020-01-15 14:52:07 +00:00
device-mapper Merge android-4.19.32 (6f994bf) into msm-4.19 2019-05-09 00:12:14 -07:00
devicetree Revert "UPSTREAM: dt-bindings: arm: coresight: Add support for coresight-loses-context-with-cpu" 2020-03-23 03:28:54 -07:00
doc-guide Documentation/sphinx: allow "functions" with no parameters 2018-06-30 07:52:42 -06:00
driver-api Merge android-4.19.112 (417d28a) into msm-4.19 2020-07-16 16:22:32 +05:30
driver-model FROMGIT: docs: driver-model: Add documentation for sync_state 2019-10-24 14:23:14 -07:00
early-userspace initramfs: move gen_initramfs_list.sh from scripts/ to usr/ 2018-08-22 23:21:44 +09:00
EDID
extcon
fault-injection Documentation: nvme: Documentation for nvme fault injection 2018-03-26 08:53:43 -06:00
fb uvesafb: Fix URLs in the documentation 2018-09-26 18:11:23 +02:00
features ARM: 8777/1: Hook up SYNC_CORE functionality for sys_membarrier() 2018-07-11 11:02:08 +01:00
filesystems BACKPORT: FROMLIST: fscrypt: add support for IV_INO_LBLK_32 policies 2020-07-25 21:10:18 +05:30
firmware_class
fmc
fpga docs: fpga: add a document for FPGA Device Feature List (DFL) Framework Overview 2018-07-15 13:55:44 +02:00
gpio Documentation: gpio: Move drivers-on-gpio.txt to driver-api 2018-03-23 04:22:29 +01:00
gpu drm/msm/gpu: Add the buffer objects from the submit to the crash dump 2018-07-30 08:50:10 -04:00
hid HID: doc: fix wrong data structure reference for UHID_OUTPUT 2019-12-05 09:20:36 +01:00
hwmon hwmon: (ina2xx) fix sysfs shunt resistor read access 2018-08-26 17:45:25 -07:00
i2c i2c: i801: Add support for Intel Comet Lake 2019-05-04 09:20:15 +02:00
ia64
ide
iio
infiniband
input input: add MT_TOOL_DIAL 2018-07-17 15:33:47 +02:00
ioctl Char/Misc driver patches for 4.19-rc1 2018-08-18 11:04:51 -07:00
isdn Documentation/isdn: check and fix dead links ... 2018-03-26 12:31:13 -04:00
kbuild kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt 2018-08-22 23:21:42 +09:00
kdump
kernel-hacking doc:it_IT: translation for kernel-hacking 2018-07-26 16:21:09 -06:00
laptops platform/x86: thinkpad_acpi: silence HKEY 0x6032, 0x60f0, 0x6030 2018-05-07 15:10:31 +03:00
leds
lightnvm
livepatch livepatch: Remove not longer valid limitations from the documentation 2018-05-24 15:37:57 +02:00
locking locking: Implement an algorithm choice for Wound-Wait mutexes 2018-07-03 09:44:36 +02:00
m68k
maintainer docs: Fix more broken references 2018-06-15 18:11:26 -03:00
md
media media: replace ADOBERGB by OPRGB 2018-11-13 11:08:54 -08:00
memory-devices
mic
mips
misc-devices pci_endpoint_test: Add 2 ioctl commands 2018-07-19 11:46:57 +01:00
mmc Revert "mmc: driver's changes from kernel msm-4.14 to msm-4.19" 2019-05-13 13:12:22 +05:30
mtd
namespaces
netlabel
networking Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
nfc
nios2
nvdimm
nvmem
openrisc
parisc
PCI Merge branch 'remotes/lorenzo/pci/dwc' 2018-08-15 14:59:11 -05:00
pcmcia pcmcia: remove long deprecated pcmcia_request_exclusive_irq() function 2018-08-18 12:30:42 -07:00
perf perf: add qcom l2 cache perf events driver 2019-12-26 12:45:54 +05:30
phy
platform
power Merge android-4.19.28 (34e9e65) into msm-4.19 2019-03-21 01:48:12 -07:00
powerpc powerpc: Document issues with TM on POWER9 2018-07-02 23:54:29 +10:00
pps
process stable-kernel-rules.rst: add link to networking patch queue 2019-03-23 20:10:10 +01:00
pti
ptp ptp: Fix documentation to match code. 2018-03-26 12:13:21 -04:00
rapidio
RCU rculist: Improve documentation for list_for_each_entry_from_rcu() 2018-07-12 15:39:25 -07:00
riscv perf: riscv: Add Document for Future Porting Guide 2018-06-04 14:02:11 -07:00
s390
scheduler ANDROID: sched/tune: Move SchedTune cpu API into UtilClamp wrappers 2020-02-01 15:03:17 +00:00
scsi scsi: documentation: add scsi_mod.use_blk_mq to scsi-parameters 2018-08-27 12:26:10 -04:00
security Kbuild: rename CC_STACKPROTECTOR[_STRONG] config variables 2018-06-14 12:21:18 +09:00
serial
sh
sound ALSA: compress: Add support to send codec specific data 2018-09-22 05:56:18 -07:00
sparc
sphinx doc: Cope with Sphinx logging deprecations 2019-06-09 09:17:21 +02:00
sphinx-static
spi
sysctl Restore "ANDROID: security,perf: Allow further restriction of perf_event_open" 2020-06-01 03:37:43 -07:00
target
thermal thermal: Add cooling device's statistics in sysfs 2018-04-02 21:49:01 +08:00
timers timekeeping.txt: Correct maxCount of n-bit binary counter 2018-07-23 09:33:06 -06:00
trace This was a moderately busy cycle for docs, with the usual collection of 2018-08-14 14:29:31 -07:00
translations This was a moderately busy cycle for docs, with the usual collection of 2018-08-14 14:29:31 -07:00
usb BACKPORT: usb: gadget: add raw-gadget interface 2020-03-31 17:40:01 +02:00
userspace-api Documentation: Add section about CPU vulnerabilities for Spectre 2019-07-14 08:11:17 +02:00
virtual kvm: Convert kvm_lock to a mutex 2019-11-12 19:21:40 +01:00
vm docs/vm: move ksm and transhuge from "user" to "internals" section. 2018-05-29 06:45:55 -06:00
w1 w1: fix w1_ds2438 documentation 2018-07-07 17:27:13 +02:00
watchdog watchdog: remove bfin_wdt driver 2018-03-26 15:57:04 +02:00
wimax
x86 x86/speculation/taa: Add documentation for TSX Async Abort 2019-11-12 19:21:34 +01:00
xtensa
.gitignore
00-INDEX docs: admin-guide: add cgroup-v2 documentation 2018-05-10 15:42:41 -06:00
atomic_bitops.txt
atomic_t.txt x86/atomic: Fix smp_mb__{before,after}_atomic() 2019-07-26 09:14:08 +02:00
bt8xxgpio.txt
btmrvl.txt
bus-virt-phys-mapping.txt
Changes
clearing-warn-once.txt
CodingStyle
conf.py docs: Fix conf.py for Sphinx 2.0 2019-06-09 09:17:20 +02:00
cpu-load.txt
cputopology.txt
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt Documentation: remove stale firmware API reference 2018-05-14 16:44:41 +02:00
digsig.txt
DMA-API-HOWTO.txt
DMA-API.txt
DMA-attributes.txt iommu/arm-smmu: Merge of smmu changes from 4.14 to msm-kona 2018-07-19 19:33:35 -07:00
DMA-ISA-LPC.txt
docutils.conf
dontdiff unicode: refactor the rule for regenerating utf8data.h 2019-09-23 13:23:29 -07:00
efi-stub.txt
eisa.txt
flexible-arrays.txt
futex-requeue-pi.txt
gcc-plugins.txt
highuid.txt
hw_random.txt
hwspinlock.txt
index.rst x86/speculation/mds: Add mds_clear_cpu_buffers() 2019-05-14 19:17:54 +02:00
Intel-IOMMU.txt
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt block: Track DISCARD statistics and output them in stat and diskstat 2018-07-18 08:44:22 -06:00
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
isa.txt
isapnp.txt
kernel-per-CPU-kthreads.txt
kobject.txt
kprobes.txt kprobes/Documentation: Fix various typos 2018-06-22 11:10:55 +02:00
kref.txt
ldm.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lsm.txt
lzo.txt
mailbox.txt
Makefile
memory-barriers.txt sched/Documentation: Update wake_up() & co. memory-barrier guarantees 2018-07-17 09:30:34 +02:00
memory-hotplug.txt
men-chameleon-bus.txt
mhi.txt mhi: add snapshot for MHI driver stack 2018-09-13 13:00:59 -07:00
nommu-mmap.txt Documentation: nommu-map: Fix duplicate word typo 2018-06-26 09:01:27 -06:00
ntb.txt
numastat.txt
padata.txt
parport-lowlevel.txt
percpu-rw-semaphore.txt
phy.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
pwm.txt
rbtree.txt
remoteproc.txt
rfkill.txt rfkill: Fix several typos in documentation 2018-06-15 13:36:08 +02:00
robust-futex-ABI.txt
robust-futexes.txt futex: Update comments and docs about return values of arch futex code 2019-07-03 13:14:49 +02:00
rpmsg.txt
rtc.txt
SAK.txt
sgi-ioc4.txt
siphash.txt
SM501.txt
smsc_ece1099.txt
speculation.txt
static-keys.txt
SubmittingPatches
svga.txt
switchtec.txt
sync_file.txt
tee.txt
this_cpu_ops.txt
unaligned-memory-access.txt
vfio-mediated-device.txt vfio/mdev: Check globally for duplicate devices 2018-06-08 10:24:27 -06:00
vfio.txt vfio: fix documentation 2018-05-08 09:16:41 -06:00
video-output.txt
xillybus.txt
xz.txt
zorro.txt