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 (i
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:
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
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
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
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
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
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
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: Col
for this type 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..fcf908b34f2
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
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
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
> according
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,
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
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
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
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
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..3320613400eb 10
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..f906633eae46 10
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_F
"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
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
"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
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
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
- "depen
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
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
>
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
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
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:
>>>
>>>>
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;
>>>
On 2/18/21 12:31 AM, Julia Lawall wrote:
>> +@depends on patch@
>> +identifier tmp;
>> +expression a, b;
>> +type T;
>> +@@
>> +
>> +(
>> +- T tmp;
>> +|
>> +- T tmp = 0;
>> +|
>> +- T *tmp = NULL;
>> +)
>> +... when != tmp
>> +- tmp = a;
>> +- a = b;
>> +- b = tmp;
>> ++ swap(a, b);
>> +... whe
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
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
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
>
>
ibblkid 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: Den
On 1/22/21 2:13 PM, Jiri Kosina wrote:
> From: Jiri Kosina
>
> This issue was originally fixed in 09954bad4 ("floppy: refactor open()
> flags handling").
>
> The fix as a side-effect, however, introduce issue for open(O_ACCMODE)
> that is being used for ioctl-only open. I wrote a fix for th
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 ("floppy: ref
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.19.
>
> Can you or Denis send a proper patc
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
>> syn
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 olde
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 current
Hi,
This patch (CVE-2020-27825) was tagged with
Fixes: b23d7a5f4a07a ("ring-buffer: speed up buffer resets by avoiding
synchronize_rcu for each CPU")
I'm not an expert here but it seems like b23d7a5f4a07a only refactored
ring_buffer_reset_cpu() by introducing reset_disabled_cpu_buffer() without
Hi,
On 1/19/21 6:53 PM, Jiri Kosina wrote:
> On Mon, 25 Jul 2016, Jens Axboe wrote:
>
>>> From: Jiri Kosina
>>>
>>> Commit 09954bad4 ("floppy: refactor open() flags handling"), as a
>>> side-effect, causes open(/dev/fdX, O_ACCMODE) to fail. It turns out that
>>> this is being used setfdprm users
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
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
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
&
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 showing this position in
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
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
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
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
+
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
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(-)
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/mel
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 wa
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
>>
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 compiler from eli
ree.cocci
> +++ b/scripts/coccinelle/free/kfree_sensitive.cocci
> @@ -1,13 +1,13 @@
> // SPDX-License-Identifier: GPL-2.0-only
> ///
> -/// Use kzfree, kvfree_sensitive rather than memset or
> -/// memzero_explicit followed by kfree
> +/// Use k{,v}free_sensitive rather th
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(-)
di
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
@@
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
can lead 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
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
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/ex
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
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 preve
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
")
[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
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
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 = &var;" pattern removed
- "var =@p var", "v
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
On 8/30/20 3:43 AM, Joe Perches wrote:
> $ cat sysfs_emit.cocci
> @@
> identifier d_show =~ "^.*show.*$";
I think this additional pattern will allow to take more functions into the
scope.
@da@
identifier show, store;
expression name, mode;
@@
(
DEVICE_ATTR(name, mode, show, store)
|
DE
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
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
>
> Anyway, this will need updating, likely with better examples.
>
> diff --git a/Documentation/filesystems/sysfs.rst
> b/Documentation/filesystems/sysfs.rst
> index ab0f7795792b..13c7a86fa6c8 100644
> --- a/Documentation/filesystems/sysfs.rst
> +++ b/Documentation/filesystems/sysfs.rst
> @@
Hi,
On 8/29/20 9:23 PM, Joe Perches wrote:
> While doing an investigation for a possible treewide conversion of
> sysfs output using sprintf/snprintf/scnprintf, I discovered
> several instances of sysfs output without terminating newlines.
>
> It seems likely all of these should have newline term
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
Hi,
On 8/29/20 1:52 AM, Joe Perches wrote:
> sprintf does not know the PAGE_SIZE maximum of the temporary buffer
> used for outputting sysfs content requests and it's possible to
> overrun the buffer length.
>
> Add a generic sysfs_emit mechanism that knows that the size of the
> temporary buffer
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
>
> I tried:
> @@
> identifier f_show =~ "^.*_show$";
This will miss this kind of functions:
./drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1953:static
DEVICE_ATTR(vbios_version, 0444, amdgpu_atombios_get_vbios_version,
./drivers/gpu/drm/amd/amdgpu/df_v3_6.c:266:static DEVICE_ATTR(df_cntr_avail
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
On 8/28/20 1:09 AM, Gustavo A. R. Silva wrote:
>
>
> On 8/27/20 16:25, Denis Efremov wrote:
>> Use kvzalloc() in udf_sb_alloc_bitmap() instead of open-coding it.
>> Size computation wrapped in struct_size() macro to prevent potential
>> integer overflows.
>>
Use kvzalloc() in mspec_mmap() instead of open-coding it.
Signed-off-by: Denis Efremov
---
drivers/char/mspec.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
index 0fae33319d2e..f8231e2e84be 100644
--- a/drivers/char/mspec.c
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
---
fs/udf/super.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/fs/udf/super.c
Hi all,
On 8/27/20 10:42 PM, Julia Lawall wrote:
>
>
> On Thu, 27 Aug 2020, Joe Perches wrote:
>
>> On Thu, 2020-08-27 at 15:48 +0100, Alex Dewar wrote:
>>> On Thu, Aug 27, 2020 at 03:41:06PM +0200, Rasmus Villemoes wrote:
On 27/08/2020 15.18, Alex Dewar wrote:
> On Thu, Aug 27, 2020 a
Use kvzalloc() in __iommu_alloc_buffer() instead of open-coding it.
Size computation wrapped in array_size() macro to prevent potential
integer overflows.
Signed-off-by: Denis Efremov
---
Changes in v2:
- array_size() added
arch/arm/mm/dma-mapping.c | 6 +-
1 file changed, 1 insertion
> @@ -1013,10 +1013,7 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct
> super_block *sb, u32 index)
> size = sizeof(struct udf_bitmap) +
> (sizeof(struct buffer_head *) * nr_groups);
I missed that this size is a good place to use struct_size for
overflow checking. I
Use kvzalloc() in udf_sb_alloc_bitmap() instead of open-coding it.
Signed-off-by: Denis Efremov
---
I'm not sure about TODO comment, through.
fs/udf/super.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 1c42f544096d..c7cd152
Use kvzalloc() in __iommu_alloc_buffer() instead of open-coding it.
Signed-off-by: Denis Efremov
---
arch/arm/mm/dma-mapping.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 8a8949174b1c..9def10affa70 100644
Ping?
On 8/1/20 4:31 PM, Denis Efremov wrote:
> Remove cxgbi_alloc_big_mem(), cxgbi_free_big_mem() functions
> and use kvzalloc/kvfree instead. __GFP_NOWARN added to kvzalloc()
> call because we already print a warning in case of allocation fail.
>
> Signed-off-by
Remove redundant memzero_explicit() in sun8i_ss_cipher() before calling
kfree_sensitive(). kfree_sensitive() will zero the memory with
memzero_explicit().
Fixes: 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")
Signed-off-by: Denis Efremov
---
Changes in v2:
- fixes
On 8/27/20 11:03 AM, Corentin Labbe wrote:
> Could you add:
> Fixes: 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()")
I doubt this change deserves fixes tag, since this is just a cleanup.
Anyway, I will send v2 with it.
Thanks,
Denis
Remove redundant memzero_explicit() in sun8i_ss_cipher() before calling
kfree_sensitive(). kfree_sensitive() will zero the memory with
memzero_explicit().
Signed-off-by: Denis Efremov
---
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 -
1 file changed, 1 deletion(-)
diff --git a
Use kvfree_sensitive() instead of open-coding it.
Signed-off-by: Denis Efremov
---
security/keys/big_key.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/security/keys/big_key.c b/security/keys/big_key.c
index 691347dea3c1..d17e5f09eeb8 100644
--- a/security/keys
Use kfree_sensitive() instead of open-coding it.
Signed-off-by: Denis Efremov
---
.../crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 15 +++
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
b/drivers/crypto
kfree_sensitive() is introduced in commit 453431a54934
("mm, treewide: rename kzfree() to kfree_sensitive()") and uses
memzero_explicit() internally. Thus, we can switch to this API
instead of open-coding memzero_explicit() && kfree().
Changes in v2:
- if (op->len) check r
Use kfree_sensitive() instead of open-coding it.
Signed-off-by: Denis Efremov
---
.../crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 15 +++
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
b/drivers/crypto
Use kfree_sensitive() instead of open-coding it.
Signed-off-by: Denis Efremov
---
drivers/crypto/amlogic/amlogic-gxl-cipher.c | 10 ++
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c
b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
1 - 100 of 519 matches
Mail list logo