scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
Subsystems (19)
Sasha Levin
maintainerPATCH 1/27 scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
From: Stanley Chu <[email protected]>
[ Upstream commit c0a18ee0ce78d7957ec1a53be35b1b3beba80668 ]
It is confirmed that Micron device needs DELAY_BEFORE_LPM quirk to have a delay before VCC is powered off. Sdd Micron vendor ID and this quirk for Micron devices.
--- drivers/scsi/ufs/ufs_quirks.h | 1 + drivers/scsi/ufs/ufshcd.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/scsi/ufs/ufs_quirks.h +1 -0
@@ -12,6 +12,7 @@#define UFS_ANY_VENDOR 0xFFFF#define UFS_ANY_MODEL "ANY_MODEL" +#define UFS_VENDOR_MICRON 0x12C#define UFS_VENDOR_TOSHIBA 0x198#define UFS_VENDOR_SAMSUNG 0x1CE#define UFS_VENDOR_SKHYNIX 0x1AD
drivers/scsi/ufs/ufshcd.c +2 -0
@@ -216,6 +216,8 @@ ufs_get_desired_pm_lvl_for_dev_link_state(enum ufs_dev_pwr_mode dev_state,static struct ufs_dev_fix ufs_fixups[] = {/* UFS cards deviations table */ +UFS_FIX (UFS_VENDOR_MICRON ,UFS_ANY_MODEL , +UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM ),UFS_FIX (UFS_VENDOR_SAMSUNG ,UFS_ANY_MODEL ,UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM ), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 2/27 scsi: target: tcmu: Fix crash in tcmu_flush_dcache_range on ARM
From: Bodo Stroesser <[email protected]>
[ Upstream commit 3145550a7f8b08356c8ff29feaa6c56aca12901d ]
This patch fixes the following crash (see
https://bugzilla.kernel.org/show_bug.cgi?id 8045)
Process iscsi_trx (pid: 7496, stack limit = 0x0000000010dd111a)
CPU: 0 PID: 7496 Comm: iscsi_trx Not tainted 4.19.118-0419118-generic
#202004230533
Hardware name: Greatwall QingTian DF720/F601, BIOS 601FBE20 Sep 26 2019
pstate: 80400005 (Nzcv daif +PAN -UAO)
pc : flush_dcache_page+0x18/0x40
lr : is_ring_space_avail+0x68/0x2f8 [target_core_user]
sp : ffff000015123a80
x29: ffff000015123a80 x28: 0000000000000000
x27: 0000000000001000 x26: ffff000023ea5000
x25: ffffcfa25bbe08b8 x24: 0000000000000078
x23: ffff7e0000000000 x22: ffff000023ea5001
x21: ffffcfa24b79c000 x20: 0000000000000fff
x19: ffff7e00008fa940 x18: 0000000000000000
x17: 0000000000000000 x16: ffff2d047e709138
x15: 0000000000000000 x14: 0000000000000000
x13: 0000000000000000 x12: ffff2d047fbd0a40
x11: 0000000000000000 x10: 0000000000000030
x9 : 0000000000000000 x8 : ffffc9a254820a00
x7 : 00000000000013b0 x6 : 000000000000003f
x5 : 0000000000000040 x4 : ffffcfa25bbe08e8
x3 : 0000000000001000 x2 : 0000000000000078
x1 : ffffcfa25bbe08b8 x0 : ffff2d040bc88a18
Call trace:
flush_dcache_page+0x18/0x40
is_ring_space_avail+0x68/0x2f8 [target_core_user]
queue_cmd_ring+0x1f8/0x680 [target_core_user]
tcmu_queue_cmd+0xe4/0x158 [target_core_user]
__target_execute_cmd+0x30/0xf0 [target_core_mod]
target_execute_cmd+0x294/0x390 [target_core_mod]
transport_generic_new_cmd+0x1e8/0x358 [target_core_mod]
transport_handle_cdb_direct+0x50/0xb0 [target_core_mod]
iscsit_execute_cmd+0x2b4/0x350 [iscsi_target_mod]
iscsit_sequence_cmd+0xd8/0x1d8 [iscsi_target_mod]
iscsit_process_scsi_cmd+0xac/0xf8 [iscsi_target_mod]
iscsit_get_rx_pdu+0x404/0xd00 [iscsi_target_mod]
iscsi_target_rx_thread+0xb8/0x130 [iscsi_target_mod]
kthread+0x130/0x138
ret_from_fork+0x10/0x18
Code: f9000bf3 aa0003f3 aa1e03e0 d503201f (f9400260)
---[ end trace 1e451c73f4266776 ]---The solution is based on patch:
"scsi: target: tcmu: Optimize use of flush_dcache_page"
which restricts the use of tcmu_flush_dcache_range() to addresses from vmalloc'ed areas only.
This patch now replaces the virt_to_page() call in tcmu_flush_dcache_range() - which is wrong for vmalloced addrs - by vmalloc_to_page().
The patch was tested on ARM with kernel 4.19.118 and 5.7.2
--- drivers/target/target_core_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_user.c +1 -1
@@ -601,7 +601,7 @@ static inline void tcmu_flush_dcache_range(void *vaddr, size_t size) size =round_up (size+offset,PAGE_SIZE );while (size) { -flush_dcache_page (virt_to_page (start)); +flush_dcache_page (vmalloc_to_page (start)); start +=PAGE_SIZE ; size -=PAGE_SIZE ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 3/27 media: budget-core: Improve exception handling in budget_register()
In reply to Sasha LevinFrom: Chuhong Yuan <[email protected]>
[ Upstream commit fc0456458df8b3421dba2a5508cd817fbc20ea71 ]
budget_register() has no error handling after its failure. Add the missed undo functions for error handling to fix it.
--- drivers/media/pci/ttpci/budget-core.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/media/pci/ttpci/budget-core.c +8 -3
@@ -369,20 +369,25 @@ static int budget_register(struct budget *budget) ret = dvbdemux->dmx.add_frontend (&dvbdemux->dmx, &budget->hw_frontend);if (ret <0 ) -return ret; + goto err_release_dmx; budget->mem_frontend.source =DMX_MEMORY_FE ; ret = dvbdemux->dmx.add_frontend (&dvbdemux->dmx, &budget->mem_frontend);if (ret <0 ) -return ret; + goto err_release_dmx; ret = dvbdemux->dmx.connect_frontend (&dvbdemux->dmx, &budget->hw_frontend);if (ret <0 ) -return ret; + goto err_release_dmx;dvb_net_init (&budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx);return 0 ; + +err_release_dmx: +dvb_dmxdev_release (&budget->dmxdev); +dvb_dmx_release (&budget->demux); +return ret; }static void budget_unregister (struct budget *budget)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 4/27 media: coda: jpeg: add NULL check after kmalloc
In reply to Sasha LevinFrom: Chen Zhou <[email protected]>
[ Upstream commit 20171723144ca0d057b72e852536992fd371369a ]
Fixes coccicheck warning:
./drivers/media/platform/coda/coda-jpeg.c:331:3-31:
alloc with no test, possible model on line 354
Add NULL check after kmalloc.
--- drivers/media/platform/coda/coda-jpeg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/media/platform/coda/coda-jpeg.c +4 -1
@@ -327,8 +327,11 @@ int coda_jpeg_decode_header(struct coda_ctx *ctx, struct vb2_buffer *vb) "only 8-bit quantization tables supported\n");continue ; } -if (!ctx->params.jpeg_qmat_tab[i]) +if (!ctx->params.jpeg_qmat_tab[i]) { ctx->params.jpeg_qmat_tab[i] =kmalloc (64 ,GFP_KERNEL ); +if (!ctx->params.jpeg_qmat_tab[i]) +return -ENOMEM ; + }memcpy (ctx->params.jpeg_qmat_tab[i], quantization_tables[i].start,64 ); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 5/27 f2fs: fix to check page dirty status before writeback
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit eb1353cfa9c1e9415b03dc117f8399969fa02102 ]
In f2fs_write_raw_pages(), we need to check page dirty status before writeback, because there could be a racer (e.g. reclaimer) helps writebacking the dirty page.
--- fs/f2fs/compress.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/compress.c +6 -0
@@ -1310,6 +1310,12 @@ static int f2fs_write_raw_pages(struct compress_ctx *cc,congestion_wait (BLK_RW_ASYNC ,DEFAULT_IO_TIMEOUT );lock_page (cc->rpages[i]); + +if (!PageDirty (cc->rpages[i])) { +unlock_page (cc->rpages[i]); +continue ; + } +clear_page_dirty_for_io (cc->rpages[i]); goto retry_write; }
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 6/27 rtc: goldfish: Enable interrupt in set_alarm() when necessary
In reply to Sasha LevinFrom: Huacai Chen <[email protected]>
[ Upstream commit 22f8d5a1bf230cf8567a4121fc3789babb46336d ]
When use goldfish rtc, the "hwclock" command fails with "select() to /dev/rtc to wait for clock tick timed out". This is because "hwclock" need the set_alarm() hook to enable interrupt when alrm->enabled is true. This operation is missing in goldfish rtc (but other rtc drivers, such as cmos rtc, enable interrupt here), so add it.
--- drivers/rtc/rtc-goldfish.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/rtc-goldfish.c +1 -0
@@ -73,6 +73,7 @@ static int goldfish_rtc_set_alarm(struct device *dev, rtc_alarm64 =rtc_tm_to_time64 (&alrm->time) *NSEC_PER_SEC ;writel ((rtc_alarm64 >>32 ), base +TIMER_ALARM_HIGH );writel (rtc_alarm64, base +TIMER_ALARM_LOW ); +writel (1 , base +TIMER_IRQ_ENABLED ); }else {/* * if this function was called with enabled=0
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 7/27 media: vpss: clean up resources in init
In reply to Sasha LevinFrom: Evgeny Novikov <[email protected]>
[ Upstream commit 9c487b0b0ea7ff22127fe99a7f67657d8730ff94 ]
If platform_driver_register() fails within vpss_init() resources are not cleaned up. The patch fixes this issue by introducing the corresponding error handling.
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/media/platform/davinci/vpss.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/media/platform/davinci/vpss.c +16 -4
@@ -505,19 +505,31 @@ static void vpss_exit(void)static int __init vpss_init (void ) { +int ret; +if (!request_mem_region (VPSS_CLK_CTRL ,4 ,"vpss_clock_control" ))return -EBUSY ; oper_cfg.vpss_regs_base2 =ioremap (VPSS_CLK_CTRL ,4 );if (unlikely (!oper_cfg.vpss_regs_base2)) { -release_mem_region (VPSS_CLK_CTRL ,4 ); -return -ENOMEM ; + ret = -ENOMEM ; + goto err_ioremap; }writel (VPSS_CLK_CTRL_VENCCLKEN | -VPSS_CLK_CTRL_DACCLKEN , oper_cfg.vpss_regs_base2); +VPSS_CLK_CTRL_DACCLKEN , oper_cfg.vpss_regs_base2); + + ret =platform_driver_register (&vpss_driver); +if (ret) + goto err_pd_register; + +return 0 ; -return platform_driver_register (&vpss_driver); +err_pd_register: +iounmap (oper_cfg.vpss_regs_base2); +err_ioremap: +release_mem_region (VPSS_CLK_CTRL ,4 ); +return ret; }subsys_initcall (vpss_init);module_exit (vpss_exit);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 8/27 f2fs: should avoid inode eviction in synchronous path
In reply to Sasha LevinFrom: Jaegeuk Kim <[email protected]>
[ Upstream commit b0f3b87fb3abc42c81d76c6c5795f26dbdb2f04b ]
https://bugzilla.kernel.org/show_bug.cgi?id=208565
PID: 257 TASK: ecdd0000 CPU: 0 COMMAND: "init"
#0 [<c0b420ec>] (__schedule) from [<c0b423c8>] #1 [<c0b423c8>] (schedule) from [<c0b459d4>]
#2 [<c0b459d4>] (rwsem_down_read_failed) from [<c0b44fa0>] #3 [<c0b44fa0>] (down_read) from [<c044233c>]
#4 [<c044233c>] (f2fs_truncate_blocks) from [<c0442890>] #5 [<c0442890>] (f2fs_truncate) from [<c044d408>] #6 [<c044d408>] (f2fs_evict_inode) from [<c030be18>] #7 [<c030be18>] (evict) from [<c030a558>]
#8 [<c030a558>] (iput) from [<c047c600>]
#9 [<c047c600>] (f2fs_sync_node_pages) from [<c0465414>]
#10 [<c0465414>] (f2fs_write_checkpoint) from [<c04575f4>] #11 [<c04575f4>] (f2fs_sync_fs) from [<c0441918>] #12 [<c0441918>] (f2fs_do_sync_file) from [<c0441098>] #13 [<c0441098>] (f2fs_sync_file) from [<c0323fa0>] #14 [<c0323fa0>] (vfs_fsync_range) from [<c0324294>] #15 [<c0324294>] (do_fsync) from [<c0324014>]
#16 [<c0324014>] (sys_fsync) from [<c0108bc0>]
This can be caused by flush_dirty_inode() in f2fs_sync_node_pages() where iput() requires f2fs_lock_op() again resulting in livelock.
--- fs/f2fs/node.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
fs/f2fs/node.c +7 -3
@@ -1924,8 +1924,12 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi, goto continue_unlock; } -/* flush inline_data, if it's async context. */ -if (do_balance &&is_inline_node (page)) { +/* flush inline_data/inode, if it's async context. */ +if (!do_balance) + goto write_node; + +/* flush inline_data */ +if (is_inline_node (page)) {clear_inline_node (page);unlock_page (page);flush_inline_data (sbi,ino_of_node (page));
@@ -1938,7 +1942,7 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi,if (flush_dirty_inode (page)) goto lock_node; } - +write_node:f2fs_wait_on_page_writeback (page,NODE , true, true);if (!clear_page_dirty_for_io (page))
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 9/27 Input: psmouse - add a newline when printing 'proto' by sysfs
In reply to Sasha LevinFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 4aec14de3a15cf9789a0e19c847f164776f49473 ]
When I cat parameter 'proto' by sysfs, it displays as follows. It's better to add a newline for easy reading.
root@syzkaller:~# cat /sys/module/psmouse/parameters/proto autoroot@syzkaller:~#
--- drivers/input/mouse/psmouse-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/mouse/psmouse-base.c +1 -1
@@ -2042,7 +2042,7 @@ static int psmouse_get_maxproto(char *buffer, const struct kernel_param *kp) {int type = *((unsigned int *)kp->arg); -return sprintf (buffer,"%s" ,psmouse_protocol_by_type (type)->name); +return sprintf (buffer,"%s\n" ,psmouse_protocol_by_type (type)->name); }static int __init psmouse_init (void )
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 10/27 MIPS: Fix unable to reserve memory for Crash kernel
In reply to Sasha LevinFrom: Jinyang He <[email protected]>
[ Upstream commit b1ce9716f3b5ed3b49badf1f003b9e34b7ead0f9 ]
Use 0 as the align parameter in memblock_find_in_range() is incorrect when we reserve memory for Crash kernel.
The environment as follows:
[ 0.000000] MIPS: machine is loongson,loongson64c-4core-rs780e ... [ 1.951016] crashkernel=64M@128M
The warning as follows:
[ 0.000000] Invalid memory region reserved for crash kernel
And the iomem as follows:
00200000-0effffff : System RAM
04000000-0484009f : Kernel code
048400a0-04ad7fff : Kernel data
04b40000-05c4c6bf : Kernel bss
1a000000-1bffffff : pci@1a000000
...
The align parameter may be finally used by round_down() or round_up(). Like the following call tree:
mips-next: mm/memblock.c
memblock_find_in_range
└── memblock_find_in_range_node
├── __memblock_find_range_bottom_up
│ └── round_up
└── __memblock_find_range_top_down
└── round_down
\#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)\#define round_down(x, y) ((x) & ~__round_mask(x, y)) \#define __round_mask(x, y) ((__typeof__(x))((y)-1))
The round_down(or round_up)'s second parameter must be a power of 2. If the second parameter is 0, it both will return 0.
Use 1 as the parameter to fix the bug and the iomem as follows:
00200000-0effffff : System RAM
04000000-0484009f : Kernel code
048400a0-04ad7fff : Kernel data
04b40000-05c4c6bf : Kernel bss
08000000-0bffffff : Crash kernel
1a000000-1bffffff : pci@1a000000
...
--- arch/mips/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/setup.c +1 -1
@@ -497,7 +497,7 @@ static void __init mips_parse_crashkernel(void)if (ret !=0 || crash_size <=0 )return ; -if (!memblock_find_in_range (crash_base, crash_base + crash_size, crash_size,0 )) { +if (!memblock_find_in_range (crash_base, crash_base + crash_size, crash_size,1 )) {pr_warn ("Invalid memory region reserved for crash kernel\n" );return ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 11/27 m68knommu: fix overwriting of bits in ColdFire V3 cache control
In reply to Sasha LevinFrom: Greg Ungerer <[email protected]>
[ Upstream commit bdee0e793cea10c516ff48bf3ebb4ef1820a116b ]
The Cache Control Register (CACR) of the ColdFire V3 has bits that control high level caching functions, and also enable/disable the use of the alternate stack pointer register (the EUSP bit) to provide separate supervisor and user stack pointer registers. The code as it is today will blindly clear the EUSP bit on cache actions like invalidation. So it is broken for this case - and that will result in failed booting (interrupt entry and exit processing will be completely hosed).
This only affects ColdFire V3 parts that support the alternate stack register (like the 5329 for example) - generally speaking new parts do, older parts don't. It has no impact on ColdFire V3 parts with the single stack pointer, like the 5307 for example.
Fix the cache bit defines used, so they maintain the EUSP bit when carrying out cache actions through the CACR register.
--- arch/m68k/include/asm/m53xxacr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/m68k/include/asm/m53xxacr.h +3 -3
@@ -89,9 +89,9 @@* coherency though in all cases. And for copyback caches we will need * to push cached data as well. */ -#define CACHE_INIT CACR_CINVA -#define CACHE_INVALIDATE CACR_CINVA -#define CACHE_INVALIDATED CACR_CINVA +#define CACHE_INIT (CACHE_MODE + CACR_CINVA - CACR_EC) +#define CACHE_INVALIDATE (CACHE_MODE + CACR_CINVA) +#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINVA)#define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \ (0x000f0000) + \
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 12/27 svcrdma: Fix another Receive buffer leak
In reply to Sasha LevinFrom: Chuck Lever <[email protected]>
[ Upstream commit 64d26422516b2e347b32e6d9b1d40b3c19a62aae ]
During a connection tear down, the Receive queue is flushed before the device resources are freed. Typically, all the Receives flush with IB_WR_FLUSH_ERR.
However, any pending successful Receives flush with IB_WR_SUCCESS, and the server automatically posts a fresh Receive to replace the completing one. This happens even after the connection has closed and the RQ is drained. Receives that are posted after the RQ is drained appear never to complete, causing a Receive resource leak. The leaked Receive buffer is left DMA-mapped.
To prevent these late-posted recv_ctxt's from leaking, block new Receive posting after XPT_CLOSE is set.
--- net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 2 ++ 1 file changed, 2 insertions(+)
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +2 -0
@@ -265,6 +265,8 @@ static int svc_rdma_post_recv(struct svcxprt_rdma *rdma) {struct svc_rdma_recv_ctxt *ctxt; +if (test_bit (XPT_CLOSE , &rdma->sc_xprt.xpt_flags)) +return 0 ; ctxt =svc_rdma_recv_ctxt_get (rdma);if (!ctxt)return -ENOMEM ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 13/27 xfs: fix inode quota reservation checks
In reply to Sasha LevinFrom: "Darrick J. Wong" <[email protected]>
[ Upstream commit f959b5d037e71a4d69b5bf71faffa065d9269b4a ]
xfs_trans_dqresv is the function that we use to make reservations against resource quotas. Each resource contains two counters: the q_core counter, which tracks resources allocated on disk; and the dquot reservation counter, which tracks how much of that resource has either been allocated or reserved by threads that are working on metadata updates.
For disk blocks, we compare the proposed reservation counter against the hard and soft limits to decide if we're going to fail the operation. However, for inodes we inexplicably compare against the q_core counter, not the incore reservation count.
Since the q_core counter is always lower than the reservation count and we unlock the dquot between reservation and transaction commit, this means that multiple threads can reserve the last inode count before we hit the hard limit, and when they commit, we'll be well over the hard limit.
Fix this by checking against the incore inode reservation counter, since we would appear to maintain that correctly (and that's what we report in GETQUOTA).
--- fs/xfs/xfs_trans_dquot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_trans_dquot.c +1 -1
@@ -647,7 +647,7 @@ xfs_trans_dqresv( } }if (ninos >0 ) { - total_count =be64_to_cpu (dqp->q_core.d_icount) + ninos; + total_count = dqp->q_res_icount + ninos; timer =be32_to_cpu (dqp->q_core.d_itimer); warns =be16_to_cpu (dqp->q_core.d_iwarns); warnlimit = defq->iwarnlimit;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 14/27 drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
In reply to Sasha LevinFrom: Felix Kuehling <[email protected]>
[ Upstream commit c0001213d195d1bac83e0744c06ff06dd5a8ba53 ]
VMAs with a pg_offs that's offset from the start of the vma_node need to adjust the offset within the BO accordingly. This matches the offset calculation in ttm_bo_vm_fault_reserved.
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +3 -1
@@ -505,8 +505,10 @@ static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo,int ttm_bo_vm_access (struct vm_area_struct *vma,unsigned long addr,void *buf,int len,int write) { -unsigned long offset = (addr) - vma->vm_start;struct ttm_buffer_object *bo = vma->vm_private_data; +unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff -drm_vma_node_start (&bo->base.vma_node)) + <<PAGE_SHIFT );int ret;if (len <1 || (offset + len) >>PAGE_SHIFT > bo->num_pages)
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 15/27 riscv: Fixup static_obj() fail
In reply to Sasha LevinFrom: Guo Ren <[email protected]>
[ Upstream commit 6184358da0004c8fd940afda6c0a0fa4027dc911 ]
When enable LOCKDEP, static_obj() will cause error. Because some __initdata static variables is before _stext:
static int static_obj(const void *obj)
{
unsigned long start = (unsigned long) &_stext,
end = (unsigned long) &_end,
addr = (unsigned long) obj;
/*
* static variable?
*/
if ((addr >= start) && (addr < end))
return 1;[ 0.067192] INFO: trying to register non-static key. [ 0.067325] the code is fine but needs lockdep annotation. [ 0.067449] turning off the locking correctness validator. [ 0.067718] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.7.0-rc7-dirty #44 [ 0.067945] Call Trace: [ 0.068369] [<ffffffe00020323c>] walk_stackframe+0x0/0xa4 [ 0.068506] [<ffffffe000203422>] show_stack+0x2a/0x34 [ 0.068631] [<ffffffe000521e4e>] dump_stack+0x94/0xca [ 0.068757] [<ffffffe000255a4e>] register_lock_class+0x5b8/0x5bc [ 0.068969] [<ffffffe000255abe>] __lock_acquire+0x6c/0x1d5c [ 0.069101] [<ffffffe0002550fe>] lock_acquire+0xae/0x312 [ 0.069228] [<ffffffe000989a8e>] _raw_spin_lock_irqsave+0x40/0x5a [ 0.069357] [<ffffffe000247c64>] complete+0x1e/0x50 [ 0.069479] [<ffffffe000984c38>] rest_init+0x1b0/0x28a [ 0.069660] [<ffffffe0000016a2>] 0xffffffe0000016a2 [ 0.069779] [<ffffffe000001b84>] 0xffffffe000001b84 [ 0.069953] [<ffffffe000001092>] 0xffffffe000001092
static __initdata DECLARE_COMPLETION(kthreadd_done);
noinline void __ref rest_init(void)
{
...
complete(&kthreadd_done);--- arch/riscv/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/vmlinux.lds.S +1 -1
@@ -22,6 +22,7 @@ SECTIONS /* Beginning of code and text segment */ . = LOAD_OFFSET; _start = .; + _stext = .; HEAD_TEXT_SECTION . = ALIGN(PAGE_SIZE);
@@ -54,7 +55,6 @@ SECTIONS . = ALIGN(SECTION_ALIGN); .text : { _text = .; - _stext = .; TEXT_TEXT SCHED_TEXT CPUIDLE_TEXT
Signature · 7 lines
2.25.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Sasha Levin
maintainerPATCH 16/27 jffs2: fix UAF problem
In reply to Sasha LevinFrom: Zhe Li <[email protected]>
[ Upstream commit 798b7347e4f29553db4b996393caf12f5b233daf ]
The log of UAF problem is listed below.
BUG: KASAN: use-after-free in jffs2_rmdir+0xa4/0x1cc [jffs2] at addr c1f165fc Read of size 4 by task rm/8283 =============================================================================
BUG kmalloc-32 (Tainted: P B O ): kasan: bad access detected
-----------------------------------------------------------------------------
INFO: Allocated in 0xbbbbbbbb age=3054364 cpu=0 pid=0
0xb0bba6ef
jffs2_write_dirent+0x11c/0x9c8 [jffs2]
__slab_alloc.isra.21.constprop.25+0x2c/0x44
__kmalloc+0x1dc/0x370
jffs2_write_dirent+0x11c/0x9c8 [jffs2]
jffs2_do_unlink+0x328/0x5fc [jffs2]
jffs2_rmdir+0x110/0x1cc [jffs2]
vfs_rmdir+0x180/0x268
do_rmdir+0x2cc/0x300
ret_from_syscall+0x0/0x3c
INFO: Freed in 0x205b age=3054364 cpu=0 pid=0
0x2e9173
jffs2_add_fd_to_list+0x138/0x1dc [jffs2]
jffs2_add_fd_to_list+0x138/0x1dc [jffs2]
jffs2_garbage_collect_dirent.isra.3+0x21c/0x288 [jffs2]
jffs2_garbage_collect_live+0x16bc/0x1800 [jffs2]
jffs2_garbage_collect_pass+0x678/0x11d4 [jffs2]
jffs2_garbage_collect_thread+0x1e8/0x3b0 [jffs2]
kthread+0x1a8/0x1b0
ret_from_kernel_thread+0x5c/0x64
Call Trace:
[c17ddd20] [c02452d4] kasan_report.part.0+0x298/0x72c (unreliable)
[c17ddda0] [d2509680] jffs2_rmdir+0xa4/0x1cc [jffs2]
[c17dddd0] [c026da04] vfs_rmdir+0x180/0x268
[c17dde00] [c026f4e4] do_rmdir+0x2cc/0x300
[c17ddf40] [c001a658] ret_from_syscall+0x0/0x3cThe root cause is that we don't get "jffs2_inode_info.sem" before we scan list "jffs2_inode_info.dents" in function jffs2_rmdir. This patch add codes to get "jffs2_inode_info.sem" before we scan "jffs2_inode_info.dents" to slove the UAF problem.
--- fs/jffs2/dir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/jffs2/dir.c +5 -1
@@ -590,10 +590,14 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)int ret;uint32_t now =JFFS2_NOW (); +mutex_lock (&f->sem);for (fd = f->dents ; fd; fd = fd->next) { -if (fd->ino) +if (fd->ino) { +mutex_unlock (&f->sem);return -ENOTEMPTY ; + } } +mutex_unlock (&f->sem); ret =jffs2_do_unlink (c, dir_f, dentry->d_name.name, dentry->d_name.len, f, now);
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Sasha Levin
maintainerPATCH 17/27 ceph: fix use-after-free for fsc->mdsc
In reply to Sasha LevinFrom: Xiubo Li <[email protected]>
[ Upstream commit a7caa88f8b72c136f9a401f498471b8a8e35370d ]
If the ceph_mdsc_init() fails, it will free the mdsc already.
--- fs/ceph/mds_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +2 -1
@@ -4359,7 +4359,6 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc) goto err_mdsc; } - fsc->mdsc = mdsc;init_completion (&mdsc->safe_umount_waiters);init_waitqueue_head (&mdsc->session_close_wq);INIT_LIST_HEAD (&mdsc->waiting_for_map);
@@ -4414,6 +4413,8 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc)strscpy (mdsc->nodename,utsname ()->nodename,sizeof (mdsc->nodename)); + + fsc->mdsc = mdsc;return 0 ; err_mdsmap:
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 18/27 swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses
In reply to Sasha LevinFrom: Boris Ostrovsky <[email protected]>
[ Upstream commit 8b1e868f66076490189a36d984fcce286cdd6295 ]
xen_alloc_coherent_pages might return pages for which virt_to_phys and virt_to_page don't work, e.g. ioremap'ed pages.
So in xen_swiotlb_free_coherent we can't assume that virt_to_page works. Instead add a is_vmalloc_addr check and use vmalloc_to_page on vmalloc virt addresses.
This patch fixes the following crash at boot on RPi4 (the underlying issue is not RPi4 specific):
https://marc.info/?l=xen-devel&m=158862573216800
--- drivers/xen/swiotlb-xen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/xen/swiotlb-xen.c +7 -1
@@ -335,6 +335,7 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,int order =get_order (size);phys_addr_t phys;u64 dma_mask =DMA_BIT_MASK (32 ); +struct page *page;if (hwdev && hwdev->coherent_dma_mask) dma_mask = hwdev->coherent_dma_mask;
@@ -346,9 +347,14 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,/* Convert the size to actually allocated. */ size =1UL << (order +XEN_PAGE_SHIFT ); +if (is_vmalloc_addr (vaddr)) + page =vmalloc_to_page (vaddr); +else + page =virt_to_page (vaddr); +if (!WARN_ON ((dev_addr + size -1 > dma_mask) ||range_straddles_page_boundary (phys, size)) && -TestClearPageXenRemapped (virt_to_page (vaddr))) +TestClearPageXenRemapped (page))xen_destroy_contiguous_region (phys, order);xen_free_coherent_pages (hwdev, size, vaddr, (dma_addr_t )phys, attrs);
Signature · 6 lines
2.25.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 19/27 cpufreq: intel_pstate: Fix cpuinfo_max_freq when MSR_TURBO_RATIO_LIMIT is 0
In reply to Sasha LevinFrom: Srinivas Pandruvada <[email protected]>
[ Upstream commit 4daca379c703ff55edc065e8e5173dcfeecf0148 ]
The MSR_TURBO_RATIO_LIMIT can be 0. This is not an error. User can update this MSR via BIOS settings on some systems or can use msr tools to update. Also some systems boot with value = 0.
This results in display of cpufreq/cpuinfo_max_freq wrong. This value will be equal to cpufreq/base_frequency, even though turbo is enabled.
But platform will still function normally in HWP mode as we get max 1-core frequency from the MSR_HWP_CAPABILITIES. This MSR is already used to calculate cpu->pstate.turbo_freq, which is used for to set policy->cpuinfo.max_freq. But some other places cpu->pstate.turbo_pstate is used. For example to set policy->max.
To fix this, also update cpu->pstate.turbo_pstate when updating cpu->pstate.turbo_freq.
--- drivers/cpufreq/intel_pstate.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/intel_pstate.c +1 -0
@@ -1572,6 +1572,7 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)intel_pstate_get_hwp_max (cpu->cpu, &phy_max, ¤t_max); cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling; + cpu->pstate.turbo_pstate = phy_max; }else { cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 20/27 scsi: libfc: Free skb in fc_disc_gpn_id_resp() for valid cases
In reply to Sasha LevinFrom: Javed Hasan <[email protected]>
[ Upstream commit ec007ef40abb6a164d148b0dc19789a7a2de2cc8 ]
In fc_disc_gpn_id_resp(), skb is supposed to get freed in all cases except for PTR_ERR. However, in some cases it didn't.
This fix is to call fc_frame_free(fp) before function returns.
--- drivers/scsi/libfc/fc_disc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/scsi/libfc/fc_disc.c +9 -3
@@ -581,8 +581,12 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,if (PTR_ERR (fp) == -FC_EX_CLOSED ) goto out; -if (IS_ERR (fp)) - goto redisc; +if (IS_ERR (fp)) { +mutex_lock (&disc->disc_mutex); +fc_disc_restart (disc); +mutex_unlock (&disc->disc_mutex); + goto out; + } cp =fc_frame_payload_get (fp,sizeof (*cp));if (!cp)
@@ -609,7 +613,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp, new_rdata->disc_id = disc->disc_id;fc_rport_login (new_rdata); } - goto out; + goto free_fp; } rdata->disc_id = disc->disc_id;mutex_unlock (&rdata->rp_mutex);
@@ -626,6 +630,8 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,fc_disc_restart (disc);mutex_unlock (&disc->disc_mutex); } +free_fp: +fc_frame_free (fp); out:kref_put (&rdata->kref, fc_rport_destroy);if (!IS_ERR (fp))
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 21/27 virtio_ring: Avoid loop when vq is broken in virtqueue_poll
In reply to Sasha LevinFrom: Mao Wenan <[email protected]>
[ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ]
The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%.
call trace as below:virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
--- drivers/virtio/virtio_ring.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/virtio/virtio_ring.c +3 -0
@@ -1960,6 +1960,9 @@ bool virtqueue_poll(struct virtqueue *_vq, unsigned last_used_idx) {struct vring_virtqueue *vq =to_vvq (_vq); +if (unlikely (vq->broken)) +return false; +virtio_mb (vq->weak_barriers);return vq->packed_ring ?virtqueue_poll_packed (_vq, last_used_idx) :virtqueue_poll_split (_vq, last_used_idx);
Signature · 6 lines
2.25.1 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Sasha Levin
maintainerPATCH 22/27 media: camss: fix memory leaks on error handling paths in probe
In reply to Sasha LevinFrom: Evgeny Novikov <[email protected]>
[ Upstream commit f45882cfb152f5d3a421fd58f177f227e44843b9 ]
camss_probe() does not free camss on error handling paths. The patch introduces an additional error label for this purpose. Besides, it removes call of v4l2_async_notifier_cleanup() from camss_of_parse_ports() since its caller, camss_probe(), cleans up all its resources itself.
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/media/platform/qcom/camss/camss.c | 30 +++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-)
drivers/media/platform/qcom/camss/camss.c +20 -10
@@ -504,7 +504,6 @@ static int camss_of_parse_ports(struct camss *camss)return num_subdevs; err_cleanup: -v4l2_async_notifier_cleanup (&camss->notifier);of_node_put (node);return ret; }
@@ -835,29 +834,38 @@ static int camss_probe(struct platform_device *pdev) camss->csid_num =4 ; camss->vfe_num =2 ; }else { -return -EINVAL ; + ret = -EINVAL ; + goto err_free; } camss->csiphy =devm_kcalloc (dev, camss->csiphy_num,sizeof (*camss->csiphy),GFP_KERNEL ); -if (!camss->csiphy) -return -ENOMEM ; +if (!camss->csiphy) { + ret = -ENOMEM ; + goto err_free; + } camss->csid =devm_kcalloc (dev, camss->csid_num,sizeof (*camss->csid),GFP_KERNEL ); -if (!camss->csid) -return -ENOMEM ; +if (!camss->csid) { + ret = -ENOMEM ; + goto err_free; + } camss->vfe =devm_kcalloc (dev, camss->vfe_num,sizeof (*camss->vfe),GFP_KERNEL ); -if (!camss->vfe) -return -ENOMEM ; +if (!camss->vfe) { + ret = -ENOMEM ; + goto err_free; + }v4l2_async_notifier_init (&camss->notifier); num_subdevs =camss_of_parse_ports (camss); -if (num_subdevs <0 ) -return num_subdevs; +if (num_subdevs <0 ) { + ret = num_subdevs; + goto err_cleanup; + } ret =camss_init_subdevices (camss);if (ret <0 )
@@ -936,6 +944,8 @@ static int camss_probe(struct platform_device *pdev)v4l2_device_unregister (&camss->v4l2_dev); err_cleanup:v4l2_async_notifier_cleanup (&camss->notifier); +err_free: +kfree (camss);return ret; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 23/27 tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference
In reply to Sasha LevinFrom: Gaurav Singh <[email protected]>
[ Upstream commit d830020656c5b68ced962ed3cb51a90e0a89d4c4 ]
Haven't reproduced this issue. This PR is does a minor code cleanup.
--- tools/testing/selftests/cgroup/cgroup_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cgroup/cgroup_util.c +1 -1
@@ -106,7 +106,7 @@ int cg_read_strcmp(const char *cgroup, const char *control,/* Handle the case of comparing against empty string */ if (!expected) - size =32 ; +return -1 ;else size =strlen (expected) +1 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 24/27 xfs: Fix UBSAN null-ptr-deref in xfs_sysfs_init
In reply to Sasha LevinFrom: Eiichi Tsukata <[email protected]>
[ Upstream commit 96cf2a2c75567ff56195fe3126d497a2e7e4379f ]
If xfs_sysfs_init is called with parent_kobj == NULL, UBSAN shows the following warning:
UBSAN: null-ptr-deref in ./fs/xfs/xfs_sysfs.h:37:23 member access within null pointer of type 'struct xfs_kobj' Call Trace: dump_stack+0x10e/0x195 ubsan_type_mismatch_common+0x241/0x280 __ubsan_handle_type_mismatch_v1+0x32/0x40 init_xfs_fs+0x12b/0x28f do_one_initcall+0xdd/0x1d0 do_initcall_level+0x151/0x1b6 do_initcalls+0x50/0x8f do_basic_setup+0x29/0x2b kernel_init_freeable+0x19f/0x20b kernel_init+0x11/0x1e0 ret_from_fork+0x22/0x30
Fix it by checking parent_kobj before the code accesses its member.
--- fs/xfs/xfs_sysfs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/xfs/xfs_sysfs.h +4 -2
@@ -32,9 +32,11 @@ xfs_sysfs_init(struct xfs_kobj *parent_kobj, const char *name) { + struct kobject *parent; + + parent = parent_kobj ? &parent_kobj->kobject :NULL ;init_completion (&kobj->complete); -return kobject_init_and_add (&kobj->kobject, ktype, - &parent_kobj->kobject,"%s" , name); +return kobject_init_and_add (&kobj->kobject, ktype, parent,"%s" , name); } static inline void
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 25/27 alpha: fix annotation of io{read,write}{16,32}be()
In reply to Sasha LevinFrom: Luc Van Oostenryck <[email protected]>
[ Upstream commit bd72866b8da499e60633ff28f8a4f6e09ca78efe ]
These accessors must be used to read/write a big-endian bus. The value returned or written is native-endian.
However, these accessors are defined using be{16,32}_to_cpu() or cpu_to_be{16,32}() to make the endian conversion but these expect a __be{16,32} when none is present. Keeping them would need a force cast that would solve nothing at all.
So, do the conversion using swab{16,32}, like done in asm-generic for similar situations.
--- arch/alpha/include/asm/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/alpha/include/asm/io.h +4 -4
@@ -489,10 +489,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr) }#endif -#define ioread16be (p) be16_to_cpu(ioread16(p)) -#define ioread32be (p) be32_to_cpu(ioread32(p)) -#define iowrite16be (v,p) iowrite16(cpu_to_be16(v), (p)) -#define iowrite32be (v,p) iowrite32(cpu_to_be32(v), (p)) +#define ioread16be (p) swab16(ioread16(p)) +#define ioread32be (p) swab32(ioread32(p)) +#define iowrite16be (v,p) iowrite16(swab16(v), (p)) +#define iowrite32be (v,p) iowrite32(swab32(v), (p))#define inb_p inb#define inw_p inw
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 26/27 fat: fix fat_ra_init() for data clusters == 0
In reply to Sasha LevinFrom: OGAWA Hirofumi <[email protected]>
[ Upstream commit a090a5a7d73f79a9ae2dcc6e60d89bfc6864a65a ]
If data clusters == 0, fat_ra_init() calls the ->ent_blocknr() for the cluster beyond ->max_clusters.
This checks the limit before initialization to suppress the warning.
--- fs/fat/fatent.c | 3 +++ 1 file changed, 3 insertions(+)
fs/fat/fatent.c +3 -0
@@ -657,6 +657,9 @@ static void fat_ra_init(struct super_block *sb, struct fatent_ra *ra,unsigned long ra_pages = sb->s_bdi->ra_pages;unsigned int reada_blocks; +if (fatent->entry >= ent_limit) +return ; +if (ra_pages > sb->s_bdi->io_pages) ra_pages =rounddown (ra_pages, sb->s_bdi->io_pages); reada_blocks = ra_pages << (PAGE_SHIFT - sb->s_blocksize_bits +1 );
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 27/27 fs/signalfd.c: fix inconsistent return codes for signalfd4
In reply to Sasha LevinFrom: Helge Deller <[email protected]>
[ Upstream commit a089e3fd5a82aea20f3d9ec4caa5f4c65cc2cfcc ]
The kernel signalfd4() syscall returns different error codes when called either in compat or native mode. This behaviour makes correct emulation in qemu and testing programs like LTP more complicated.
Fix the code to always return -in both modes- EFAULT for unaccessible user memory, and EINVAL when called with an invalid signal mask.
--- fs/signalfd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/signalfd.c +6 -4
@@ -314,9 +314,10 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, {sigset_t mask; -if (sizemask !=sizeof (sigset_t) || -copy_from_user (&mask, user_mask,sizeof (mask))) +if (sizemask !=sizeof (sigset_t))return -EINVAL ; +if (copy_from_user (&mask, user_mask,sizeof (mask))) +return -EFAULT ;return do_signalfd4 (ufd, &mask, flags); }
@@ -325,9 +326,10 @@ SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask, {sigset_t mask; -if (sizemask !=sizeof (sigset_t) || -copy_from_user (&mask, user_mask,sizeof (mask))) +if (sizemask !=sizeof (sigset_t))return -EINVAL ; +if (copy_from_user (&mask, user_mask,sizeof (mask))) +return -EFAULT ;return do_signalfd4 (ufd, &mask,0 ); }
Signature · 1 line
2.25.1