Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e3e25fc
Apply Linux patch 3.10.33 - 3.10.34
Stane1983 Aug 3, 2015
0e283d0
Apply Linux patch 3.10.34 - 3.10.35
Stane1983 Aug 3, 2015
b1295cf
Apply Linux patch 3.10.35 - 3.10.36
Stane1983 Aug 3, 2015
c3192d0
Apply Linux patch 3.10.36 - 3.10.37
Stane1983 Aug 3, 2015
1b9ac66
Apply Linux patch 3.10.37 - 3.10.38
Stane1983 Aug 3, 2015
cd6536c
Apply Linux patch 3.10.38 - 3.10.39
Stane1983 Aug 3, 2015
5332864
Apply Linux patch 3.10.39 - 3.10.40
Stane1983 Aug 3, 2015
4180f3b
Apply Linux patch 3.10.40 - 3.10.41
Stane1983 Aug 3, 2015
69c9072
Apply Linux patch 3.10.41 - 3.10.42
Stane1983 Aug 3, 2015
c024ed0
Apply Linux patch 3.10.42 - 3.10.43
Stane1983 Aug 3, 2015
59b8f92
Apply Linux patch 3.10.43 - 3.10.44
Stane1983 Aug 3, 2015
b3f7edc
Apply Linux patch 3.10.44 - 3.10.45
Stane1983 Aug 3, 2015
96129de
Apply Linux patch 3.10.45 - 3.10.46
Stane1983 Aug 3, 2015
c42504f
Apply Linux patch 3.10.46 - 3.10.47
Stane1983 Aug 3, 2015
5ba824f
Apply Linux patch 3.10.47 - 3.10.48
Stane1983 Aug 3, 2015
6f35a47
Apply Linux patch 3.10.48 - 3.10.49
Stane1983 Aug 3, 2015
9977c93
Apply Linux patch 3.10.49 - 3.10.50
Stane1983 Aug 3, 2015
25f795f
Apply Linux patch 3.10.50 - 3.10.51
Stane1983 Aug 3, 2015
89fffc4
Apply Linux patch 3.10.51 - 3.10.52
Stane1983 Aug 3, 2015
e0b9329
Apply Linux patch 3.10.52 - 3.10.53
Stane1983 Aug 3, 2015
f70dcab
Apply Linux patch 3.10.53 - 3.10.54
Stane1983 Aug 3, 2015
989ed95
Apply Linux patch 3.10.54 - 3.10.55
Stane1983 Aug 3, 2015
2e1a81f
Apply Linux patch 3.10.55 - 3.10.56
Stane1983 Aug 3, 2015
21bd39e
Apply Linux patch 3.10.56 - 3.10.57
Stane1983 Aug 3, 2015
5e81b98
Apply Linux patch 3.10.57 - 3.10.58
Stane1983 Aug 3, 2015
903b15e
Apply Linux patch 3.10.58 - 3.10.59
Stane1983 Aug 3, 2015
f9f2bd8
Apply Linux patch 3.10.59 - 3.10.60
Stane1983 Aug 3, 2015
2afd64b
Apply Linux patch 3.10.60 - 3.10.61
Stane1983 Aug 3, 2015
058c3b7
Apply Linux patch 3.10.61 - 3.10.62
Stane1983 Aug 3, 2015
a4e1311
Apply Linux patch 3.10.62 - 3.10.63
Stane1983 Aug 3, 2015
051666a
Fix compile: kernel/power/main.c - we don't have valid_state function
Stane1983 Aug 3, 2015
8c214f2
Apply Linux patch 3.10.63 - 3.10.64
Stane1983 Aug 3, 2015
3400e38
Apply Linux patch 3.10.64 - 3.10.65
Stane1983 Aug 3, 2015
8e2dd13
Apply Linux patch 3.10.65 - 3.10.66
Stane1983 Aug 3, 2015
d31a314
Apply Linux patch 3.10.66 - 3.10.67
Stane1983 Aug 3, 2015
fdd4c3a
Apply Linux patch 3.10.67 - 3.10.68
Stane1983 Aug 3, 2015
ee98242
Apply Linux patch 3.10.68 - 3.10.69
Stane1983 Aug 3, 2015
18a0dbb
Apply Linux patch 3.10.69 - 3.10.70
Stane1983 Aug 3, 2015
931fde7
Apply Linux patch 3.10.70 - 3.10.71
Stane1983 Aug 3, 2015
8c09d4b
Apply Linux patch 3.10.71 - 3.10.72
Stane1983 Aug 3, 2015
d90587b
Apply Linux patch 3.10.72 - 3.10.73
Stane1983 Aug 3, 2015
78638e8
Apply Linux patch 3.10.73 - 3.10.74
Stane1983 Aug 3, 2015
c6cdeaf
Apply Linux patch 3.10.74 - 3.10.75
Stane1983 Aug 3, 2015
3869818
Apply Linux patch 3.10.75 - 3.10.76
Stane1983 Aug 3, 2015
6c63c39
Apply Linux patch 3.10.76 - 3.10.77
Stane1983 Aug 3, 2015
bdbcd23
Apply Linux patch 3.10.77 - 3.10.78
Stane1983 Aug 3, 2015
ba13873
Apply Linux patch 3.10.78 - 3.10.79
Stane1983 Aug 3, 2015
efe3060
amlogic-pinctrl: Fix driver for 3.10.79 kernel
Stane1983 Aug 3, 2015
2be1d25
Apply Linux patch 3.10.79 - 3.10.80
Stane1983 Aug 3, 2015
3c7c6cc
gpio: Fix compile
Stane1983 Aug 3, 2015
7884067
Apply Linux patch 3.10.80 - 3.10.81
Stane1983 Aug 3, 2015
3546613
Apply Linux patch 3.10.81 - 3.10.82
Stane1983 Aug 3, 2015
2597172
Apply Linux patch 3.10.82 - 3.10.83
Stane1983 Aug 3, 2015
fd5e4f2
Apply Linux patch 3.10.83 - 3.10.84
Stane1983 Aug 3, 2015
7fd89bc
FIX: arm: define PHYS_OFFSET only if it's not already defined
Stane1983 Aug 3, 2015
cf612d7
Fix pinctrl driver
Stane1983 Aug 3, 2015
871da13
Apply Linux patch 3.10.84 - 3.10.85
Stane1983 Aug 3, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply Linux patch 3.10.74 - 3.10.75
  • Loading branch information
Stane1983 committed Aug 3, 2015
commit c6cdeaf7d4d047c169ba127e0ac603f7d3c8f836
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 10
SUBLEVEL = 74
SUBLEVEL = 75
EXTRAVERSION =
NAME = TOSSUG Baby Fish

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
return -EINVAL;

drv->safe_state_index = -1;
for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
for (i = CPUIDLE_DRIVER_STATE_START; i < CPUIDLE_STATE_MAX; i++) {
drv->states[i].name[0] = '\0';
drv->states[i].desc[0] = '\0';
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,6 @@ static int __init nbd_init(void)
return -EINVAL;
}

nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL);
if (!nbd_dev)
return -ENOMEM;

part_shift = 0;
if (max_part > 0) {
part_shift = fls(max_part);
Expand All @@ -840,6 +836,10 @@ static int __init nbd_init(void)
if (nbds_max > 1UL << (MINORBITS - part_shift))
return -EINVAL;

nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL);
if (!nbd_dev)
return -ENOMEM;

for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = alloc_disk(1 << part_shift);
if (!disk)
Expand Down
1 change: 1 addition & 0 deletions drivers/dma/omap-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ static int omap_dma_terminate_all(struct omap_chan *c)
* c->desc is NULL and exit.)
*/
if (c->desc) {
omap_dma_desc_free(&c->desc->vd);
c->desc = NULL;
/* Avoid stopping the dma twice */
if (!c->paused)
Expand Down
10 changes: 7 additions & 3 deletions drivers/gpu/drm/radeon/radeon_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)

static bool radeon_read_bios(struct radeon_device *rdev)
{
uint8_t __iomem *bios;
uint8_t __iomem *bios, val1, val2;
size_t size;

rdev->bios = NULL;
Expand All @@ -86,15 +86,19 @@ static bool radeon_read_bios(struct radeon_device *rdev)
return false;
}

if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
val1 = readb(&bios[0]);
val2 = readb(&bios[1]);

if (size == 0 || val1 != 0x55 || val2 != 0xaa) {
pci_unmap_rom(rdev->pdev, bios);
return false;
}
rdev->bios = kmemdup(bios, size, GFP_KERNEL);
rdev->bios = kzalloc(size, GFP_KERNEL);
if (rdev->bios == NULL) {
pci_unmap_rom(rdev->pdev, bios);
return false;
}
memcpy_fromio(rdev->bios, bios, size);
pci_unmap_rom(rdev->pdev, bios);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/imu/adis_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
iio_trigger_set_drvdata(adis->trig, adis);
ret = iio_trigger_register(adis->trig);

indio_dev->trig = adis->trig;
indio_dev->trig = iio_trigger_get(adis->trig);
if (ret)
goto error_free_irq;

Expand Down
25 changes: 14 additions & 11 deletions drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
#include <linux/poll.h>
#include "inv_mpu_iio.h"

static void inv_clear_kfifo(struct inv_mpu6050_state *st)
{
unsigned long flags;

/* take the spin lock sem to avoid interrupt kick in */
spin_lock_irqsave(&st->time_stamp_lock, flags);
kfifo_reset(&st->timestamps);
spin_unlock_irqrestore(&st->time_stamp_lock, flags);
}

int inv_reset_fifo(struct iio_dev *indio_dev)
{
int result;
Expand All @@ -51,6 +61,10 @@ int inv_reset_fifo(struct iio_dev *indio_dev)
INV_MPU6050_BIT_FIFO_RST);
if (result)
goto reset_fifo_fail;

/* clear timestamps fifo */
inv_clear_kfifo(st);

/* enable interrupt */
if (st->chip_config.accl_fifo_enable ||
st->chip_config.gyro_fifo_enable) {
Expand Down Expand Up @@ -84,16 +98,6 @@ int inv_reset_fifo(struct iio_dev *indio_dev)
return result;
}

static void inv_clear_kfifo(struct inv_mpu6050_state *st)
{
unsigned long flags;

/* take the spin lock sem to avoid interrupt kick in */
spin_lock_irqsave(&st->time_stamp_lock, flags);
kfifo_reset(&st->timestamps);
spin_unlock_irqrestore(&st->time_stamp_lock, flags);
}

/**
* inv_mpu6050_irq_handler() - Cache a timestamp at each data ready interrupt.
*/
Expand Down Expand Up @@ -187,7 +191,6 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
flush_fifo:
/* Flush HW and SW FIFOs. */
inv_reset_fifo(indio_dev);
inv_clear_kfifo(st);
mutex_unlock(&indio_dev->mlock);
iio_trigger_notify_done(indio_dev->trig);

Expand Down
8 changes: 8 additions & 0 deletions drivers/infiniband/core/umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
if (dmasync)
dma_set_attr(DMA_ATTR_WRITE_BARRIER, &attrs);

/*
* If the combination of the addr and size requested for this memory
* region causes an integer overflow, return error.
*/
if ((PAGE_ALIGN(addr + size) <= size) ||
(PAGE_ALIGN(addr + size) <= addr))
return ERR_PTR(-EINVAL);

if (!can_do_mlock())
return ERR_PTR(-EPERM);

Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,

entry->desc.async.element = element;
entry->desc.async.event_type = event;
entry->desc.async.reserved = 0;
entry->counter = counter;

list_add_tail(&entry->list, &file->async_file->event_list);
Expand Down
20 changes: 16 additions & 4 deletions drivers/infiniband/hw/mlx4/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ enum {
#define GUID_TBL_BLK_NUM_ENTRIES 8
#define GUID_TBL_BLK_SIZE (GUID_TBL_ENTRY_SIZE * GUID_TBL_BLK_NUM_ENTRIES)

/* Counters should be saturate once they reach their maximum value */
#define ASSIGN_32BIT_COUNTER(counter, value) do {\
if ((value) > U32_MAX) \
counter = cpu_to_be32(U32_MAX); \
else \
counter = cpu_to_be32(value); \
} while (0)

struct mlx4_mad_rcv_buf {
struct ib_grh grh;
u8 payload[256];
Expand Down Expand Up @@ -730,10 +738,14 @@ static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
static void edit_counter(struct mlx4_counter *cnt,
struct ib_pma_portcounters *pma_cnt)
{
pma_cnt->port_xmit_data = cpu_to_be32((be64_to_cpu(cnt->tx_bytes)>>2));
pma_cnt->port_rcv_data = cpu_to_be32((be64_to_cpu(cnt->rx_bytes)>>2));
pma_cnt->port_xmit_packets = cpu_to_be32(be64_to_cpu(cnt->tx_frames));
pma_cnt->port_rcv_packets = cpu_to_be32(be64_to_cpu(cnt->rx_frames));
ASSIGN_32BIT_COUNTER(pma_cnt->port_xmit_data,
(be64_to_cpu(cnt->tx_bytes) >> 2));
ASSIGN_32BIT_COUNTER(pma_cnt->port_rcv_data,
(be64_to_cpu(cnt->rx_bytes) >> 2));
ASSIGN_32BIT_COUNTER(pma_cnt->port_xmit_packets,
be64_to_cpu(cnt->tx_frames));
ASSIGN_32BIT_COUNTER(pma_cnt->port_rcv_packets,
be64_to_cpu(cnt->rx_frames));
}

static int iboe_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/s5p-mfc/s5p_mfc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/* Offset base used to differentiate between CAPTURE and OUTPUT
* while mmaping */
#define DST_QUEUE_OFF_BASE (TASK_SIZE / 2)
#define DST_QUEUE_OFF_BASE (1 << 30)

#define MFC_BANK1_ALLOC_CTX 0
#define MFC_BANK2_ALLOC_CTX 1
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/iwlwifi/dvm/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ struct iwl_priv {
unsigned long reload_jiffies;
int reload_count;
bool ucode_loaded;
bool init_ucode_run; /* Don't run init uCode again */

u8 plcp_delta_threshold;

Expand Down
5 changes: 0 additions & 5 deletions drivers/net/wireless/iwlwifi/dvm/ucode.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,6 @@ int iwl_run_init_ucode(struct iwl_priv *priv)
if (!priv->fw->img[IWL_UCODE_INIT].sec[0].len)
return 0;

if (priv->init_ucode_run)
return 0;

iwl_init_notification_wait(&priv->notif_wait, &calib_wait,
calib_complete, ARRAY_SIZE(calib_complete),
iwlagn_wait_calib, priv);
Expand All @@ -447,8 +444,6 @@ int iwl_run_init_ucode(struct iwl_priv *priv)
*/
ret = iwl_wait_notification(&priv->notif_wait, &calib_wait,
UCODE_CALIB_TIMEOUT);
if (!ret)
priv->init_ucode_run = true;

goto out;

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/be2iscsi/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5080,9 +5080,9 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
hba_free:
if (phba->msix_enabled)
pci_disable_msix(phba->pcidev);
iscsi_host_remove(phba->shost);
pci_dev_put(phba->pcidev);
iscsi_host_free(phba->shost);
pci_set_drvdata(pcidev, NULL);
disable_pci:
pci_disable_device(pcidev);
return ret;
Expand Down
4 changes: 3 additions & 1 deletion drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,11 @@ int scsi_prep_state_check(struct scsi_device *sdev, struct request *req)
"rejecting I/O to dead device\n");
ret = BLKPREP_KILL;
break;
case SDEV_QUIESCE:
case SDEV_BLOCK:
case SDEV_CREATED_BLOCK:
ret = BLKPREP_DEFER;
break;
case SDEV_QUIESCE:
/*
* If the devices is blocked we defer normal commands.
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ iscsit_handle_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
* traditional iSCSI block I/O.
*/
if (iscsit_allocate_iovecs(cmd) < 0) {
return iscsit_add_reject_cmd(cmd,
return iscsit_reject_cmd(cmd,
ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf);
}
immed_data = cmd->immediate_data;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/xhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
xhci->quirks |= XHCI_LPM_SUPPORT;
xhci->quirks |= XHCI_INTEL_HOST;
xhci->quirks |= XHCI_AVOID_BEI;
}
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) {
Expand All @@ -109,7 +110,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
* PPT chipsets.
*/
xhci->quirks |= XHCI_SPURIOUS_REBOOT;
xhci->quirks |= XHCI_AVOID_BEI;
}
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
Expand Down
9 changes: 7 additions & 2 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ static struct usb_device_id id_table_combined [] = {
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) },
/*
* ELV devices:
*/
Expand Down Expand Up @@ -1899,8 +1900,12 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)
{
struct usb_device *udev = serial->dev;

if ((udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) ||
(udev->product && !strcmp(udev->product, "BeagleBone/XDS100V2")))
if (udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems"))
return ftdi_jtag_probe(serial);

if (udev->product &&
(!strcmp(udev->product, "BeagleBone/XDS100V2") ||
!strcmp(udev->product, "SNAP Connect E10")))
return ftdi_jtag_probe(serial);

return 0;
Expand Down
6 changes: 6 additions & 0 deletions drivers/usb/serial/ftdi_sio_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,12 @@
*/
#define FTDI_NT_ORIONLXM_PID 0x7c90 /* OrionLXm Substation Automation Platform */

/*
* Synapse Wireless product ids (FTDI_VID)
* http://www.synapse-wireless.com
*/
#define FTDI_SYNAPSE_SS200_PID 0x9090 /* SS200 - SNAP Stick 200 */


/********************************/
/** third-party VID/PID combos **/
Expand Down
1 change: 1 addition & 0 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
cifsFileInfo_put(inv_file);
spin_lock(&cifs_file_list_lock);
++refind;
inv_file = NULL;
goto refind_writable;
}
}
Expand Down
14 changes: 10 additions & 4 deletions fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2372,10 +2372,14 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
/* buffered aio wouldn't have proper lock coverage today */
BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT));

if (unlikely(written <= 0))
goto no_sync;

if (((file->f_flags & O_DSYNC) && !direct_io) || IS_SYNC(inode) ||
((file->f_flags & O_DIRECT) && !direct_io)) {
ret = filemap_fdatawrite_range(file->f_mapping, *ppos,
*ppos + count - 1);
ret = filemap_fdatawrite_range(file->f_mapping,
iocb->ki_pos - written,
iocb->ki_pos - 1);
if (ret < 0)
written = ret;

Expand All @@ -2388,10 +2392,12 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
}

if (!ret)
ret = filemap_fdatawait_range(file->f_mapping, *ppos,
*ppos + count - 1);
ret = filemap_fdatawait_range(file->f_mapping,
iocb->ki_pos - written,
iocb->ki_pos - 1);
}

no_sync:
/*
* deep in g_f_a_w_n()->ocfs2_direct_IO we pass in a ocfs2_dio_end_io
* function pointer which is called when o_direct io completes so that
Expand Down
10 changes: 10 additions & 0 deletions fs/proc/task_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,9 +1110,19 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
return ret;
}

static int pagemap_open(struct inode *inode, struct file *file)
{
/* do not disclose physical addresses to unprivileged
userspace (closes a rowhammer attack vector) */
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return 0;
}

const struct file_operations proc_pagemap_operations = {
.llseek = mem_lseek, /* borrow this */
.read = pagemap_read,
.open = pagemap_open,
};
#endif /* CONFIG_PROC_PAGE_MONITOR */

Expand Down
4 changes: 3 additions & 1 deletion include/linux/blk_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ enum rq_flag_bits {
__REQ_ELVPRIV, /* elevator private data attached */
__REQ_FAILED, /* set if the request failed */
__REQ_QUIET, /* don't worry about errors */
__REQ_PREEMPT, /* set for "ide_preempt" requests */
__REQ_PREEMPT, /* set for "ide_preempt" requests and also
for requests for which the SCSI "quiesce"
state must be ignored. */
__REQ_ALLOCED, /* request came from our alloc pool */
__REQ_COPY_USER, /* contains copies of user pages */
__REQ_FLUSH_SEQ, /* request for flush sequence */
Expand Down
Loading