RDMA/mlx5: Relax DEVX access upon modify commands
Subsystems (8)
Sasha Levin
maintainerPATCH 1/6 RDMA/mlx5: Relax DEVX access upon modify commands
From: Yishai Hadas <[email protected]>
[ Upstream commit be551ee1574280ef8afbf7c271212ac3e38933ef ]
Relax DEVX access upon modify commands to be UVERBS_ACCESS_READ.
The kernel doesn't need to protect what firmware protects, or what causes no damage to anyone but the user.
As firmware needs to protect itself from parallel access to the same object, don't block parallel modify/query commands on the same object in the kernel side.
This change will allow user space application to run parallel updates to different entries in the same bulk object.
--- drivers/infiniband/hw/mlx5/devx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/devx.c +1 -1
@@ -2811,7 +2811,7 @@ DECLARE_UVERBS_NAMED_METHOD(MLX5_IB_METHOD_DEVX_OBJ_MODIFY ,UVERBS_ATTR_IDR (MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE ,UVERBS_IDR_ANY_OBJECT , -UVERBS_ACCESS_WRITE , +UVERBS_ACCESS_READ ,UA_MANDATORY ), UVERBS_ATTR_PTR_IN( MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/6 x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h
From: Hou Tao <[email protected]>
[ Upstream commit ee0e39a63b78849f8abbef268b13e4838569f646 ]
Move is_vsyscall_vaddr() into asm/vsyscall.h to make it available for copy_from_kernel_nofault_allowed() in arch/x86/mm/maccess.c.
--- arch/x86/include/asm/vsyscall.h | 10 ++++++++++ arch/x86/mm/fault.c | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-)
arch/x86/include/asm/vsyscall.h +10 -0
@@ -4,6 +4,7 @@#include <linux/seqlock.h> #include <uapi/asm/vsyscall.h> +#include <asm/page_types.h> #ifdef CONFIG_X86_VSYSCALL_EMULATION extern void map_vsyscall (void );
@@ -24,4 +25,13 @@ static inline bool emulate_vsyscall(unsigned long error_code, }#endif +/* +* The (legacy) vsyscall page is the long page in the kernel portion +* of the address space that has user-accessible permissions. +*/ +static inline bool is_vsyscall_vaddr (unsigned long vaddr) +{ +return unlikely ((vaddr &PAGE_MASK ) ==VSYSCALL_ADDR ); +} +#endif /* _ASM_X86_VSYSCALL_H */
arch/x86/mm/fault.c +0 -9
@@ -875,15 +875,6 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,show_opcodes (regs, loglvl); } -/* -* The (legacy) vsyscall page is the long page in the kernel portion -* of the address space that has user-accessible permissions. -*/ -static bool is_vsyscall_vaddr (unsigned long vaddr) -{ -return unlikely ((vaddr &PAGE_MASK ) ==VSYSCALL_ADDR ); -} -static void __bad_area_nosemaphore (struct pt_regs *regs,unsigned long error_code,unsigned long address,u32 pkey,int si_code)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/6 net/iucv: fix the allocation size of iucv_path_table array
In reply to Sasha LevinFrom: Alexander Gordeev <[email protected]>
[ Upstream commit b4ea9b6a18ebf7f9f3a7a60f82e925186978cfcf ]
iucv_path_table is a dynamically allocated array of pointers to struct iucv_path items. Yet, its size is calculated as if it was an array of struct iucv_path items.
--- net/iucv/iucv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/iucv/iucv.c +2 -2
@@ -179,7 +179,7 @@ static char iucv_error_pathid[16] = "INVALID PATHID";static LIST_HEAD (iucv_handler_list);/* -* iucv_path_table: an array of iucv_path structures. +* iucv_path_table: array of pointers to iucv_path structures. */ static struct iucv_path **iucv_path_table;static unsigned long iucv_max_pathid;
@@ -590,7 +590,7 @@ static int iucv_enable(void)get_online_cpus (); rc = -ENOMEM ; - alloc_size = iucv_max_pathid *sizeof (struct iucv_path ); + alloc_size = iucv_max_pathid *sizeof (*iucv_path_table); iucv_path_table =kzalloc (alloc_size,GFP_KERNEL );if (!iucv_path_table) goto out;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/6 parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check
In reply to Sasha LevinFrom: Max Kellermann <[email protected]>
[ Upstream commit 250f5402e636a5cec9e0e95df252c3d54307210f ]
Fixes a bug revealed by -Wmissing-prototypes when CONFIG_FUNCTION_GRAPH_TRACER is enabled but not CONFIG_DYNAMIC_FTRACE:
arch/parisc/kernel/ftrace.c:82:5: error: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Werror=missing-prototypes]
82 | int ftrace_enable_ftrace_graph_caller(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/parisc/kernel/ftrace.c:88:5: error: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Werror=missing-prototypes]
88 | int ftrace_disable_ftrace_graph_caller(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- arch/parisc/kernel/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/ftrace.c +1 -1
@@ -80,7 +80,7 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent,#endif } -#ifdef CONFIG_FUNCTION_GRAPH_TRACER +#if defined(CONFIG_DYNAMIC_FTRACE ) && defined(CONFIG_FUNCTION_GRAPH_TRACER )int ftrace_enable_ftrace_graph_caller (void ) {return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/6 block: sed-opal: handle empty atoms when parsing response
In reply to Sasha LevinFrom: Greg Joyce <[email protected]>
[ Upstream commit 5429c8de56f6b2bd8f537df3a1e04e67b9c04282 ]
The SED Opal response parsing function response_parse() does not handle the case of an empty atom in the response. This causes the entry count to be too high and the response fails to be parsed. Recognizing, but ignoring, empty atoms allows response handling to succeed.
--- block/opal_proto.h | 1 + block/sed-opal.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
block/opal_proto.h +1 -0
@@ -65,6 +65,7 @@ enum opal_response_token {#define SHORT_ATOM_BYTE 0xBF#define MEDIUM_ATOM_BYTE 0xDF#define LONG_ATOM_BYTE 0xE3 +#define EMPTY_ATOM_BYTE 0xFF#define OPAL_INVAL_PARAM 12#define OPAL_MANUFACTURED_INACTIVE 0x08
block/sed-opal.c +5 -1
@@ -893,16 +893,20 @@ static int response_parse(const u8 *buf, size_t length, token_length =response_parse_medium (iter, pos); else if (pos[0] <= LONG_ATOM_BYTE) /* long atom */ token_length =response_parse_long (iter, pos); + else if (pos[0] == EMPTY_ATOM_BYTE) /* empty atom */ + token_length =1 ; else /* TOKEN */ token_length =response_parse_token (iter, pos);if (token_length <0 )return token_length; +if (pos[0 ] !=EMPTY_ATOM_BYTE ) + num_entries++; + pos += token_length; total -= token_length; iter++; - num_entries++; } resp->num = num_entries;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 6/6 dm-verity, dm-crypt: align "struct bvec_iter" correctly
In reply to Sasha LevinFrom: Mikulas Patocka <[email protected]>
[ Upstream commit 787f1b2800464aa277236a66eb3c279535edd460 ]
"struct bvec_iter" is defined with the __packed attribute, so it is aligned on a single byte. On X86 (and on other architectures that support unaligned addresses in hardware), "struct bvec_iter" is accessed using the 8-byte and 4-byte memory instructions, however these instructions are less efficient if they operate on unaligned addresses.
(on RISC machines that don't have unaligned access in hardware, GCC generates byte-by-byte accesses that are very inefficient - see [1])
This commit reorders the entries in "struct dm_verity_io" and "struct convert_context", so that "struct bvec_iter" is aligned on 8 bytes.
[1] https://lore.kernel.org/all/ZcLuWUNRZadJr0tQ@fedora/T/
--- drivers/md/dm-crypt.c | 4 ++-- drivers/md/dm-verity.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/md/dm-crypt.c +2 -2
@@ -46,11 +46,11 @@struct convert_context {struct completion restart;struct bio *bio_in; -struct bio *bio_out;struct bvec_iter iter_in; +struct bio *bio_out;struct bvec_iter iter_out; -u64 cc_sector;atomic_t cc_pending; +u64 cc_sector;union {struct skcipher_request *req;struct aead_request *req_aead;
drivers/md/dm-verity.h +2 -2
@@ -73,11 +73,11 @@ struct dm_verity_io {/* original value of bio->bi_end_io */ bio_end_io_t *orig_bi_end_io; +struct bvec_iter iter; +sector_t block;unsigned n_blocks; -struct bvec_iter iter; -struct work_struct work;/*
Signature · 1 line
2.43.0