~kmously/ubuntu/+source/linux/+git/xenial:master-next

Last commit made on 2017-11-13
Get this branch:
git clone -b master-next https://git.launchpad.net/~kmously/ubuntu/+source/linux/+git/xenial
Only Khaled El Mously can upload to this branch. If you are Khaled El Mously please log in for upload directions.

Branch merges

Branch information

Name:
master-next
Repository:
lp:~kmously/ubuntu/+source/linux/+git/xenial

Recent commits

bc42197... by Khaled El Mously

UBUNTU: Ubuntu-4.4.0-101.124

Signed-off-by: Khalid Elmously <email address hidden>

733e925... by Gerald Schaefer <email address hidden>

s390/mm: fix write access check in gup_huge_pmd()

BugLink: http://bugs.launchpad.net/bugs/1730596

The check for the _SEGMENT_ENTRY_PROTECT bit in gup_huge_pmd() is the
wrong way around. It must not be set for write==1, and not be checked for
write==0. Fix this similar to how it was fixed for ptes long time ago in
commit 25591b070336 ("[S390] fix get_user_pages_fast").

One impact of this bug would be unnecessarily using the gup slow path for
write==0 on r/w mappings. A potentially more severe impact would be that
gup_huge_pmd() will succeed for write==1 on r/o mappings.

Cc: <email address hidden>
Signed-off-by: Gerald Schaefer <email address hidden>
Signed-off-by: Martin Schwidefsky <email address hidden>
(back ported from commit ba385c0594e723d41790ecfb12c610e6f90c7785)
Signed-off-by: Joseph Salisbury <email address hidden>
Acked-by: Kamal Mostafa <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

3602bc4... by Khaled El Mously

UBUNTU: Start new release

Ignore: yes
Signed-off-by: Khalid Elmously <email address hidden>

86487bb... by Thadeu Lima de Souza Cascardo

UBUNTU: Ubuntu-4.4.0-100.123

Signed-off-by: Thadeu Lima de Souza Cascardo <email address hidden>

e6d90ad... by Greg Kroah-Hartman <email address hidden>

Linux 4.4.95

BugLink: http://bugs.launchpad.net/bugs/1729107

1ce152d... by Eric Biggers <email address hidden>

FS-Cache: fix dereference of NULL user_key_payload

BugLink: http://bugs.launchpad.net/bugs/1729107

commit d124b2c53c7bee6569d2a2d0b18b4a1afde00134 upstream.

When the file /proc/fs/fscache/objects (available with
CONFIG_FSCACHE_OBJECT_LIST=y) is opened, we request a user key with
description "fscache:objlist", then access its payload. However, a
revoked key has a NULL payload, and we failed to check for this.
request_key() *does* skip revoked keys, but there is still a window
where the key can be revoked before we access its payload.

Fix it by checking for a NULL payload, treating it like a key which was
already revoked at the time it was requested.

Fixes: 4fbf4291aa15 ("FS-Cache: Allow the current state of all objects to be dumped")
Reviewed-by: James Morris <email address hidden>
Signed-off-by: Eric Biggers <email address hidden>
Signed-off-by: David Howells <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

2d0ebb0... by Eric Biggers <email address hidden>

fscrypto: require write access to mount to set encryption policy

BugLink: http://bugs.launchpad.net/bugs/1729107

commit ba63f23d69a3a10e7e527a02702023da68ef8a6d upstream.

[Please apply to 4.4-stable. Note: this was already backported, but
only to ext4; it was missed that it should go to f2fs as well. This is
needed to make xfstest generic/395 pass on f2fs.]

Since setting an encryption policy requires writing metadata to the
filesystem, it should be guarded by mnt_want_write/mnt_drop_write.
Otherwise, a user could cause a write to a frozen or readonly
filesystem. This was handled correctly by f2fs but not by ext4. Make
fscrypt_process_policy() handle it rather than relying on the filesystem
to get it right.

Signed-off-by: Eric Biggers <email address hidden>
Signed-off-by: Theodore Ts'o <email address hidden>
Acked-by: Jaegeuk Kim <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

cc759ca... by David Howells

KEYS: Fix race between updating and finding a negative key

BugLink: http://bugs.launchpad.net/bugs/1729107

commit 363b02dab09b3226f3bd1420dad9c72b79a42a76 upstream.

Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the rejection
error into one field such that:

 (1) The instantiation state can be modified/read atomically.

 (2) The error can be accessed atomically with the state.

 (3) The error isn't stored unioned with the payload pointers.

This deals with the problem that the state is spread over three different
objects (two bits and a separate variable) and reading or updating them
atomically isn't practical, given that not only can uninstantiated keys
change into instantiated or rejected keys, but rejected keys can also turn
into instantiated keys - and someone accessing the key might not be using
any locking.

The main side effect of this problem is that what was held in the payload
may change, depending on the state. For instance, you might observe the
key to be in the rejected state. You then read the cached error, but if
the key semaphore wasn't locked, the key might've become instantiated
between the two reads - and you might now have something in hand that isn't
actually an error code.

The state is now KEY_IS_UNINSTANTIATED, KEY_IS_POSITIVE or a negative error
code if the key is negatively instantiated. The key_is_instantiated()
function is replaced with key_is_positive() to avoid confusion as negative
keys are also 'instantiated'.

Additionally, barriering is included:

 (1) Order payload-set before state-set during instantiation.

 (2) Order state-read before payload-read when using the key.

Further separate barriering is necessary if RCU is being used to access the
payload content after reading the payload pointers.

Fixes: 146aa8b1453b ("KEYS: Merge the type-specific data with the payload data")
Reported-by: Eric Biggers <email address hidden>
Signed-off-by: David Howells <email address hidden>
Reviewed-by: Eric Biggers <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

1469bf4... by Eric Biggers <email address hidden>

fscrypt: fix dereference of NULL user_key_payload

BugLink: http://bugs.launchpad.net/bugs/1729107

commit d60b5b7854c3d135b869f74fb93eaf63cbb1991a upstream.

When an fscrypt-encrypted file is opened, we request the file's master
key from the keyrings service as a logon key, then access its payload.
However, a revoked key has a NULL payload, and we failed to check for
this. request_key() *does* skip revoked keys, but there is still a
window where the key can be revoked before we acquire its semaphore.

Fix it by checking for a NULL payload, treating it like a key which was
already revoked at the time it was requested.

Fixes: 88bd6ccdcdd6 ("ext4 crypto: add encryption key management facilities")
Reviewed-by: James Morris <email address hidden>
Cc: <email address hidden> [v4.1+]
Signed-off-by: Eric Biggers <email address hidden>
Signed-off-by: David Howells <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

3939cbb... by Jaegeuk Kim <email address hidden>

f2fs crypto: add missing locking for keyring_key access

BugLink: http://bugs.launchpad.net/bugs/1729107

commit 745e8490b1e960ad79859dd8ba6a0b5a8d3d994e upstream.

This patch adopts:
 ext4 crypto: add missing locking for keyring_key access

Signed-off-by: Theodore Ts'o <email address hidden>
Signed-off-by: Jaegeuk Kim <email address hidden>
Signed-off-by: Eric Biggers <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>