mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
ecryptfs: fix tag 11 packet exact-fit size check
parse_tag_11_packet() rejects a packet when the already-consumed tag and
length bytes plus the packet body exceed the caller supplied maximum
packet size. The check currently adds one extra byte, even though
*packet_size already includes the tag byte before the length is parsed.
Remove the extra byte so a tag 11 packet that exactly fits the available
buffer is accepted while oversized packets are still rejected.
Fixes: 237fead619 ("[PATCH] ecryptfs: fs/Makefile and fs/Kconfig")
Cc: <stable@vger.kernel.org>
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Signed-off-by: Tyler Hicks <code@tyhicks.com>
This commit is contained in:
parent
2602b79c5b
commit
8b2ec0f56f
|
|
@ -1547,7 +1547,7 @@ parse_tag_11_packet(unsigned char *data, unsigned char *contents,
|
|||
}
|
||||
(*packet_size) += length_size;
|
||||
(*tag_11_contents_size) = (body_size - 14);
|
||||
if (unlikely((*packet_size) + body_size + 1 > max_packet_size)) {
|
||||
if (unlikely((*packet_size) + body_size > max_packet_size)) {
|
||||
printk(KERN_ERR "Packet size exceeds max\n");
|
||||
rc = -EINVAL;
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user