linux-stable/drivers/scsi
Kirill A. Shutemov 461c7fa126 drivers/scsi/sg.c: mark VMA as VM_IO to prevent migration
Reduced testcase:

    #include <fcntl.h>
    #include <unistd.h>
    #include <sys/mman.h>
    #include <numaif.h>

    #define SIZE 0x2000

    int main()
    {
        int fd;
        void *p;

        fd = open("/dev/sg0", O_RDWR);
        p = mmap(NULL, SIZE, PROT_EXEC, MAP_PRIVATE | MAP_LOCKED, fd, 0);
        mbind(p, SIZE, 0, NULL, 0, MPOL_MF_MOVE);
        return 0;
    }

We shouldn't try to migrate pages in sg VMA as we don't have a way to
update Sg_scatter_hold::pages accordingly from mm core.

Let's mark the VMA as VM_IO to indicate to mm core that the VMA is not
migratable.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Shiraz Hashim <shashim@codeaurora.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: syzkaller <syzkaller@googlegroups.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-02-03 08:28:43 -08:00
..
aacraid aacraid: aac_release_resources() can be static 2015-11-25 22:27:30 -05:00
aic7xxx aic7xxx: Avoid name collision with <linux/list.h> 2016-01-05 22:10:35 +01:00
aic94xx scsi: Centralise ssp frame information units 2015-11-25 22:12:50 -05:00
arcmsr arcmsr: change driver version to v1.30.00.22-20151126 2015-11-30 18:51:20 -05:00
arm ncr5380: Fix soft lockups 2016-01-06 21:43:09 -05:00
be2iscsi irq_poll: fold irq_poll_sched_prep into irq_poll_sched 2015-12-11 11:52:26 -08:00
bfa bfa: Update driver version to 3.2.25.0 2015-12-02 17:07:57 -05:00
bnx2fc bnx2fc: Update version number to 2.9.6. 2015-11-09 17:32:34 -08:00
bnx2i bnx2i: Fix call trace while device reset 2015-06-02 17:15:24 -07:00
csiostor scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
cxgbi cxgbi: Typo in MODULE_PARM_DESC 2016-01-08 12:51:04 -05:00
cxlflash cxlflash: Enable device id for future IBM CXL adapter 2016-01-06 20:58:29 -05:00
device_handler scsi_dh_alua: Remove stale variables 2015-12-07 20:11:25 -05:00
dpt
esas2r scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
fcoe fcoe: Use CHECKSUM_PARTIAL to indicate CRC offload 2015-12-15 16:49:58 -05:00
fnic scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
hisi_sas Merge remote-tracking branch 'mkp-scsi/4.5/scsi-fixes' into fixes 2016-01-26 17:44:42 -08:00
ibmvscsi SCSI queue for 4.4. 2015-11-12 07:06:18 -05:00
isci SCSI queue for 4.4. 2015-11-12 07:06:18 -05:00
libfc libfc: Use the correct function name in kernel-doc comment. 2015-11-09 17:15:52 -08:00
libsas Merge branch 'for-4.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-03-24 17:08:29 -07:00
lpfc lpfc: Update version to 11.0.0.10 for upstream patch set 2015-12-21 22:08:49 -05:00
megaraid megaraid: Fix possible NULL pointer deference in mraid_mm_ioctl 2016-01-08 13:03:53 -05:00
mpt3sas Merge branch 'jejb-scsi' into misc 2016-01-07 15:51:13 -08:00
mvsas Merge branch 'jejb-scsi' into misc 2016-01-07 15:51:13 -08:00
osd osd: fix signed char versus %02x issue 2015-12-10 13:14:56 -05:00
pcmcia scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
pm8001 SCSI queue for 4.4. 2015-11-12 07:06:18 -05:00
qla2xxx Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
qla4xxx SCSI misc on 20151113 2015-11-13 20:35:54 -08:00
snic SCSI misc on 20151113 2015-11-13 20:35:54 -08:00
sym53c8xx_2 scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
ufs scsi: ufs: fix spelling mistake in error message 2015-11-30 20:52:33 -05:00
.gitignore
3w-9xxx.c 3w-9xxx: don't unmap bounce buffered commands 2015-10-07 10:24:48 -07:00
3w-9xxx.h 3w-9xxx: fix command completion race 2015-04-27 10:10:19 -07:00
3w-sas.c 3w-sas: fix command completion race 2015-04-27 10:04:39 -07:00
3w-sas.h 3w-sas: fix command completion race 2015-04-27 10:04:39 -07:00
3w-xxxx.c 3w-xxxx: Pass through compat mode ioctls 2016-01-08 12:51:03 -05:00
3w-xxxx.h 3w-xxxx: fix command completion race 2015-04-27 10:05:55 -07:00
53c700.c scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
53c700.h
53c700.scr
53c700_d.h_shipped
a100u2w.c scsi: a100u2w: trivial typo in printk 2015-08-07 15:03:42 +02:00
a100u2w.h
a2091.c
a2091.h
a3000.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
a3000.h
a4000t.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
advansys.c Merge branch 'mkp-fixes' into fixes 2015-12-03 09:32:33 -08:00
aha152x.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
aha152x.h
aha1542.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
aha1542.h aha1542: fix include guard and remove useless changelog 2015-04-09 18:08:31 -07:00
aha1740.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
aha1740.h scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
am53c974.c am53c974: Fix crash during modprobe 2015-04-17 10:13:56 -07:00
atari_NCR5380.c ncr5380: Cleanup whitespace and parentheses 2016-01-06 21:43:10 -05:00
atari_scsi.c atari_scsi, sun3_scsi: Remove global Scsi_Host pointer 2016-01-06 21:43:08 -05:00
atp870u.c atp870u: Introduce atp870_init() 2015-11-25 22:08:55 -05:00
atp870u.h atp870u: Remove scam_on from struct atp_unit 2015-11-25 22:08:52 -05:00
BusLogic.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
BusLogic.h
bvme6000_scsi.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
ch.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2015-04-14 09:50:27 -07:00
constants.c scsi: Conditionally compile in constants.c 2015-01-09 15:44:31 +01:00
dc395x.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
dc395x.h
dmx3191d.c ncr5380: Fix soft lockups 2016-01-06 21:43:09 -05:00
dpt_i2o.c x86/vm86: Clean up vm86.h includes 2015-07-31 13:31:10 +02:00
dpti.h scsi: use 64-bit LUNs 2014-07-17 22:07:37 +02:00
dtc.c ncr5380: Fix soft lockups 2016-01-06 21:43:09 -05:00
dtc.h ncr5380: Fix and cleanup scsi_host_template initializers 2016-01-06 21:43:03 -05:00
eata.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
eata_generic.h
eata_pio.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
eata_pio.h
esp_scsi.c scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
esp_scsi.h esp_scsi: correctly detect am53c974 2014-11-24 16:13:16 +01:00
fdomain.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
fdomain.h
FlashPoint.c FlashPoint: fix build warning 2015-11-09 16:32:14 -08:00
g_NCR5380.c ncr5380: Add support for HP C2502 2016-01-06 21:43:13 -05:00
g_NCR5380.h ncr5380: Add support for HP C2502 2016-01-06 21:43:13 -05:00
g_NCR5380_mmio.c
gdth.c scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 2014-11-24 20:01:40 +01:00
gdth.h
gdth_ioctl.h
gdth_proc.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
gdth_proc.h
gvp11.c
gvp11.h
hosts.c Merge branch 'mkp-fixes' into fixes 2015-12-03 09:32:33 -08:00
hpsa.c Merge branch 'jejb-scsi' into misc 2016-01-07 15:51:13 -08:00
hpsa.h hpsa: Change SAS transport devices to bus 0. 2016-01-06 15:10:35 -05:00
hpsa_cmd.h hpsa: Add box and bay information for enclosure devices 2016-01-06 15:10:36 -05:00
hptiop.c hptiop: Support HighPoint RR36xx HBAs and Support SAS tape and SAS media changer 2015-08-12 13:14:57 -07:00
hptiop.h hptiop: Support HighPoint RR36xx HBAs and Support SAS tape and SAS media changer 2015-08-12 13:14:57 -07:00
imm.c imm: Use new parport device model 2016-01-08 13:08:15 -05:00
imm.h
in2000.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
in2000.h
initio.c SCSI: initio: remove duplicate module device table 2015-11-20 11:39:03 -05:00
initio.h
ipr.c Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
ipr.h irq_poll: make blk-iopoll available outside the block layer 2015-12-11 11:52:24 -08:00
ips.c ips: remove pointless #warning 2015-06-02 17:24:54 -07:00
ips.h
iscsi_boot_sysfs.c [SCSI] iscsi_boot_sysfs: Fix a memory leak in iscsi_boot_destroy_kset() 2014-03-15 10:19:19 -07:00
iscsi_tcp.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
iscsi_tcp.h net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
jazz_esp.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
Kconfig Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
lasi700.c
libiscsi.c libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop 2015-09-17 07:25:02 -07:00
libiscsi_tcp.c [SCSI] libiscsi: Reduce locking contention in fast path 2014-03-15 10:19:18 -07:00
mac53c94.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
mac53c94.h
mac_esp.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
mac_scsi.c ncr5380: Fix soft lockups 2016-01-06 21:43:09 -05:00
Makefile hisi_sas: Add initial bare main driver 2015-11-25 22:12:51 -05:00
megaraid.c megaraid : use dev_printk when possible 2015-08-26 07:23:04 -07:00
megaraid.h [SCSI] megaraid: simplify internal command handling 2014-03-27 08:26:31 -07:00
mesh.c powerpc: Move Power Macintosh drivers to generic byteswappers 2015-03-23 14:29:40 +11:00
mesh.h
mvme16x_scsi.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
mvme147.c
mvme147.h
mvumi.c mvumi: 64bit value for seconds_since1970 2015-11-11 20:45:23 -05:00
mvumi.h
ncr53c8xx.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
ncr53c8xx.h scsi: Remove CONFIG_SCSI_MULTI_LUN 2014-07-17 22:07:35 +02:00
NCR53c406a.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
NCR5380.c ncr5380: Cleanup whitespace and parentheses 2016-01-06 21:43:10 -05:00
NCR5380.h ncr5380: Use runtime register mapping 2016-01-06 21:43:10 -05:00
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
nsp32.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c scsi: remove scsi_driver owner field 2014-11-24 20:01:28 +01:00
osst.h
osst_detect.h
osst_options.h
pas16.c ncr5380: Fix soft lockups 2016-01-06 21:43:09 -05:00
pas16.h ncr5380: Fix and cleanup scsi_host_template initializers 2016-01-06 21:43:03 -05:00
pmcraid.c SCSI queue for 4.4. 2015-11-12 07:06:18 -05:00
pmcraid.h
ppa.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
ppa.h
ps3rom.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
qla1280.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
qla1280.h
qlogicfas.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
qlogicfas408.c
qlogicfas408.h
qlogicpti.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c scsi: rescan VPD attributes 2015-11-30 11:23:45 -05:00
scsi.h
scsi_common.c scsi: Protect against buffer possible overflow in scsi_set_sense_information 2015-07-23 22:53:05 -07:00
scsi_debug.c Merge branch 'jejb-scsi' into misc 2016-01-07 15:51:13 -08:00
scsi_devinfo.c scsi: add Synology to 1024 sector blacklist 2016-01-07 21:43:26 -05:00
scsi_dh.c scsi_dh: move 'dh_state' sysfs attribute to generic code 2015-12-02 16:29:19 -05:00
scsi_error.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
scsi_ioctl.c scsi: return EAGAIN when resetting a device under EH 2014-11-12 11:16:12 +01:00
scsi_lib.c scsi: Add scsi_vpd_tpg_id() 2015-12-02 16:43:11 -05:00
scsi_lib_dma.c
scsi_logging.c scsi_logging: return void for dev_printk() functions 2015-02-04 08:00:24 -08:00
scsi_logging.h scsi: simplify scsi_log_(send|completion) 2014-11-12 11:16:05 +01:00
scsi_module.c
scsi_netlink.c net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-04-24 13:44:54 -04:00
scsi_pm.c Revert "SCSI: Fix NULL pointer dereference in runtime PM" 2015-12-10 12:24:44 -05:00
scsi_priv.h scsi_dh: move 'dh_state' sysfs attribute to generic code 2015-12-02 16:29:19 -05:00
scsi_proc.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
scsi_sas_internal.h
scsi_scan.c Merge branch 'jejb-scsi' into misc 2016-01-07 15:51:13 -08:00
scsi_sysctl.c scsi: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
scsi_sysfs.c Merge branch 'jejb-scsi' into misc 2016-01-07 15:51:13 -08:00
scsi_trace.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
scsi_transport_api.h
scsi_transport_fc.c scsi_transport_fc: Introduce scsi_host_{get,put}() 2015-11-30 17:43:55 -05:00
scsi_transport_iscsi.c SCSI misc on 20150901 2015-09-02 12:22:54 -07:00
scsi_transport_sas.c scsi_transport_sas: add function to get SAS endpoint address 2015-12-18 19:29:50 -08:00
scsi_transport_spi.c [SCSI] Fix printk typos in drivers/scsi 2015-08-07 14:28:45 +02:00
scsi_transport_srp.c IB/srp: Avoid using uninitialized variable 2015-07-14 13:20:09 -04:00
scsi_typedefs.h
scsicam.c scsi: PC partition tables are little endian 2014-11-12 11:15:54 +01:00
sd.c Merge remote-tracking branch 'mkp-scsi/4.5/scsi-fixes' into fixes 2016-01-26 17:44:42 -08:00
sd.h block/sd: Fix device-imposed transfer length limits 2015-11-25 21:38:58 -05:00
sd_dif.c block: Consolidate static integrity profile properties 2015-10-21 14:42:38 -06:00
ses.c ses: fix discovery of SATA devices in SAS enclosures 2015-12-18 19:29:50 -08:00
sg.c drivers/scsi/sg.c: mark VMA as VM_IO to prevent migration 2016-02-03 08:28:43 -08:00
sgiwd93.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
sim710.c
sni_53c710.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
sr.c SCSI: fix crashes in sd and sr runtime PM 2016-01-26 17:24:16 -08:00
sr.h scsi: introduce sdev_prefix_printk() 2014-11-12 11:15:57 +01:00
sr_ioctl.c sr: reduce debug noise in sr_do_ioctl 2015-01-20 19:43:24 +01:00
sr_vendor.c scsi: Implement sr_printk() 2014-07-17 22:07:39 +02:00
st.c Merge branch 'mkp-fixes' into fixes 2015-12-03 09:32:33 -08:00
st.h st: Remove obsolete scsi_tape.max_pfn 2015-11-18 11:59:09 -05:00
st_options.h
stex.c stex: Remove use of struct timeval 2015-11-09 17:42:19 -08:00
storvsc_drv.c storvsc: Fix typo in MODULE_PARM_DESC 2016-01-08 12:51:04 -05:00
sun3_scsi.c atari_scsi, sun3_scsi: Remove global Scsi_Host pointer 2016-01-06 21:43:08 -05:00
sun3_scsi.h sun3_scsi: Move macro definitions 2014-11-20 09:11:15 +01:00
sun3_scsi_vme.c scsi/NCR5380: merge sun3_scsi_vme.c into sun3_scsi.c 2014-05-28 12:16:28 +02:00
sun3x_esp.c arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
sun_esp.c scsi: drop owner assignment from platform_drivers 2014-10-20 16:21:33 +02:00
sym53c416.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
sym53c416.h
t128.c ncr5380: Fix soft lockups 2016-01-06 21:43:09 -05:00
t128.h ncr5380: Fix and cleanup scsi_host_template initializers 2016-01-06 21:43:03 -05:00
u14-34f.c scsi: drop reason argument from ->change_queue_depth 2014-11-24 14:45:27 +01:00
ultrastor.c
ultrastor.h
virtio_scsi.c virtio/vhost: fixes for 4.2 2015-07-23 13:07:04 -07:00
vmw_pvscsi.c VMW_PVSCSI: Fix the issue of DMA-API related warnings. 2015-12-10 12:57:04 -05:00
vmw_pvscsi.h VMW_PVSCSI: Fix the issue of DMA-API related warnings. 2015-12-10 12:57:04 -05:00
wd33c93.c scsi: print single-character strings with seq_putc 2015-02-02 09:57:46 -08:00
wd33c93.h
wd719x.c [SCSI] Fix printk typos in drivers/scsi 2015-08-07 14:28:45 +02:00
wd719x.h scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
wd7000.c scsi: replace seq_printf with seq_puts 2015-02-02 09:57:45 -08:00
xen-scsifront.c xen: Use correctly the Xen memory terminologies 2015-09-08 18:03:49 +01:00
zalon.c
zorro7xx.c