Linux kernel modifications for the Kernel Hacking exam
Find a file
David Howells 307f77e7f5 cifs: Fix reversion of the iter in cifs_readv_receive().
cifs_read_iter_from_socket() copies the iterator that's passed in for the
socket to modify as and if it will, and then advances the original iterator
by the amount sent.  However, both callers revert the advancement (although
receive_encrypted_read() zeros beyond the iterator first).  The problem is,
though, that cifs_readv_receive() reverts by the original length, not the
amount transmitted which can cause an oops in iov_iter_revert().

Fix this by:

 (1) Remove the iov_iter_advance() from cifs_read_iter_from_socket().

 (2) Remove the iov_iter_revert() from both callers.  This fixes the bug in
     cifs_readv_receive().

 (3) In receive_encrypted_read(), if we didn't get back as much data as the
     buffer will hold, copy the iterator, advance the copy and use the copy
     to drive iov_iter_zero().

As a bonus, this gets rid of some unnecessary work.

This was triggered by generic/074 with the "-o sign" mount option.

Fixes: 3ee1a1fc39 ("cifs: Cut over to using netfslib")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.com>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
2024-09-24 21:53:08 -05:00
arch Random number generator updates for Linux 6.12-rc1. 2024-09-18 15:26:31 +02:00
block Updates for the interrupt subsystem: 2024-09-17 07:09:17 +02:00
certs
crypto crypto: aegis128 - Fix indentation issue in crypto_aegis128_process_crypt() 2024-09-13 18:26:52 +08:00
Documentation overlayfs updates for 6.12 2024-09-19 06:33:18 +02:00
drivers Random number generator updates for Linux 6.12-rc1. 2024-09-18 15:26:31 +02:00
fs cifs: Fix reversion of the iter in cifs_readv_receive(). 2024-09-24 21:53:08 -05:00
include Random number generator updates for Linux 6.12-rc1. 2024-09-18 15:26:31 +02:00
init cgroup: Changes for v6.12 2024-09-18 06:39:03 +02:00
io_uring slab updates for 6.12 2024-09-18 08:53:53 +02:00
ipc sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
kernel Performance events changes for v6.12: 2024-09-18 15:03:58 +02:00
lib Random number generator updates for Linux 6.12-rc1. 2024-09-18 15:26:31 +02:00
LICENSES
mm execve updates for v6.12-rc1 2024-09-18 11:53:31 +02:00
net slab updates for 6.12 2024-09-18 08:53:53 +02:00
rust Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-09-05 20:37:20 -07:00
samples treewide: remove unnecessary <linux/version.h> inclusion 2024-08-12 18:36:44 +09:00
scripts hardening updates for v6.12-rc1 2024-09-18 12:12:41 +02:00
security lsm/stable-6.12 PR 20240911 2024-09-16 18:19:47 +02:00
sound sound updates for 6.12-rc1 2024-09-17 17:03:43 +02:00
tools Random number generator updates for Linux 6.12-rc1. 2024-09-18 15:26:31 +02:00
usr
virt KVM: x86: Disallow read-only memslots for SEV-ES and SEV-SNP (and TDX) 2024-08-14 12:28:24 -04:00
.clang-format
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore .gitignore: add .gcda files 2024-08-09 13:18:46 +01:00
.mailmap sound fixes for 6.11 2024-09-14 11:54:24 +02:00
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS IOMMU Updates for Linux v6.12 2024-09-18 12:45:52 +02:00
Makefile Linux 6.11 2024-09-15 16:57:56 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.