| CVE |
Vendors |
Products |
Updated |
CVSS v3.1 |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: compare owner and group SIDs using their encoded lengths
populate_new_aces() compares owner and group SIDs over sizeof(struct
smb_sid), including storage for all 15 possible subauthorities. Received
SIDs contain only their encoded subauthorities. The comparison can read
past the security descriptor, as shown by the supplied KASAN report for
a 44-byte descriptor during chmod.
The input SIDs have already been checked by sid_from_sd(). Require equal
subauthority counts, then compare only the fixed SID header and the
encoded subauthorities with memcmp(). The count check ensures that both
validated SIDs contain the number of bytes being compared.
These issues were discovered and fixed by Qihoo 360's Tulongfeng
multi-agent system. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: don't block dying tasks waiting for writeback on fsync
cifs_fsync() and cifs_strict_fsync() wait uninterruptibly for writeback
through file_write_and_wait_range(). As with close, a task killed in
fsync(2) on a hard mount with an unresponsive server is stuck in D state
until the server comes back.
Wait killably instead, using the same helper as cifs_flush(). The
writeback keeps going and its errors stay in the mapping; only the dying
caller stops waiting for it. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix OOB write when compounding SMB2_IOCTL with encryption
On an encrypted ("seal") mount, SMB2_ioctl_init() keeps the IOCTL input
in a separate iov (iov[1]); iov[0] is a 448-byte buffer from
cifs_small_buf_get(). When such an IOCTL is not the last request of a
compound, smb2_set_next_command() pads it for alignment by copying the
whole request into iov[0]. A large enough input overflows that 448-byte
buffer and corrupts the slab; the copy also sets rq_nvec to 1, so the
input buffer is leaked too.
An unprivileged user can trigger it by creating a symlink with a long
target on such a mount: the native symlink is sent as
FSCTL_SET_REPARSE_POINT + QUERY_INFO + CLOSE in one compound, so the
IOCTL is not the last request.
With slub_debug red zones on the cifs_small_rq cache, the overflow is
caught on the next allocation from that cache in the same compound (the
0x61 bytes are the 'a' characters of the symlink target):
BUG cifs_small_rq (Not tainted): Object corrupt
[Left Redzone overwritten] 0xffff8a59c7790500-0xffff8a59c779053f
First byte 0x61 instead of 0xbb
Call Trace:
check_object+0x1a8/0x350
alloc_debug_processing+0xab/0x110
___slab_alloc+0x7e/0x2f0
kmem_cache_alloc_noprof+0x28d/0x4b0
mempool_alloc_slab+0x16/0x30
cifs_small_buf_get+0x1a/0x30 [cifs]
SMB2_close_init+0x8a/0x100 [cifs]
smb2_compound_op+0x2571/0x2b50 [cifs]
smb2_create_reparse_inode+0x27e/0x490 [cifs]
mknod_nfs+0x1ce/0x2e0 [cifs]
create_reparse_symlink+0x119/0x180 [cifs]
cifs_symlink+0x19f/0x8e0 [cifs]
vfs_symlink+0xa3/0x1b0
__x64_sys_symlink+0x41/0x70
Pad the input to a multiple of 8 bytes when encryption is required. The
request is then already aligned and smb2_set_next_command() no longer
copies it; InputCount still carries the real length. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix out-of-bounds read in dfs_parse_target_referral()
dfs_parse_target_referral() decides whether a prefix path remains after
the consumed part of full_path with:
if (strlen(full_path) - ref->path_consumed)
strlen() returns size_t, so if path_consumed is larger than the length
of full_path, the subtraction wraps around to a huge non-zero value.
The branch is then taken, prepath is set to a pointer past the
terminating NUL of full_path, and *prepath reads out of bounds.
path_consumed can exceed strlen(full_path) when the mount charset is
not utf8. The referral code derives path_consumed from the canonical
path, which is in the DFS cache charset (utf8), but it is applied here
to full_path, which is in the mount charset. Each non-ASCII character
in the consumed part of the path that is longer in utf8 than in the
mount charset makes the count too large by the difference.
This was reproduced with iocharset=iso8859-1 against a Samba DFS root
containing a link named "café", mounting with the single Latin-1 byte
0xe9 in the path. On an unmodified tree such a mount fails earlier
with -ENOENT because the path is converted to utf8 twice in
setup_dfs_ref(); with that fixed ("smb: client: fix double conversion
of DFS path in setup_dfs_ref()"), the mount reaches this code.
full_path was 29 bytes while path_consumed was 30:
BUG: KASAN: slab-out-of-bounds in dfs_parse_target_referral+0x26a/0x270
Read of size 1 at addr ffff88810db89d5f by task mount/1743
...
The buggy address is located 0 bytes to the right of
allocated 31-byte region [ffff88810db89d40, ffff88810db89d5f)
Compare path_consumed against the string length instead of subtracting,
so that no prefix path is used when the consumed count covers the whole
string. With the bounds check in place the same mount succeeds and no
KASAN report is produced.
This only prevents the out-of-bounds access. path_consumed is still in
the wrong units, so a non-ASCII link followed by a path component can
still produce a wrong prefix path. That needs a separate fix. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: hold server ref while queueing reconnect work
When query_server_interfaces() returns -EOPNOTSUPP on a secondary
channel, smb2_reconnect() calls smb3_update_ses_channels() which for a
channel runs cifs_chan_skip_or_disable(). That clears the channel's
slot in the session and calls cifs_put_tcp_session(), which can drop
the last reference of the channel and tear it down.
smb2_reconnect() then falls through to skip_add_channels and queues
reconnect work on that server, using a server that may already be
freed. The send path obtained the channel from cifs_pick_channel(),
which does not take a reference, so the session's channel reference is
the only one.
Take our own reference on the channel before calling
smb3_update_ses_channels() and drop it after the reconnect work has
been queued, so the channel cannot be freed while it is still used. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: issue writes from a worker if the task is dying
A task with a fatal signal pending can't send on the socket:
__smb_send_rqst() refuses it upfront with -ERESTARTSYS, as SIGKILL can't
be blocked and a send interrupted halfway forces a reconnect. Writeback,
however, runs in the context of whoever starts it, so when a dying task
flushes dirty pages - close() racing with SIGKILL, or fd teardown during
exit_group() - every write subrequest gets refused:
smb3_write_err: ... offset=0x1400000 len=0x400000 rc=-512
cifs_flush_err: ino=... rc=-512
Since the switch to netfslib, a failed upload ends writeback with the
folios clean, so the data is silently lost: the server ends up with
20MiB of a 64MiB file while stat(2) reports the full size.
Issue writeback subrequests of dying tasks from a new cifswritebackd
workqueue instead, like afs does for all of its writes, so they get sent
from a context with no signals. Leave direct and unbuffered writes
alone, as their callers get the error. Use a dedicated WQ_UNBOUND
workqueue as the writes may block for long on credits, sends or reopens,
e.g. on hard mounts with an unresponsive server, and must not hold up
other cifs work such as reconnects, nor starve the WQ_MEM_RECLAIM
rescuer of cifsiod_wq. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: let umount -f abort retried reads and writes
umount -f only wakes up tasks waiting on the server's queues. Reads and
writes being retried - forever on hard mounts - keep going, so with the
server gone the unmount still hangs in sync_filesystem() waiting for
their writeback. NFS kills outstanding RPCs on umount -f instead.
Count umount -f attempts per superblock and have each read and write
request remember the count it started with. Fail with -EIO, rather than
retry, reissue, issue or wait for credits, any subrequest of a request
that predates a umount -f once it is a retry or the server or share is
disconnected; a kworker doing writeback can't be signalled out of the
credit wait otherwise. First attempts on a connected server still go
ahead, and requests started later aren't aborted (but see below), so
I/O on a healthy server keeps working if the unmount then fails with
-EBUSY or only detaches one of several mounts.
retry_count is not bumped yet when netfs_retry_write_stream() calls
prepare_write() for the first retry, so don't rely on it alone to tell a
reissue from a first attempt: treat a subrequest as a retry when it
already carries an xid (it has been prepared before) in
prepare_write()/prepare_read(), or when its replay flag is set in
cifs_io_aborted(), and abort it when the mount is going away even if the
connection still looks healthy.
Requests created after umount -f - writeback kicked off by the background
flusher, an oplock break or sync_filesystem() during the final teardown -
snapshot the already bumped count and would otherwise retry forever on a
hard mount, hanging cifs_kill_sb(). Once a superblock that saw a umount
-f reaches cifs_kill_sb() the mount is going away for good, so flag it and
stop retrying I/O on it too; one that never saw a umount -f still
flushes as before.
A sync(2) or syncfs() waiting under s_umount for writeback started after
umount -f would still keep the unmount from reaching cifs_kill_sb(), so
also stop retrying such I/O while s_umount is contended. After a failed
umount -f, that also stops reads and writes retrying while a remount,
freeze or new mount of the same superblock waits on s_umount. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: retry writeback on interrupts and allocation failures
Issuing writes from a worker only helps when the task is already dying
at issue time. A fatal signal can still arrive after that check and
before __smb_send_rqst() checks again, or while waiting for a credit in
cifs_call_async(), or in the middle of a send. The write then fails
with -ERESTARTSYS, which isn't a replayable error, so netfs marks the
subrequest failed and drops its folios clean:
netfs_sreq: R=000041f6[2] UPLD SUBMT ... s=400000 0/400000
smb3_write_err: R=000041f6[2] ... offset=0x400000 len=0x400000 rc=-512
netfs_failure: R=000041f6[2] UPLD ... upload e=-512
losing 4MiB of a 64MiB file closed by a task killed meanwhile. A failed
memory allocation while building or sending a write drops its data the
same way.
No server status maps to an interrupt error or to -ENOMEM, so for
writeback such errors always mean the client gave up locally. Mark the
subrequest for retry, with backoff and giving up on umount -f, as cifs
did with is_retryable_error() before switching to netfslib and as NFS
does for these errors. netfs collects writeback from a workqueue, so
the retry gets prepared and issued with no signals pending.
Only the SMB2 read and write paths sleep before replaying, so SMB1 would
resend such writes right away. Move the sleep to cifs_issue_read() and
__cifs_issue_write(). |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: retry writes that couldn't be issued due to a reconnect
__cifs_issue_write() fails a subrequest with -EAGAIN when its handle got
invalidated or its credits belong to a session from before a reconnect,
both before sending anything. netfs used to retry any -EAGAIN by itself,
but now only retries subrequests marked for it, so these writes fail and
their folios end writeback clean, losing the data.
Mark them for retry instead. The retry gets the handle reopened and
fresh credits in cifs_prepare_write(). |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: skip NULL channel in __cifs_put_smb_ses()
cifs_chan_skip_or_disable() clears a secondary channel's slot in the
session (ses->chans[chan_index].server = NULL) without lowering
chan_count when the server stops supporting multichannel. When the
session is later released, __cifs_put_smb_ses() walks every slot up to
chan_count and calls cifs_put_tcp_session() on it, which dereferences
the server pointer immediately, so a slot left NULL by the skip path
makes the release crash with a NULL pointer dereference.
Clearing a slot without lowering chan_count is older than
cifs_chan_skip_or_disable(): cifs_chan_update_iface() could already do
the same since commit b54034a73baf9 ("cifs: during reconnect, update
interface if necessary"), and the release loop has been unguarded
since then. Commit 12d1e301bdfd1 ("cifs: do not let
cifs_chan_update_iface deallocate channels") later removed that
trigger, but the crash is reachable through it on older kernels.
cifs_decrease_secondary_channels() already guards the same put with
if (server). Add the same guard to the release loop so a skipped
channel slot is left alone. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: validate descriptor headers before query result allocation
query_info() uses the server's returned length instead of the caller's
minimum when a dynamic result is requested. A zero-length ACL response
can therefore return ZERO_SIZE_PTR to id_mode_to_cifs_acl(), whose
ownership-change path reads dacloffset before checking the header size.
A KASAN-enabled test shows a read at address 0x20 and a kernel Oops.
Validate the returned range and the caller's minimum before allocating
the dynamic result. Keep the reported length zero if validation fails.
Use the security descriptor header size as the minimum in SMB2_query_acl().
DACL-only and SACL-only xattr queries do not require owner and group SIDs,
so enforcing MIN_SEC_DESC_LEN would reject short descriptors that these
queries could previously return. The rewrite paths validate the required
owner/group SIDs and DACL separately before using their contents.
These issues were discovered and fixed by Qihoo 360's Tulongfeng
multi-agent system. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: don't give up writeback on the first replayable error
Read and write retries follow the hard and retrans mount options, and
mounts are soft with no retrans by default. For writeback this means
that a single replayable error, e.g. a reconnect while sending, fails
the subrequest and netfs ends writeback with its folios clean: the data
is gone, possibly long after write(2) succeeded, with only fsync(2) left
to notice. NFS soft mounts, by comparison, wait minutes for a server to
answer before failing a request.
Keep retrying writeback on replayable errors, with exponential backoff:
forever on hard mounts, and on soft mounts for max(3, retrans) echo
intervals from the first failure - 3 minutes by default, the time after
which a silent server is considered unresponsive. The window applies to
each write sent to the server, not to the whole writeback. umount -f or
a shutdown still stops it right away. Direct and unbuffered writes,
whose callers get the error, keep following the mount options. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: don't retry failed writes forever regardless of mount options
smb2_writev_callback() marks a write for retry whenever the server fails
it with a replayable status, ignoring smb2_should_replay() and so the
hard and retrans mount options. The latter is only used to decide on a
backoff, so on a soft mount with no retrans, a server that keeps failing
a write with e.g. STATUS_INSUFFICIENT_RESOURCES gets it resent forever,
thousands of times per second, hanging anything waiting on its
writeback:
smb3_write_err: R=005c359e[2] ... offset=0x27000 len=0xfdf0 rc=-11
(569410 times in 255 seconds, same subrequest, no growing delay)
Only retry such writes when cifs_io_should_replay() allows it, as already
done for send errors in smb2_async_writev(), otherwise let them fail.
Writeback thus keeps retrying them with backoff, within its retry
window. Base the decision on the result of this attempt rather than on
wdata->result, which is never reset on success and may hold the error of
a previous attempt.
Writes cut short by a reconnect get retried regardless too. Have
writeback ones go through cifs_io_should_replay() as well, so that they
back off and soft mounts give up on them after the retry window, as on
other replayable errors. Other writes cut short keep being retried,
without spending the mount's retries, but as replays, since they may
have reached the server, unless umount -f stopped them, which fails them
with -EIO. |
| In the Linux kernel, the following vulnerability has been resolved:
smb: client: don't write back through O_DIRECT handles
Writeback uses the first writable handle of the inode, which may have
been opened with O_DIRECT. Such handles are opened with
FILE_NO_INTERMEDIATE_BUFFERING, for which Windows rejects any unaligned
I/O with STATUS_INVALID_PARAMETER. Writeback of partly dirty pages and
of the unaligned tail of a file through one of them fails, so netfs ends
it with the folios clean and the data never reaches the server.
xfstests generic/051, where fsstress mixes both kinds of opens, loses
about 1% of its writes this way:
smb3_write_err: ... offset=0xde90d7 len=0xbd0b rc=-22
All the rejected writes in a network capture were unaligned writes on a
no-buffering handle; none of the aligned ones, and none of the unaligned
ones on regular handles, were.
Prefer a handle that was not opened with O_DIRECT, and use one that was
only if there is no other. |
| In the Linux kernel, the following vulnerability has been resolved:
dm log userspace: drop the device reference on error
userspace_ctr() takes a reference on the log device with
dm_get_device(). When the integrated-flush workqueue allocation fails it
jumps to the shared error path, which frees the log context without
dropping that reference, so the device stays busy and cannot be removed.
userspace_dtr() drops the reference correctly; do the same here. |
| In the Linux kernel, the following vulnerability has been resolved:
dm: avoid double-dropping the zone reset submission reference
On an error in __send_zone_reset_all(), the submission reference
held by the dm_io can be decremented there and again by the caller's
error path. If another clone is still outstanding, the second drop
can release the dm_io before that clone completes.
Only drop the submission reference in __send_zone_reset_all() on
success. On failure, leave the reference for the caller's existing
error handling to release once.
The error path was reproduced under KASAN with an injected GFP_NOIO
allocation failure while another zone-reset clone remained in
flight. With the change, the same failure was reported normally,
without the observed use-after-free, and ordinary zone resets
continued to work. |
| In the Linux kernel, the following vulnerability has been resolved:
dm: fix use-after-free when dm_get_device() widens the open mode
There's an UAF bug in dm_get_device(): when a table construction calls
dm_get_device() on the same device twice with widen access mode (e.g.,
read-only first then read-write), the second dm_get_device() calls
upgrade_mode(), which reopens the device in upgraded mode, making
previously returned dm_dev* a stale pointer.
Fixing approaches:
- Add per-mode views (dm_dev_ref) from a per-device dm_dev_internal to
multiple table_devices.
- Keep reusing the dm_dev_ref when the requested mode is included, i.e.,
a read-only reference can reuse the read-write opened device within a
table.
- Maintain a canonical block_device pointer in dm_dev_internal for
handling the DM_TABLE_DEPS ioctl.
Also tweak the way of mode sharing check in find_ref() to
"(x & mask) == mask". The result stays the same to the previous
upgrade_mode() guard "(x | mask) == x".
Pros: keep the relationship between dm_dev_internal and table_device:
one dm_dev_internal per device, regardless the mode, so the output of
DMM_TABLE_DEPS ioctl unchanged.
Cons: extra dm_dev_ref allocation.
Note that now the table_device's count not necessarily mean the number
tables referecing this <dev, mode> pair, since we're allowing multiple
references within a table. |
| In the Linux kernel, the following vulnerability has been resolved:
dm cache: reject kcopyd client destory if it setup failed
The value of cache->copier is -EINTR when failed to create a rescuer
kthread for wq kcopyd, in cache_create(), the code jumps directly to
__destroy(cache), it merely performs a simple check to see whether copier
is NULL, potentially hitting:
BUG: KASAN: null-ptr-deref in dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980
Read of size 4 at addr 0000000000000174 by task syz.2.19/6560
Call Trace:
dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980
__destroy+0x172/0x2f0 drivers/md/dm-cache-target.c:1973
cache_create drivers/md/dm-cache-target.c:2604 [inline]
cache_ctr+0x1674/0x2bf0 drivers/md/dm-cache-target.c:2649
dm_table_add_target+0x58d/0xc70 drivers/md/dm-table.c:749
populate_table drivers/md/dm-ioctl.c:1602 [inline]
table_load+0x325/0x8a0 drivers/md/dm-ioctl.c:1645
ctl_ioctl drivers/md/dm-ioctl.c:2221 [inline]
Set copier to NULL to avoid destroying a invalid kcopy client. |
| In the Linux kernel, the following vulnerability has been resolved:
dm mpath: fix buffer overflow in parse_hw_handler()
parse_hw_handler() builds the hw_handler parameter string in a buffer
sized with
len = 4;
plus one byte per argument. Those four bytes were meant for the decimal
form of the parameter count, three digits plus the terminating NUL.
dm_read_arg_group() accepts up to 1024 arguments and the count written is
'hw_argc - 1', so a count of 1000 or more needs four digits plus the NUL
and sprintf() writes one byte past the allocation.
Size the buffer from the actual string length instead. |
| In the Linux kernel, the following vulnerability has been resolved:
dm-pcache: do not advance dirty_tail after backing flush failure
After all writeback bios for a kset complete, writeback_ctx_end()
flushes the backing device and then advances the persistent dirty_tail.
However, backing_dev_flush() discards the error returned by
blkdev_issue_flush(), so dirty_tail is advanced even when the written
data is not known to be durable.
dirty_tail points to the first kset that still requires writeback.
Advancing it causes recovery to treat the preceding kset as clean and
allows its cache copy to eventually be reclaimed by garbage collection.
If the backing device flush failed, a subsequent power failure may
therefore result in data loss.
Make backing_dev_flush() return the flush status and handle a flush
failure like a writeback I/O failure. Leave dirty_tail unchanged so
that the same kset will be retried. |