Re: [PATCH v3] net/ipv4: add tracepoint for icmp_send

2024-03-22 Thread Denis Kirjanov
On 3/21/24 05:10, xu.xi...@zte.com.cn wrote: > From: he peilin > > Introduce a tracepoint for icmp_send, which can help users to get more > detail information conveniently when icmp abnormal events happen. > > 1. Giving an usecase example: > = > When an

Re: [PATCH net] ipvs: Simplify the allocation of ip_vs_conn slab caches

2024-01-17 Thread Denis Kirjanov
On 1/17/24 10:20, Kunwu Chan wrote: > Use the new KMEM_CACHE() macro instead of direct kmem_cache_create > to simplify the creation of SLAB caches. > > Signed-off-by: Kunwu Chan The patch is actually for net-next > --- > net/netfilter/ipvs/ip_vs_conn.c | 4 +--- > 1 file changed, 1

Re: [PATCH 032/141] floppy: Fix fall-through warnings for Clang

2021-04-20 Thread Denis Efremov
Hi, Sorry, this was missed somehow. I would rewrite it to something more simple instead of adding fallthrough. What about? --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -2123,12 +2123,14 @@ static void set_floppy(int drive) static void format_interrupt(void) { switch

Re: [PATCH] floppy: remove redundant assignment to variable st

2021-04-16 Thread Denis Efremov
: > From: Colin Ian King > > The variable st is being assigned a value that is never read and > it is being updated later with a new value. The initialization is > redundant and can be removed. > > Addresses-Coverity: ("Unused value") > Signed-off-by: Colin Ian

[PATCH 4/5] floppy: cleanups: use memcpy() to copy reply_buffer

2021-04-16 Thread Denis Efremov
Use memcpy() in raw_cmd_done() to copy reply_buffer instead of a for loop. Signed-off-by: Denis Efremov --- drivers/block/floppy.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index c58b0b079afc..c584657bacab 100644

[PATCH 5/5] floppy: cleanups: remove FLOPPY_SILENT_DCL_CLEAR undef

2021-04-16 Thread Denis Efremov
FLOPPY_SILENT_DCL_CLEAR is not defined anywhere and comes from pre-git era. Just drop this undef. There is FD_SILENT_DCL_CLEAR which is really used. Signed-off-by: Denis Efremov --- drivers/block/floppy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/floppy.c b/drivers

[PATCH 1/5] floppy: cleanups: remove trailing whitespaces

2021-04-16 Thread Denis Efremov
Cleanup trailing whitespaces as checkpatch.pl suggests. Signed-off-by: Denis Efremov --- include/uapi/linux/fd.h | 46 - 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/include/uapi/linux/fd.h b/include/uapi/linux/fd.h index 8b80c63b971c

[PATCH 2/5] floppy: cleanups: use ST0 as reply_buffer index 0

2021-04-16 Thread Denis Efremov
Use ST0 as 0 index for reply_buffer array. get_fdc_version() is the only function that uses index 0 directly instead of the ST0 define. Signed-off-by: Denis Efremov --- drivers/block/floppy.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/block/floppy.c

[PATCH 3/5] floppy: cleanups: use memset() to zero reply_buffer

2021-04-16 Thread Denis Efremov
Use memset() to zero reply buffer in raw_cmd_copyin() instead of a for loop. Signed-off-by: Denis Efremov --- drivers/block/floppy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index df5c32900539..c58b0b079afc 100644

[PATCH 0/5] Another small set of cleanups for floppy driver

2021-04-16 Thread Denis Efremov
Just a couple of patches to make checkpatch.pl a bit more happy. All these patches preserve original semantics of the code and only memset(), memcpy() patches change binary code. Denis Efremov (5): floppy: cleanups: remove trailing whitespaces floppy: cleanups: use ST0 as reply_buffer index 0

Re: [PATCH] floppy: remove redundant assignment to variable st

2021-04-16 Thread Denis Efremov
Hi, On 4/15/21 4:00 PM, Colin King wrote: > From: Colin Ian King > > The variable st is being assigned a value that is never read and > it is being updated later with a new value. The initialization is > redundant and can be removed. > > Addresses-Coverity: ("Unused value") > Signed-off-by:

[PATCH] coccinelle: misc: minmax: suppress patch generation for err returns

2021-04-09 Thread Denis Efremov
of patches. Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/minmax.cocci | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/coccinelle/misc/minmax.cocci b/scripts/coccinelle/misc/minmax.cocci index eccdd3eb3452..fcf908b34f27 100644 --- a/

Re: [PATCH] inotify: fix minmax.cocci warnings

2021-04-08 Thread Denis Efremov
elle/misc/minmax.cocci >>> >>> Fixes: 8636e3295ce3 ("coccinelle: misc: add minmax script") >>> CC: Denis Efremov >>> Reported-by: kernel test robot >>> Signed-off-by: kernel test robot >>> Signed-off-by: Julia Lawall

Re: [PATCH v3] coccinelle: misc: add swap script

2021-03-28 Thread Denis Efremov
Ping? On 3/5/21 1:09 PM, Denis Efremov wrote: Check for opencoded swap() implementation. Signed-off-by: Denis Efremov --- Changes in v2: - additional patch rule to drop excessive {} - fix indentation in patch mode by anchoring ; Changes in v3: - Rule added for simple (without var init

Re: [PATCH] coccinelle: misc: update uninitialized_var.cocci documentation

2021-03-24 Thread Denis Efremov
Ping? On 3/8/21 10:30 AM, Denis Efremov wrote: > Remove the documentation link from the warning message because commit > 3942ea7a10c9 ("deprecated.rst: Remove now removed uninitialized_var") > removed the section from documentation. Update the rule documentation > accord

Re: [PATCH] coccinelle: misc: restrict patch mode in flexible_array.cocci

2021-03-24 Thread Denis Efremov
Ping? On 3/8/21 10:12 PM, Denis Efremov wrote: > Skip patches generation for structs/unions with a single field. > Changing a zero-length array to a flexible array member in a struct > with no named members breaks the compilation. However, reporting > such cases is still valuable,

[PATCH v5] coccinelle: misc: add minmax script

2021-03-08 Thread Denis Efremov
Check for opencoded min(), max() implementations. Signed-off-by: Denis Efremov --- Changes in v2: - <... ...> instead of ... when any - org mode reports fixed - patch rule to drop excessive () Changes in v3: - "depends on patch && (pmax || pmaxif || pmin || pminif)&q

[PATCH] coccinelle: misc: restrict patch mode in flexible_array.cocci

2021-03-08 Thread Denis Efremov
cocci warnings"). Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/flexible_array.cocci | 23 ++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/coccinelle/misc/flexible_array.cocci b/scripts/coccinelle/misc/flexible_array.cocci index 94

[PATCH] coccinelle: misc: update uninitialized_var.cocci documentation

2021-03-07 Thread Denis Efremov
Remove the documentation link from the warning message because commit 3942ea7a10c9 ("deprecated.rst: Remove now removed uninitialized_var") removed the section from documentation. Update the rule documentation accordingly. Signed-off-by: Denis Efremov --- scripts/cocci

[PATCH v4] coccinelle: misc: add minmax script

2021-03-07 Thread Denis Efremov
Check for opencoded min(), max() implementations. Signed-off-by: Denis Efremov --- Changes in v2: - <... ...> instead of ... when any - org mode reports fixed - patch rule to drop excessive () Changes in v3: - "depends on patch && (pmax || pmaxif || pmin || pminif)&q

[PATCH 1/2] perf tests: Remove duplicate bitmap test

2021-03-05 Thread Denis Efremov
test_bitmap("1,3-6,8-10,24,35-37") called twice in a row. Remove the second test. Signed-off-by: Denis Efremov --- tools/perf/tests/bitmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/tests/bitmap.c b/tools/perf/tests/bitmap.c index 96c137360918..332061340

[PATCH 2/2] perf tests: Remove duplicate cpumap test

2021-03-05 Thread Denis Efremov
cpu_map_print("1,3-6,8-10,24,35-37") called twice in a row. Remove the second test. Signed-off-by: Denis Efremov --- tools/perf/tests/cpumap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c index 29c793ac7d10..f906633ea

[PATCH] sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count

2021-03-05 Thread Denis Efremov
RXMAC_BC_FRM_CNT_COUNT added to mp->rx_bcasts twice in a row in niu_xmac_interrupt(). Remove the second addition. Signed-off-by: Denis Efremov --- I don't know the code of the dirver, but this looks like a real bug. Otherwise, it's more readable as: mp->rx_bcasts += RXMAC_BC_FRM_CNT_COU

[PATCH] net/hamradio/6pack: remove redundant check in sp_encaps()

2021-03-05 Thread Denis Efremov
"len > sp->mtu" checked twice in a row in sp_encaps(). Remove the second check. Signed-off-by: Denis Efremov --- drivers/net/hamradio/6pack.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 71d6629e65

[PATCH] staging: rtl8723bs: remove duplicate pstat->hwaddr check

2021-03-05 Thread Denis Efremov
IS_MCAST(pstat->hwaddr) checked twice in a row in odm_RefreshRateAdaptiveMaskCE(). Remove the second check. Signed-off-by: Denis Efremov --- drivers/staging/rtl8723bs/hal/odm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl872

[PATCH] powerpc/ptrace: Remove duplicate check from pt_regs_check()

2021-03-05 Thread Denis Efremov
"offsetof(struct pt_regs, msr) == offsetof(struct user_pt_regs, msr)" checked in pt_regs_check() twice in a row. Remove the second check. Signed-off-by: Denis Efremov --- arch/powerpc/kernel/ptrace/ptrace.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/ptrac

[PATCH v3] coccinelle: misc: add minmax script

2021-03-05 Thread Denis Efremov
Check for opencoded min(), max() implementations. Signed-off-by: Denis Efremov --- Changes in v2: - <... ...> instead of ... when any - org mode reports fixed - patch rule to drop excessive () Changes in v3: - "depends on patch && (pmax || pmaxif || pmin || pmini

[PATCH v3] coccinelle: misc: add swap script

2021-03-05 Thread Denis Efremov
Check for opencoded swap() implementation. Signed-off-by: Denis Efremov --- Changes in v2: - additional patch rule to drop excessive {} - fix indentation in patch mode by anchoring ; Changes in v3: - Rule added for simple (without var init) swap highlighting in !patch mode - "de

[PATCH v2] coccinelle: misc: add swap script

2021-02-19 Thread Denis Efremov
Check for opencoded swap() implementation. Signed-off-by: Denis Efremov --- Changes in v2: - additional patch rule to drop excessive {} - fix indentation in patch mode by anchoring ; scripts/coccinelle/misc/swap.cocci | 101 + 1 file changed, 101 insertions

Re: [PATCH v2] coccinelle: misc: add minmax script

2021-02-19 Thread Denis Efremov
Sorry for wrong thread, I'll resend v2 to the right one. Denis On 2/19/21 12:05 PM, Denis Efremov wrote: > Check for opencoded min(), max() implementations. > > Signed-off-by: Denis Efremov > --- > > Changes in v2: > - <... ...> instead of ... when any > - org

[PATCH v2] coccinelle: misc: add minmax script

2021-02-19 Thread Denis Efremov
Check for opencoded min(), max() implementations. Signed-off-by: Denis Efremov --- Changes in v2: - <... ...> instead of ... when any - org mode reports fixed - patch rule to drop excessive () scripts/coccinelle/misc/minmax.cocci | 224 +++ 1 file change

[PATCH v2 RESEND] coccinelle: misc: add minmax script

2021-02-19 Thread Denis Efremov
Check for opencoded min(), max() implementations. Signed-off-by: Denis Efremov --- Changes in v2: - <... ...> instead of ... when any - org mode reports fixed - patch rule to drop excessive () scripts/coccinelle/misc/minmax.cocci | 224 +++ 1 file change

Re: [PATCH] coccinelle: misc: add swap script

2021-02-18 Thread Denis Efremov
On 2/18/21 2:29 PM, Julia Lawall wrote: > > > On Thu, 18 Feb 2021, Denis Efremov wrote: > >> >> >> On 2/18/21 1:17 PM, Julia Lawall wrote: >>> >>> >>> On Thu, 18 Feb 2021, Denis Efremov wrote: >>> >>>>

Re: [PATCH] coccinelle: misc: add swap script

2021-02-18 Thread Denis Efremov
On 2/18/21 1:17 PM, Julia Lawall wrote: > > > On Thu, 18 Feb 2021, Denis Efremov wrote: > >> >> >> On 2/18/21 12:31 AM, Julia Lawall wrote: >>>> +@depends on patch@ >>>> +identifier tmp; >>>> +expression a, b; >>>

Re: [PATCH] coccinelle: misc: add swap script

2021-02-17 Thread Denis Efremov
} | - tmp = a; - a = b; - b = tmp + swap(a, b) ; ) The tool fails with error: EXN: Failure("rule starting on line 58: already tagged token:\nC code context\nFile \"drivers/net/wireless/ath/ath5k/phy.c\", line 1574, column 4, charpos = 41650\n around = 'sort',\n whole content = \t\t\t\tsort[j - 1] = tmp;") in drivers/net/wireless/ath/ath5k/phy.c Thanks, Denis

[PATCH] coccinelle: misc: add minmax script

2021-02-16 Thread Denis Efremov
Check for opencoded min(), max() implementations. Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/minmax.cocci | 198 +++ 1 file changed, 198 insertions(+) create mode 100644 scripts/coccinelle/misc/minmax.cocci diff --git a/scripts/coccinelle/misc

Re: [PATCH] fs: export kern_path_locked

2021-02-16 Thread Denis Kirjanov
On 2/14/21, Al Viro wrote: > On Fri, Jan 29, 2021 at 01:18:55PM +, Christoph Hellwig wrote: >> On Fri, Jan 29, 2021 at 04:11:05PM +0300, Denis Kirjanov wrote: >> > Do you mean just: >> >> We'll still need to lock the parent inode. > > Not just "lock

[PATCH] coccinelle: misc: add swap script

2021-02-16 Thread Denis Efremov
Check for opencoded swap() implementation. Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/swap.cocci | 77 ++ 1 file changed, 77 insertions(+) create mode 100644 scripts/coccinelle/misc/swap.cocci diff --git a/scripts/coccinelle/misc/swap.cocci b/scripts

Re: [PATCH 5.10 00/57] 5.10.14-rc1 review

2021-02-06 Thread Jean-Denis Girard
and booted on my machine(x86_64) without any dmesg regression. Tested-by: Jean-Denis Girard Thanks, -- Jean-Denis Girard SysNux Systèmes Linux en Polynésie française https://www.sysnux.pf/ Tél: +689 40.50.10.40 / GSM: +689 87.797.527

Re: [PATCH] floppy: reintroduce O_NDELAY fix

2021-02-04 Thread Denis Efremov
On 2/4/21 12:24 PM, Jiri Kosina wrote: > On Tue, 26 Jan 2021, Denis Efremov wrote: > >> Applied. I'll send it to Jens soon with a couple of cleanup patches. >> >> https://github.com/evdenis/linux-floppy/commit/e32f6163c47efbdbad06258560aa00d1c7e5b699 > > De

[GIT PULL] Floppy patch for 5.12

2021-02-04 Thread Denis Efremov
is using O_NONBLOCK when probing devices. This leads to pollution of kernel log with error messages from floppy driver. Also the driver fails a mount prior to being opened without O_NONBLOCK at least once. The patch fixes the issues. Signed-off-by: Denis Efremov

Re: [PATCH] floppy: reintroduce O_NDELAY fix

2021-01-26 Thread Denis Efremov
pen() flags handling") > Fixes: f2791e7ead ("Revert "floppy: refactor open() flags handling"") > Signed-off-by: Jiri Kosina Applied. I'll send it to Jens soon with a couple of cleanup patches. https://github.com/evdenis/linux-floppy/commit/e32f6163c47efbdbad06258

Re: [PATCH] floppy: reintroduce O_NDELAY fix

2021-01-26 Thread Denis Efremov
On 1/26/21 12:31 PM, Kurt Garloff wrote: > Hi Denis, Jiri, Jens, > > Am 26.01.21 um 09:21 schrieb Denis Efremov: >> On 1/22/21 2:13 PM, Jiri Kosina wrote: >>> From: Jiri Kosina >>> >>> This issue was originally fixed in 09954bad4 (&q

[PATCH] fs: export kern_path_locked

2021-01-25 Thread Denis Kirjanov
the function is used outside and we have a prototype defined in namei.h Signed-off-by: Denis Kirjanov --- fs/namei.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/namei.c b/fs/namei.c index 78443a85480a..3de3b3642302 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2450,6 +2450,7 @@ struct

Re: [PATCH v1] trace: Fix race in trace_open and buffer resize call

2021-01-23 Thread Denis Efremov
On 1/22/21 5:37 PM, Steven Rostedt wrote: > On Fri, 22 Jan 2021 16:55:29 +0530 > Gaurav Kohli wrote: > >>>> That could possibly work. >> >> Yes, this will work, As i have tested similar patch for internal testing >> for kernel branches like 5.4/4.

Re: [PATCH v1] trace: Fix race in trace_open and buffer resize call

2021-01-21 Thread Denis Efremov
On 1/21/21 10:09 PM, Steven Rostedt wrote: > On Thu, 21 Jan 2021 17:30:40 +0300 > Denis Efremov wrote: > >> Hi, >> >> This patch (CVE-2020-27825) was tagged with >> Fixes: b23d7a5f4a07a ("ring-buffer: speed up buffer resets by avoiding >&

Re: [PATCH RESEND] floppy: fix open(O_ACCMODE) for ioctl-only open

2021-01-21 Thread Denis Efremov
On 1/21/21 5:44 PM, Jiri Kosina wrote: > On Thu, 21 Jan 2021, Jiri Kosina wrote: > >> I am currently waiting for confirmation by the original reporter that the >> patch below fixes the issue. > > ... a now a patch that actually compiles :) (made a mistake when > forward-porting from the

Re: [PATCH RESEND] floppy: fix open(O_ACCMODE) for ioctl-only open

2021-01-21 Thread Denis Efremov
On 1/21/21 1:25 PM, Jiri Kosina wrote: > On Thu, 21 Jan 2021, Denis Efremov wrote: > >> I think it's hard to recall the exact reasons after so many years. > > Yeah, I guess so :) > >> I'll send a patch today based on this one. > > I am currently waiting

Re: [PATCH v1] trace: Fix race in trace_open and buffer resize call

2021-01-21 Thread Denis Efremov
() without significant changes. Hence, mutex_lock(>mutex)/mutex_unlock(>mutex) can be backported further than b23d7a5f4a07a~ and to all LTS kernels. Is b23d7a5f4a07a the actual cause of the bug? Thanks, Denis On 10/6/20 12:33 PM, Gaurav Kohli wrote: > Below race can come, if trace_open

Re: [PATCH RESEND] floppy: fix open(O_ACCMODE) for ioctl-only open

2021-01-20 Thread Denis Efremov
r.kernel.org # v4.5+ >>> Reported-by: Wim Osterholt >>> Tested-by: Wim Osterholt >>> Signed-off-by: Jiri Kosina >> >> Added for this series, thanks. > > [ CCing Denis too ] > > Let me revive this 4 years old thread. > > I've just now noti

[PATCH] perf inject: correct event attribute sizes

2020-12-15 Thread Denis Nikitin
Signed-off-by: Denis Nikitin --- tools/perf/util/header.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index be850e9f8852..0d95981df8dd 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -3331,6 +3331,14

Re: [PATCH] KVM: x86: reinstate vendor-agnostic check on SPEC_CTRL cpuid bits

2020-12-08 Thread Denis V. Lunev
since we only care about the availability of the MSR on the > host > here and not about specific CPUID bits. > > Fixes: e7c587da1252 ("x86/speculation: Use synthetic bits for > IBRS/IBPB/STIBP") > Cc: sta...@vger.kernel.org > Reported-by: Denis V. Lunev > Signed-of

Re: [net/af_unix] 556d816147: WARNING:lock_held_when_returning_to_user_space

2020-12-01 Thread Denis Kirjanov
) should be fixed as well. I'll send a next version shortly. Thanks! > url: > https://github.com/0day-ci/linux/commits/Denis-Kirjanov/net-af_unix-don-t-create-a-path-for-a-binded-socket/20201130-213012 > base: https://git.kernel.org/cgit/linux/kernel/git/davem/net.git > 4d521943f76bd

Re: [PATCH v3 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping()

2020-11-25 Thread Denis Kirjanov
On 11/25/20, Laurent Vivier wrote: > With virtio multiqueue, normally each queue IRQ is mapped to a CPU. > > But since commit 0d9f0a52c8b9f ("virtio_scsi: use virtio IRQ affinity") > this is broken on pseries. Please add "Fixes" tag. Thanks! > > The affinity is correctly computed in msi_desc

Re: [PATCH net v2] net: emaclite: Add error handling for of_address_ and _mdio_setup functions

2020-11-17 Thread Denis Kirjanov
On 11/17/20, Radhey Shyam Pandey wrote: > From: Shravya Kumbham > > Add ret variable, condition to check the return value and error > path for the of_address_to_resource() function. It also adds error > handling for mdio setup and decrement refcount of phy node. > > Addresses-Coverity: Event

Re: [PATCH] xsk: add cq event

2020-11-16 Thread Denis Kirjanov
On 11/16/20, Denis Kirjanov wrote: > On 11/16/20, Xuan Zhuo wrote: >> On Mon, 16 Nov 2020 12:13:21 +0300, Denis Kirjanov >> >> wrote: >>> On 11/16/20, Xuan Zhuo wrote: >>> > When we write all cq items to tx, we have to wait for a new e

Re: [PATCH] xsk: add cq event

2020-11-16 Thread Denis Kirjanov
On 11/16/20, Xuan Zhuo wrote: > On Mon, 16 Nov 2020 12:13:21 +0300, Denis Kirjanov > wrote: >> On 11/16/20, Xuan Zhuo wrote: >> > When we write all cq items to tx, we have to wait for a new event based >> > on poll to indicate that it is writable. But the current

Re: [PATCH] xsk: add cq event

2020-11-16 Thread Denis Kirjanov
On 11/16/20, Xuan Zhuo wrote: > When we write all cq items to tx, we have to wait for a new event based > on poll to indicate that it is writable. But the current writability is > triggered based on whether tx is full or not, and In fact, when tx is > dissatisfied, the user of cq's item may not

Re: [PATCH] bpf: Fix unsigned 'datasec_id' compared with zero in check_pseudo_btf_id

2020-11-10 Thread Denis Kirjanov
On 11/10/20, xiakaixu1...@gmail.com wrote: > From: Kaixu Xia > > The unsigned variable datasec_id is assigned a return value from the call > to check_pseudo_btf_id(), which may return negative error code. > > Fixes coccicheck warning: > > ./kernel/bpf/verifier.c:9616:5-15: WARNING: Unsigned

Re: [PATCH v4 0/4] Add system mmu support for Armada-806

2020-10-23 Thread Denis Odintsov
Hi, > Am 23.10.2020 um 14:19 schrieb Tomasz Nowicki : > > Hi Denis, > > Sorry for late response, we had to check few things. Please see comments > inline. > > On 10/6/20 3:16 PM, Denis Odintsov wrote: >> Hi, >>> Am 15.07.2020 um 09:06 schrieb Tomasz

Re: [PATCH v4 0/4] Add system mmu support for Armada-806

2020-10-19 Thread Denis Odintsov
> Am 13.10.2020 um 15:08 schrieb Robin Murphy : > > On 2020-10-06 16:16, Denis Odintsov wrote: >> Hi, >>> Am 15.07.2020 um 09:06 schrieb Tomasz Nowicki : >>> >>> The series is meant to support SMMU for AP806 and a workaround >>>

[PATCH v8] coccinelle: api: add kfree_mismatch script

2020-10-16 Thread Denis Efremov
Check that alloc and free types of functions match each other. Signed-off-by: Denis Efremov --- Changes in v2: - Lines are limited to 80 characters where possible - Confidence changed from High to Medium because of fs/btrfs/send.c:1119 false-positive - __vmalloc_area_node() explicitly

[PATCH] coccinelle: api: kfree_sensitive: print memset position

2020-10-09 Thread Denis Efremov
Print memset() call position in addition to the kfree() position to ease issues identification. Signed-off-by: Denis Efremov --- scripts/coccinelle/api/kfree_sensitive.cocci | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/coccinelle/api

Re: [PATCH v4 0/4] Add system mmu support for Armada-806

2020-10-06 Thread Denis Odintsov
Hi, > Am 15.07.2020 um 09:06 schrieb Tomasz Nowicki : > > The series is meant to support SMMU for AP806 and a workaround > for accessing ARM SMMU 64bit registers is the gist of it. > > For the record, AP-806 can't access SMMU registers with 64bit width. > This patches split the readq/writeq

Re: kzfree script

2020-10-02 Thread Denis Efremov
On 10/2/20 5:13 PM, Julia Lawall wrote: > > > On Fri, 2 Oct 2020, Denis Efremov wrote: > >> Hi, >> >> On 10/2/20 5:01 PM, Julia Lawall wrote: >>> Denis, >>> >>> In the rule proposing kzfree_sensitive, I think it would be helpful to &

Re: kzfree script

2020-10-02 Thread Denis Efremov
Hi, On 10/2/20 5:01 PM, Julia Lawall wrote: > Denis, > > In the rule proposing kzfree_sensitive, I think it would be helpful to > also highlight the memset line. What do you mean? It's "highlighted" in context mode. Do you mean adding position argument to memset call and

[PATCH v4] coccinelle: api: add kvmalloc script

2020-09-30 Thread Denis Efremov
Suggest kvmalloc, kvfree instead of opencoded patterns. Signed-off-by: Denis Efremov --- Changes in v2: - binary operator cmp added - NULL comparisions simplified - "T x" case added to !patch mode Changes in v3: - kvfree rules added Changes in v4: - pattern updated to match only

[PATCH v3] coccinelle: misc: add flexible_array.cocci script

2020-09-21 Thread Denis Efremov
Add zero-length and one-element arrays") Cc: Kees Cook Cc: Gustavo A. R. Silva Signed-off-by: Denis Efremov --- Changes in v2: - all uapi headers are now filtered-out. Unfortunately, coccinelle doesn't provide structure names in Location.current_element. For structures the field is al

Re: [PATCH v7] coccinelle: api: add kfree_mismatch script

2020-09-21 Thread Denis Efremov
Hi, On 8/3/20 9:34 PM, Denis Efremov wrote: > Check that alloc and free types of functions match each other. Julia, I've just send the patches to fix all the warnings emitted by the script. [1] https://lore.kernel.org/patchwork/patch/1309731/ [2] https://lore.kernel.org/patchwork/patch/1309

[PATCH 1/2] btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send()

2020-09-21 Thread Denis Efremov
xes: 818e010bf9d0 ("btrfs: replace opencoded kvzalloc with the helper") Signed-off-by: Denis Efremov --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index d9813a5b075a..c874ddda6252 100644 --- a/fs/btrfs/send.c +

[PATCH 2/2] btrfs: check allocation size in btrfs_ioctl_send()

2020-09-21 Thread Denis Efremov
Replace kvzalloc() call with kvcalloc() that checks the size internally. Use array_size() helper to compute the memory size for clone_sources_tmp. Cc: Kees Cook Signed-off-by: Denis Efremov --- fs/btrfs/send.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs

[PATCH 2/2] net/mlx5e: Use kfree() to free fd->g in accel_fs_tcp_create_groups()

2020-09-21 Thread Denis Efremov
Memory ft->g in accel_fs_tcp_create_groups() is allocaed with kcalloc(). It's excessive to free ft->g with kvfree(). Use kfree() instead. Signed-off-by: Denis Efremov --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 1/2] net/mlx5e: IPsec: Use kvfree() for memory allocated with kvzalloc()

2020-09-21 Thread Denis Efremov
Variables flow_group_in, spec in rx_fs_create() are allocated with kvzalloc(). It's incorrect to free them with kfree(). Use kvfree() instead. Fixes: 5e466345291a ("net/mlx5e: IPsec: Add IPsec steering in local NIC RX") Signed-off-by: Denis Efremov --- drivers/net/ethernet/mellanox

[PATCH v2] coccinelle: misc: add excluded_middle.cocci script

2020-09-21 Thread Denis Efremov
Check for !A || A && B condition. It's equivalent to !A || B. Signed-off-by: Denis Efremov --- Changes in v2: - spelling mistake fixed - position variable moved on the && operator - patch pattern changed to - (A && B) - word "condition" removed from warning

Re: [PATCH v2] coccinelle: misc: add flexible_array.cocci script

2020-09-13 Thread Denis Efremov
Hi, On 9/12/20 5:43 PM, Julia Lawall wrote: > > > On Mon, 10 Aug 2020, Denis Efremov wrote: > >> Commit 68e4cd17e218 ("docs: deprecated.rst: Add zero-length and one-element >> arrays") marks one-element and zero-length arrays as deprecated. Kernel >>

Re: [PATCH] security: keys: Use kvfree_sensitive in a few places

2020-09-11 Thread Denis Efremov
Hi, same patch https://lkml.org/lkml/2020/8/27/168 Thanks, Denis On 9/11/20 2:44 PM, Alex Dewar wrote: > In big_key.c, there are a few places where memzero_explicit + kvfree is > used. It is better to use kvfree_sensitive instead, which is more > readable and also prevents the comp

Re: [PATCH] scripts: kzfree.cocci: Deprecate use of kzfree

2020-09-11 Thread Denis Efremov
Hi, same patch https://lkml.org/lkml/2020/8/11/130 Julia, I've send all the patches to fix existing kfree_sensitive/kvfree_sensitive reports. https://lkml.org/lkml/2020/8/27/168 https://lkml.org/lkml/2020/8/27/93 Thanks, Denis On 9/11/20 4:49 PM, Alex Dewar wrote: > kzfree() is effectiv

[PATCH 1/2] ARM: makefile: Drop GZFLAGS definition and export

2020-09-04 Thread Denis Efremov
Drop the definition and export of GZFLAGS, because it's not used. GZFLAGS was dropped from arm64 in commit 4cf234943dcf ("arm64: drop GZFLAGS definition and export"). Signed-off-by: Denis Efremov --- arch/arm/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --

[PATCH 2/2] csky: Drop GZFLAGS definition

2020-09-04 Thread Denis Efremov
Drop the definition of GZFLAGS because it's not used. Signed-off-by: Denis Efremov --- arch/csky/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/csky/Makefile b/arch/csky/Makefile index 37f593a4bf53..715b839bf998 100644 --- a/arch/csky/Makefile +++ b/arch/csky/Makefile @@ -1,6

[PATCH 0/2] drop GZFLAGS definition

2020-09-04 Thread Denis Efremov
GZFLAGS is not used. KGZIP env var can be used to pass additional flags to gzip instead. Denis Efremov (2): ARM: makefile: Drop GZFLAGS definition and export csky: Drop GZFLAGS definition arch/arm/Makefile | 3 +-- arch/csky/Makefile | 1 - 2 files changed, 1 insertion(+), 3 deletions

Re: [PATCH 14/19] floppy: use a separate gendisk for each media format

2020-09-04 Thread Denis Efremov
ad to interesting issues in code not > aware of that fact. > > To fix this just create a separate gendisk for each of the aliases > if they are accessed. > > Signed-off-by: Christoph Hellwig Tested-by: Denis Efremov The patch looks ok as it is. Two nitpicks below if you will s

Re: [PATCH v2 1/4] crypto: inside-secure - use kfree_sensitive()

2020-09-04 Thread Denis Efremov
Hi, On 9/2/20 4:10 PM, Van Leeuwen, Pascal wrote: >> -Original Message- >> From: linux-crypto-ow...@vger.kernel.org >> On Behalf Of Denis Efremov >> Sent: Thursday, August 27, 2020 8:44 AM >> To: linux-cry...@vger.kernel.org >> Cc: Denis Efrem

[PATCH] coccinelle: misc: add excluded_middle.cocci script

2020-09-02 Thread Denis Efremov
Check for "!A || A && B" condition. It's equivalent to "!A || B" condition. Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/excluded_middle.cocci | 40 +++ 1 file changed, 40 insertions(+) create mode 100644 scripts/coccinelle/misc/exclu

[PATCH] net: bcmgenet: fix mask check in bcmgenet_validate_flow()

2020-09-02 Thread Denis Efremov
VALIDATE_MASK(eth_mask->h_source) is checked twice in a row in bcmgenet_validate_flow(). Add VALIDATE_MASK(eth_mask->h_dest) instead. Fixes: 3e370952287c ("net: bcmgenet: add support for ethtool rxnfc flows") Cc: sta...@vger.kernel.org Signed-off-by: Denis Efremov --- I'm not

Re: checkpatch? (was: Re: [PATCH v3] coccinelle: misc: add uninitialized_var.cocci script)

2020-09-01 Thread Denis Efremov
On 9/1/20 5:37 PM, Joe Perches wrote: > On Tue, 2020-09-01 at 12:48 +0300, Denis Efremov wrote: >> uninitialized_var() macro was removed from the sources [1] and >> other warning-silencing tricks were deprecated [2]. The purpose of this >> cocci script is to pr

[PATCH] coccinelle: ifnullfree: add vfree(), kvfree*() functions

2020-09-01 Thread Denis Efremov
Extend the list of free functions with kvfree(), kvfree_sensitive(), vfree(). Signed-off-by: Denis Efremov --- scripts/coccinelle/free/ifnullfree.cocci | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/coccinelle/free/ifnullfree.cocci b/scripts/coccinelle

[PATCH v3] coccinelle: misc: add uninitialized_var.cocci script

2020-09-01 Thread Denis Efremov
") [2] commit 4b19bec97c88 ("docs: deprecated.rst: Add uninitialized_var()") Cc: Kees Cook Cc: Gustavo A. R. Silva Signed-off-by: Denis Efremov --- Changes in v2: - Documentation cited in the script's description - kernel.org link added to the diagnostics messages - "T

[PATCH] coccinelle: api: kobj_to_dev: don't warn about kobj_to_dev()

2020-09-01 Thread Denis Efremov
Exclude kobj_to_dev() definition from warnings. Signed-off-by: Denis Efremov --- No changes in performance. This patch can be squashed to the original patch with kobj_to_dev.cocci script. scripts/coccinelle/api/kobj_to_dev.cocci | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions

[PATCH v2] coccinelle: misc: add uninitialized_var.cocci script

2020-09-01 Thread Denis Efremov
itialized_var(). Cc: Kees Cook Cc: Gustavo A. R. Silva Signed-off-by: Denis Efremov --- Changes in v2: - Documentation cited in the script's description - kernel.org link added to the diagnostics messages - "T *var = " pattern removed - "var =@p var", "var =@p *(

[PATCH] kconfig: remove redundant assignment prompt = prompt

2020-08-31 Thread Denis Efremov
Semi-automatic removing of localization macros changed the line from "prompt = _(prompt);" to "prompt = prompt;". Drop the reduntand assignment. Fixes: 694c49a7c01c ("kconfig: drop localization support") Signed-off-by: Denis Efremov --- scripts/kconfig/nconf.c | 1

Re: [PATCH V2] sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output

2020-08-30 Thread Denis Efremov
evice_attribute *attr, char *buf) { ... } Regards, Denis

[PATCH] docs: filesystems: replace to_dev() with kobj_to_dev()

2020-08-30 Thread Denis Efremov
Commit a4232963757e ("driver-core: Move kobj_to_dev from genhd.h to device.h") introduced kobj_to_dev() function. Signed-off-by: Denis Efremov --- Documentation/filesystems/sysfs.rst| 3 +-- Documentation/translations/zh_CN/filesystems/sysfs.txt | 3 +-- 2 files

[PATCH] Documentation: remove current_security() reference

2020-08-30 Thread Denis Efremov
Commit 15322a0d90b6 ("lsm: remove current_security()") removed current_security() from the sources. Signed-off-by: Denis Efremov --- Documentation/security/credentials.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/security/credentials.rst b/Documentatio

Re: [PATCH] sysfs: Add sysfs_emit to replace sprintf to PAGE_SIZE buffers.

2020-08-29 Thread Denis Efremov
it's good to reflect in docs that sysfs_emit_at/sysfs_emit_pos is only for "legacy" code and should not be used in new code (checkpatch.pl warning?) because of sysfs design principles. And something about newlines "General rule is to add newlines at the end of output." Thanks, Denis

Re: sysfs output without newlines

2020-08-29 Thread Denis Efremov
t sure about existing cases, but I think it's a good checkpatch.pl warning for new patches. It should be possible to check sysfs_emit() calls. Thanks, Denis

Re: [RFC PATCH] coccinelle: misc: add uninitialized_var.cocci script

2020-08-29 Thread Denis Efremov
On 8/29/20 10:48 PM, Julia Lawall wrote: > > > On Sat, 29 Aug 2020, Joe Perches wrote: > >> On Sat, 2020-08-29 at 21:36 +0200, Julia Lawall wrote: >>> >>> On Wed, 12 Aug 2020, Denis Efremov wrote: >>> >>>> Commit 63a0895d960a (&quo

Re: [PATCH] sysfs: Add sysfs_emit to replace sprintf to PAGE_SIZE buffers.

2020-08-29 Thread Denis Efremov
; > +__printf(3, 4) > +static inline int sysfs_emit(char *buf, char *pos, const char *fmt, ...) > +{ > + return 0; > +} > + > #endif /* CONFIG_SYSFS */ > > static inline int __must_check sysfs_create_file(struct kobject *kobj, > Thanks, Denis

[RFC PATCH] coccinelle: api: add flex_array_size.cocci script

2020-08-28 Thread Denis Efremov
A. R. Silva Cc: Kees Cook Signed-off-by: Denis Efremov --- Kees, Gustavo, may I have your acks if you find this script useful? Currently, it emits following warnings: ./fs/select.c:994:25-26: WARNING opportunity for flex_array_size ./include/linux/avf/virtchnl.h:711:34-35: WARNING opportunity

Re: [Cocci] [PATCH] usb: atm: don't use snprintf() for sysfs attrs

2020-08-27 Thread Denis Efremov
ifference is in the ';'): @@ identifier f_show =~ "^.*_show$"; identifier dev, attr, buf; @@ ssize_t f_show(struct device *dev, struct device_attribute *attr, char *buf) { <... - sprintf + sysfs_sprintf (...) ...> } Regards, Denis

[PATCH v3] udf: Use kvzalloc() in udf_sb_alloc_bitmap()

2020-08-27 Thread Denis Efremov
Use kvzalloc() in udf_sb_alloc_bitmap() instead of open-coding it. Size computation wrapped in struct_size() macro to prevent potential integer overflows. Signed-off-by: Denis Efremov --- Changes in v2: - size computation wrapped in struct_size() Changes in v3: - int size dropped fs/udf

  1   2   3   4   5   6   7   8   9   10   >