All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 4.4 088/118] fix iov_iter_fault_in_readable()
Date: Thu, 22 Sep 2016 19:29:48 +0200	[thread overview]
Message-ID: <20160922172943.082643350@linuxfoundation.org> (raw)
In-Reply-To: <20160922172938.643879685@linuxfoundation.org>

4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Al Viro <viro@ZenIV.linux.org.uk>

commit d4690f1e1cdabb4d61207b6787b1605a0dc0aeab upstream.

... by turning it into what used to be multipages counterpart

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/uio.h |    2 +-
 lib/iov_iter.c      |   24 ++----------------------
 2 files changed, 3 insertions(+), 23 deletions(-)

--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -76,7 +76,7 @@ size_t iov_iter_copy_from_user_atomic(st
 		struct iov_iter *i, unsigned long offset, size_t bytes);
 void iov_iter_advance(struct iov_iter *i, size_t bytes);
 int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes);
-int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes);
+#define iov_iter_fault_in_multipages_readable iov_iter_fault_in_readable
 size_t iov_iter_single_seg_count(const struct iov_iter *i);
 size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
 			 struct iov_iter *i);
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -298,33 +298,13 @@ done:
 }
 
 /*
- * Fault in the first iovec of the given iov_iter, to a maximum length
- * of bytes. Returns 0 on success, or non-zero if the memory could not be
- * accessed (ie. because it is an invalid address).
- *
- * writev-intensive code may want this to prefault several iovecs -- that
- * would be possible (callers must not rely on the fact that _only_ the
- * first iovec will be faulted with the current implementation).
- */
-int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes)
-{
-	if (!(i->type & (ITER_BVEC|ITER_KVEC))) {
-		char __user *buf = i->iov->iov_base + i->iov_offset;
-		bytes = min(bytes, i->iov->iov_len - i->iov_offset);
-		return fault_in_pages_readable(buf, bytes);
-	}
-	return 0;
-}
-EXPORT_SYMBOL(iov_iter_fault_in_readable);
-
-/*
  * Fault in one or more iovecs of the given iov_iter, to a maximum length of
  * bytes.  For each iovec, fault in each page that constitutes the iovec.
  *
  * Return 0 on success, or non-zero if the memory could not be accessed (i.e.
  * because it is an invalid address).
  */
-int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes)
+int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes)
 {
 	size_t skip = i->iov_offset;
 	const struct iovec *iov;
@@ -341,7 +321,7 @@ int iov_iter_fault_in_multipages_readabl
 	}
 	return 0;
 }
-EXPORT_SYMBOL(iov_iter_fault_in_multipages_readable);
+EXPORT_SYMBOL(iov_iter_fault_in_readable);
 
 void iov_iter_init(struct iov_iter *i, int direction,
 			const struct iovec *iov, unsigned long nr_segs,

  parent reply	other threads:[~2016-09-22 17:40 UTC|newest]

Thread overview: 143+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160922173501uscas1p243aed76c609383566946bc6ebe30e40d@uscas1p2.samsung.com>
2016-09-22 17:28 ` [PATCH 4.4 000/118] 4.4.22-stable review Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 001/118] ext4: use __GFP_NOFAIL in ext4_free_blocks() Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 002/118] fscrypto: add authorization check for setting encryption policy Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 003/118] clocksource/drivers/sun4i: Clear interrupts after stopping timer in probe function Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 004/118] MIPS: KVM: Check for pfn noslot case Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 005/118] Revert "KVM: x86: fix missed hardware breakpoints" Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 006/118] fscrypto: require write access to mount to set encryption policy Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 008/118] tipc: move linearization of buffers to generic code Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 009/118] powerpc/tm: do not use r13 for tabort_syscall Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 010/118] powerpc/powernv : Drop reference added by kset_find_obj() Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 011/118] powerpc/mm: Dont alias user region to other regions below PAGE_OFFSET Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 012/118] kernfs: dont depend on d_find_any_alias() when generating notifications Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 013/118] pNFS: The client must not do I/O to the DS if its lease has expired Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 014/118] NFSv4.x: Fix a refcount leak in nfs_callback_up_net Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 015/118] nfsd: Close race between nfsd4_release_lockowner and nfsd4_lock Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 016/118] pNFS: Ensure LAYOUTGET and LAYOUTRETURN are properly serialised Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 017/118] NFSv4.1: Fix the CREATE_SESSION slot number accounting Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 018/118] kexec: fix double-free when failing to relocate the purgatory Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 019/118] mm: introduce get_task_exe_file Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 020/118] audit: fix exe_file access in audit_exe_compare Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 021/118] dm flakey: fix reads to be issued if drop_writes configured Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 022/118] IB/uverbs: Fix race between uverbs_close and remove_one Greg Kroah-Hartman
2016-10-03 12:28     ` Vegard Nossum
2016-10-03 17:05       ` Jason Gunthorpe
2016-09-22 17:28   ` [PATCH 4.4 025/118] x86/AMD: Apply erratum 665 on machines without a BIOS fix Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 026/118] kvm-arm: Unmap shadow pagetables properly Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 027/118] iio: accel: kxsd9: Fix raw read return Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 028/118] iio: proximity: as3935: set up buffer timestamps for non-zero values Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 029/118] iio: adc: rockchip_saradc: reset saradc controller before programming it Greg Kroah-Hartman
2016-09-22 17:28     ` Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 030/118] iio: adc: ti_am335x_adc: Protect FIFO1 from concurrent access Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 031/118] iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC sample Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 032/118] iio: ad799x: Fix buffered capture for ad7991/ad7995/ad7999 Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 033/118] iio: adc: at91: unbreak channel adc channel 3 Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 034/118] iio: accel: bmc150: reset chip at init time Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 035/118] iio: fix pressure data output unit in hid-sensor-attributes Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 036/118] iio: accel: kxsd9: Fix scaling bug Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 037/118] iio:core: fix IIO_VAL_FRACTIONAL sign handling Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 038/118] iio: ensure ret is initialized to zero before entering do loop Greg Kroah-Hartman
2016-09-22 17:28   ` [PATCH 4.4 039/118] serial: 8250_mid: fix divide error bug if baud rate is 0 Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 040/118] serial: 8250: added acces i/o products quad and octal serial cards Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 041/118] USB: serial: simple: add support for another Infineon flashloader Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 042/118] usb: renesas_usbhs: fix clearing the {BRDY,BEMP}STS condition Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 043/118] usb: chipidea: udc: fix NULL ptr dereference in isr_setup_status_phase Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 044/118] ARM: dts: STiH410: Handle interconnect clock required by EHCI/OHCI (USB) Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 045/118] USB: change bInterval default to 10 ms Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 046/118] cxl: use pcibios_free_controller_deferred() when removing vPHBs Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 047/118] net: thunderx: Fix OOPs with ethtool --register-dump Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 048/118] cpuset: make sure new tasks conform to the current config of the cpuset Greg Kroah-Hartman
2016-09-26 12:34     ` Takashi Iwai
2016-09-26 15:38       ` Greg Kroah-Hartman
2016-09-26 15:44         ` Takashi Iwai
2016-09-22 17:29   ` [PATCH 4.4 049/118] ARM: AM43XX: hwmod: Fix RSTST register offset for pruss Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 050/118] ARM: imx6: add missing BM_CLPCR_BYP_MMDC_CH0_LPM_HS setting for imx6ul Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 051/118] ARM: imx6: add missing BM_CLPCR_BYPASS_PMIC_READY setting for imx6sx Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 052/118] ARM: kirkwood: ib62x0: fix size of u-boot environment partition Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 053/118] ARM: OMAP3: hwmod data: Add sysc information for DSI Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 054/118] ARM: dts: imx6qdl: Fix SPDIF regression Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 055/118] ARM: dts: overo: fix gpmc nand cs0 range Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 056/118] ARM: dts: overo: fix gpmc nand on boards with ethernet Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 057/118] ARM: dts: STiH407-family: Provide interconnect clock for consumption in ST SDHCI Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 058/118] bus: arm-ccn: Fix PMU handling of MN Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 059/118] bus: arm-ccn: Do not attempt to configure XPs for cycle counter Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 060/118] bus: arm-ccn: Fix XP watchpoint settings bitmask Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 061/118] dm log writes: fix check of kthread_run() return value Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 062/118] dm log writes: move IO accounting earlier to fix error path Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 063/118] dm crypt: fix error with too large bios Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 064/118] pinctrl: pistachio: fix mfio pll_lock pinmux Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 065/118] pinctrl: sunxi: fix uart1 CTS/RTS pins at PG on A23/A33 Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 066/118] arm64: spinlocks: implement smp_mb__before_spinlock() as smp_mb() Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 067/118] crypto: cryptd - initialize child shash_desc on import Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 068/118] Btrfs: remove root_log_ctx from ctx list before btrfs_sync_log returns Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 069/118] fuse: direct-io: dont dirty ITER_BVEC pages Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 070/118] xhci: fix null pointer dereference in stop command timeout function Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 071/118] md-cluster: make md-cluster also can work when compiled into kernel Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 072/118] ath9k: fix using sta->drv_priv before initializing it Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 073/118] Revert "wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel" Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 074/118] sched/core: Fix a race between try_to_wake_up() and a woken up task Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 075/118] ipv6: addrconf: fix dev refcont leak when DAD failed Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 076/118] gma500: remove annoying deprecation warning Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 079/118] mmc: dw_mmc: use resource_size_t to store physical address Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 080/118] pinctrl: at91-pio4: use %pr format string for resource Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 081/118] soc: qcom/spm: shut up uninitialized variable warning Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 082/118] kconfig: tinyconfig: provide whole choice blocks to avoid warnings Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 083/118] net: simplify napi_synchronize() " Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 084/118] drm: atmel-hlcdc: Fix vertical scaling Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 085/118] drm: Only use compat ioctl for addfb2 on X86/IA64 Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 086/118] genirq: Provide irq_gc_{lock_irqsave,unlock_irqrestore}() helpers Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 087/118] irqchip/atmel-aic: Fix potential deadlock in ->xlate() Greg Kroah-Hartman
2016-09-22 17:29   ` Greg Kroah-Hartman [this message]
2016-09-22 17:29   ` [PATCH 4.4 089/118] microblaze: fix __get_user() Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 090/118] avr32: fix copy_from_user() Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 091/118] microblaze: " Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 092/118] fix minor infoleak in get_user_ex() Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 093/118] mn10300: failing __get_user() and get_user() should zero Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 094/118] m32r: fix __get_user() Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 095/118] sh64: failing __get_user() should zero Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 096/118] nios2: fix __get_user() Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 097/118] score: fix __get_user/get_user Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 098/118] s390: get_user() should zero on failure Greg Kroah-Hartman
2016-09-22 17:29   ` [PATCH 4.4 099/118] ARC: uaccess: get_user to zero out dest in cause of fault Greg Kroah-Hartman
2016-09-22 17:29     ` Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 100/118] asm-generic: make get_user() clear the destination on errors Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 101/118] frv: fix clear_user() Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 102/118] cris: buggered copy_from_user/copy_to_user/clear_user Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 103/118] blackfin: fix copy_from_user() Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 104/118] score: fix copy_from_user() and friends Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 105/118] sh: fix copy_from_user() Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 106/118] hexagon: fix strncpy_from_user() error return Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 107/118] mips: copy_from_user() must zero the destination on access_ok() failure Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 108/118] asm-generic: make copy_from_user() zero the destination properly Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 109/118] alpha: fix copy_from_user() Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 110/118] metag: copy_from_user() should zero the destination on access_ok() failure Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 111/118] parisc: fix copy_from_user() Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 112/118] openrisc: " Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 113/118] nios2: copy_from_user() should zero the tail of destination Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 114/118] mn10300: copy_from_user() should zero on access_ok() failure Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 115/118] sparc32: fix copy_from_user() Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 116/118] ppc32: " Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 117/118] genirq/msi: Fix broken debug output Greg Kroah-Hartman
2016-09-22 17:30   ` [PATCH 4.4 118/118] ia64: copy_from_user() should zero the destination on access_ok() failure Greg Kroah-Hartman
2016-09-22 19:56   ` [PATCH 4.4 000/118] 4.4.22-stable review Holger Hoffstätte
2016-09-23  8:14     ` Greg Kroah-Hartman
2016-09-23  8:14       ` Greg Kroah-Hartman
2016-09-23  8:43       ` Holger Hoffstätte
2016-09-23  9:21         ` Greg Kroah-Hartman
2016-09-23  9:21           ` Greg Kroah-Hartman
2016-09-23 10:57           ` Holger Hoffstätte
2016-09-23 15:13             ` Greg Kroah-Hartman
2016-09-25 15:08               ` Greg Kroah-Hartman
2016-09-22 23:43   ` Guenter Roeck
2016-09-23  3:01   ` Guenter Roeck
2016-09-23  8:05     ` Greg Kroah-Hartman
2016-09-23  8:08     ` Greg Kroah-Hartman
2016-09-23 13:25       ` Guenter Roeck
2016-09-23 15:11         ` Greg Kroah-Hartman
2016-09-23 15:30           ` Greg Kroah-Hartman
2016-09-28  8:45             ` Andrew Donnellan
2016-09-28 13:29               ` Mauricio Faria de Oliveira
2016-10-10  8:39                 ` Greg Kroah-Hartman
2016-09-23  8:10     ` Greg Kroah-Hartman
2016-09-23  8:11     ` Greg Kroah-Hartman
2016-09-23 16:02   ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922172943.082643350@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.