diff options
| author | Alex Markuze <amarkuze@redhat.com> | 2024-11-27 15:34:10 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-27 14:02:19 +0100 |
| commit | 28433d0b7b29558fb3543fa49bfd675c8fe80edd (patch) | |
| tree | f802983a41710ab1f473afab285c580f601f245a /scripts/git.orderFile | |
| parent | ddbbc04989f0f2097b91004cf4fb0e1063939100 (diff) | |
| download | linux-28433d0b7b29558fb3543fa49bfd675c8fe80edd.tar.gz linux-28433d0b7b29558fb3543fa49bfd675c8fe80edd.tar.bz2 linux-28433d0b7b29558fb3543fa49bfd675c8fe80edd.zip | |
ceph: improve error handling and short/overflow-read logic in __ceph_sync_read()
commit 9abee475803fab6ad59d4f4fc59c6a75374a7d9d upstream.
This patch refines the read logic in __ceph_sync_read() to ensure more
predictable and efficient behavior in various edge cases.
- Return early if the requested read length is zero or if the file size
(`i_size`) is zero.
- Initialize the index variable (`idx`) where needed and reorder some
code to ensure it is always set before use.
- Improve error handling by checking for negative return values earlier.
- Remove redundant encrypted file checks after failures. Only attempt
filesystem-level decryption if the read succeeded.
- Simplify leftover calculations to correctly handle cases where the
read extends beyond the end of the file or stops short. This can be
hit by continuously reading a file while, on another client, we keep
truncating and writing new data into it.
- This resolves multiple issues caused by integer and consequent buffer
overflow (`pages` array being accessed beyond `num_pages`):
- https://tracker.ceph.com/issues/67524
- https://tracker.ceph.com/issues/68980
- https://tracker.ceph.com/issues/68981
Cc: stable@vger.kernel.org
Fixes: 1065da21e5df ("ceph: stop copying to iter at EOF on sync reads")
Reported-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Signed-off-by: Alex Markuze <amarkuze@redhat.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/git.orderFile')
0 files changed, 0 insertions, 0 deletions
