Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 97e0a57e authored by Eric Biggers's avatar Eric Biggers Committed by Bernhard Thoben
Browse files

UPSTREAM: KEYS: encrypted: fix buffer overread in valid_master_desc()



With the 'encrypted' key type it was possible for userspace to provide a
data blob ending with a master key description shorter than expected,
e.g. 'keyctl add encrypted desc "new x" @s'.  When validating such a
master key description, validate_master_desc() could read beyond the end
of the buffer.  Fix this by using strncmp() instead of memcmp().  [Also
clean up the code to deduplicate some logic.]

Cc: linux-stable <stable@vger.kernel.org> # 3.18.y
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
Bug: 70526974
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
Signed-off-by: default avatarJin Qian <jinqian@google.com>
Signed-off-by: default avatarSteve Pfetsch <spfetsch@google.com>
(cherry picked from commit 794b4bc292f5d31739d89c0202c54e7dc9bc3add)

Change-Id: I1c7346912feb76f3d6dab6c83c108e5ff59ca78e
parent 99df30f8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment