Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-15 Thread Alexey Dobriyan
On Sun, Apr 14, 2024 at 01:58:55PM -0700, Luis Chamberlain wrote: > On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -3616,4 +3616,12 @@ extern int vfs_fadvise(struct file *file, loff_t &

[PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-14 Thread Alexey Dobriyan
characters from different languages and emojis (except obviously). Signed-off-by: Alexey Dobriyan --- include/linux/fs.h |8 kernel/module/main.c |5 + 2 files changed, 13 insertions(+) --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3616,4 +3616,12 @@ extern int

[PATCH v3 2/2] uapi: fix header guard in include/uapi/linux/stddef.h

2023-09-12 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan --- include/uapi/linux/stddef.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/include/uapi/linux/stddef.h +++ b/include/uapi/linux/stddef.h @@ -50,8 +50,9 @@ TYPE NAME[]; \ } #endif -#endif #ifndef __counted_by

[PATCH v3 1/2] uapi: fix __DECLARE_FLEX_ARRAY for C++

2023-09-12 Thread Alexey Dobriyan
T member[]; }; Use "T member[0];" which seems to work and does the right thing wrt structure layout. Signed-off-by: Alexey Dobriyan Fixes: 3080ea5553cc ("stddef: Introduce DECLARE_FLEX_ARRAY() helper") --- include/uapi/linux/stddef.h |6 ++ 1 file changed, 6 insertion

Re: [PATCH v2] uapi: fix __DECLARE_FLEX_ARRAY for C++

2023-09-12 Thread Alexey Dobriyan
On Mon, Sep 11, 2023 at 08:19:20AM +, David Laight wrote: > ... > > Okay, can you please split the patch so they can be backported > > separately? Then I'll get them landed, etc. > > Since the header with just the extra #endif is badly broken on C++ > isn't it best to ensure they get

Re: [PATCH v2] docs: proc.rst: meminfo: briefly describe gaps in memory accounting

2021-04-20 Thread Alexey Dobriyan
On Tue, Apr 20, 2021 at 03:57:07PM +0200, Michal Hocko wrote: > On Tue 20-04-21 14:24:30, Matthew Wilcox wrote: > > On Tue, Apr 20, 2021 at 03:13:54PM +0300, Mike Rapoport wrote: > > > Add a paragraph that explains that it may happen that the counters in > > > /proc/meminfo do not add up to the

[PATCH v2] kconfig: redo fake deps at include/config/*.h

2021-04-15 Thread Alexey Dobriyan
├── 64BIT ... ├── ZSWAP_DEFAULT_ON ├── ZSWAP_ZPOOL_DEFAULT └── ZSWAP_ZPOOL_DEFAULT_ZBUD 0 directories, 12364 files Signed-off-by: Alexey Dobriyan --- include/linux/compiler-version.h |2 +- init/Kconfig |2 +- kernel

[PATCH] kconfig: redo fake deps at include/config/*.h

2021-04-14 Thread Alexey Dobriyan
├── ZSWAP_COMPRESSOR_DEFAULT ├── ZSWAP_COMPRESSOR_DEFAULT_LZO ├── ZSWAP_DEFAULT_ON ├── ZSWAP_ZPOOL_DEFAULT └── ZSWAP_ZPOOL_DEFAULT_ZBUD 0 directories, 12364 files Signed-off-by: Alexey Dobriyan --- include/linux/compiler-version.h |2 +- init

[PATCH] IDE: support QT Creator

2021-04-12 Thread Alexey Dobriyan
$ ./scripts/ide/qt-creator.sh xxx from top-level directory Note: ibmvnic.c is excluded from project files to workaround libCPlusPlus crash. Signed-off-by: Alexey Dobriyan --- scripts/ide/qt-creator.sh | 49 ++ 1 file changed, 49 insertions

[RFC] Tainting tasks after poking at them

2021-04-10 Thread Alexey Dobriyan
I'm not a security guy, but The idea is to irrevocably mark task as tainted after its registers and/or memory have been changed by another task. The list definitely includes * ptrace PTRACE_POKEUSER, PTRACE_POKETEXT, PTRACE_POKEDATA, PTRACE_SETREGS, PTRACE_SETFPREGS. * process_vm_writev(2) If

Re: [PATCH] proc: smoke test lseek()

2021-04-07 Thread Alexey Dobriyan
On Wed, Apr 07, 2021 at 08:58:09PM +0100, Matthew Wilcox wrote: > On Wed, Apr 07, 2021 at 10:55:14PM +0300, Alexey Dobriyan wrote: > > Now that ->proc_lseek has been made mandatory it would be nice to test > > that nothing has been forgotten. > > > @@ -45,6 +45,8

[PATCH] proc: smoke test lseek()

2021-04-07 Thread Alexey Dobriyan
Now that ->proc_lseek has been made mandatory it would be nice to test that nothing has been forgotten. Signed-off-by: Alexey Dobriyan --- May want to fold into proc-mandate-proc_lseek-in-struct-proc_ops.patch tools/testing/selftests/proc/read.c |4 +++- 1 f

[PATCH] Dixup sysname wrt recent cultural developments

2021-04-01 Thread Alexey Dobriyan
It is apparent that emoji outbreak can not be contained. In that case might as well embrace it. Change main kernel banner, /proc/version and uname(2) output. Signed-off-by: Alexey Dobriyan --- include/linux/uts.h |2 +- init/version.c |2 +- 2 files changed, 2 insertions(+), 2

Re: [PATCH] Document that PF_KTHREAD _is_ ABI

2021-03-31 Thread Alexey Dobriyan
On Mon, Mar 22, 2021 at 07:53:10AM +, Christoph Hellwig wrote: > On Sat, Mar 20, 2021 at 10:23:12AM -0700, Andy Lutomirski wrote: > > > https://github.com/systemd/systemd/blob/main/src/basic/process-util.c#L354 > > > src/basic/process-util.c:is_kernel_thread() > > > > Eww. > > > > Could we

Re: [PATCH] Document that PF_KTHREAD _is_ ABI

2021-03-20 Thread Alexey Dobriyan
On Sat, Mar 20, 2021 at 10:23:12AM -0700, Andy Lutomirski wrote: > > On Mar 20, 2021, at 9:31 AM, Alexey Dobriyan wrote: > > > > PF_KTHREAD value is visible via field number 9 of /proc/*/stat > > > >$ sudo cat /proc/2/stat > >

[PATCH] Document that PF_KTHREAD _is_ ABI

2021-03-20 Thread Alexey Dobriyan
is a disaster. I hope we can mask everything but few flags and hope for the best :^) Note for beginner Linux programmers: every other way you find on the interwebs and Stack Overflow for checking if pid belongs to a kernel thread is broken one way or another. Signed-off-by: Alexey Dobriyan --- include

[PATCH] proc: test subset=pid

2021-03-20 Thread Alexey Dobriyan
Test that /proc instance mounted with mount -t proc -o subset=pid contains only ".", "..", "self", "thread-self" and pid directories. Note: Currently "subset=pid" doesn't return "." and ".." via readdir. This must be

[PATCH] proc: delete redundant subset=pid check

2021-03-20 Thread Alexey Dobriyan
Two checks in lookup and readdir code should be enough to not have third check in open code. Can't open what can't be looked up? Signed-off-by: Alexey Dobriyan --- fs/proc/inode.c |4 1 file changed, 4 deletions(-) --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -483,7 +483,6

[PATCH] proc: mandate ->proc_lseek in "struct proc_ops"

2021-03-20 Thread Alexey Dobriyan
Now that proc_ops are separate from file_operations and other operations it easy to check all instances to have ->proc_lseek hook and remove check in main code. Note: nonseekable_open() files naturally don't require ->proc_lseek. Garbage collect pde_lseek() function. Signed-off-by:

[PATCH] proc: save LOC in __xlate_proc_name()

2021-03-20 Thread Alexey Dobriyan
Can't look at this verbosity anymore. Signed-off-by: Alexey Dobriyan --- fs/proc/generic.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -166,15 +166,8 @@ static int __xlate_proc_name(const char *name, struct

Re: auxv stuff (Re: [PATCH] prctl: fix PR_SET_MM_AUXV kernel stack leak)

2021-03-16 Thread Alexey Dobriyan
On Mon, Mar 15, 2021 at 09:42:47AM +0300, Cyrill Gorcunov wrote: > On Mon, Mar 15, 2021 at 09:00:00AM +0300, Alexey Dobriyan wrote: > > On Sun, Mar 14, 2021 at 02:40:05PM -0700, Linus Torvalds wrote: > > > [mm->saved_auxv] > > > > > > That's a separate issue

Re: [PATCH] prctl: fix PR_SET_MM_AUXV kernel stack leak

2021-03-15 Thread Alexey Dobriyan
On Mon, Mar 15, 2021 at 01:29:02PM +0300, Dan Carpenter wrote: > On Sun, Mar 14, 2021 at 11:51:14PM +0300, Alexey Dobriyan wrote: > > prctl(PR_SET_MM, PR_SET_MM_AUXV, addr, 1); > > > > will copy 1 byte from userspace to (quite big) on-stack array > > and

auxv stuff (Re: [PATCH] prctl: fix PR_SET_MM_AUXV kernel stack leak)

2021-03-15 Thread Alexey Dobriyan
On Sun, Mar 14, 2021 at 02:40:05PM -0700, Linus Torvalds wrote: > [mm->saved_auxv] > > That's a separate issue, and I can't find it in myself to care (and > nobody has ever complained), but I thought I'd mention it. There is another (non-security) one. Compat 32-bit process will report 2 longs

[PATCH] prctl: fix PR_SET_MM_AUXV kernel stack leak

2021-03-14 Thread Alexey Dobriyan
ack contents to userspace. This devious scheme requires CAP_SYS_RESOURCE. Signed-off-by: Alexey Dobriyan --- apply to >=3.5 kernel/sys.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2079,7 +2079,7 @@ static int prctl_set_auxv(

[PATCH] cred: make init_groups static

2021-03-14 Thread Alexey Dobriyan
Nothing really uses init_groups. It can be accessed via init_cred if necessary. Signed-off-by: Alexey Dobriyan --- include/linux/cred.h |1 - include/linux/init_task.h |1 - kernel/cred.c |2 +- 3 files changed, 1 insertion(+), 3 deletions(-) --- a/include/linux

Re: [PATCH] fs: proc: fix error return code of proc_map_files_readdir()

2021-03-09 Thread Alexey Dobriyan
On Tue, Mar 09, 2021 at 10:30:23AM -0800, Eric Biggers wrote: > On Tue, Mar 09, 2021 at 01:55:27AM -0800, Jia-Ju Bai wrote: > > When get_task_mm() returns NULL to mm, no error return code of > > proc_map_files_readdir() is assigned. > > To fix this bug, ret is assigned with -ENOENT in this case.

Re: [PATCH 02/11] pragma once: convert arch/arm/tools/gen-mach-types

2021-03-02 Thread Alexey Dobriyan
On Mon, Mar 01, 2021 at 10:19:50AM +, Russell King - ARM Linux admin wrote: > On Sun, Feb 28, 2021 at 07:59:16PM +0300, Alexey Dobriyan wrote: > > From 72842f89ae91a4d02ea29604f87c373052bd3f64 Mon Sep 17 00:00:00 2001 > > From: Alexey Dobriyan > > Date: Tue, 9 Fe

Re: [PATCH 00/11] pragma once: treewide conversion

2021-02-28 Thread Alexey Dobriyan
On Sun, Feb 28, 2021 at 09:46:17AM -0800, Linus Torvalds wrote: > On Sun, Feb 28, 2021 at 8:57 AM Alexey Dobriyan wrote: > > > > This is bulk deletion of preprocessor include guards and conversion > > to #pragma once directive. > > So as mentioned earlier, I

Re: [PATCH 09/11] pragma once: convert scripts/selinux/genheaders/genheaders.c

2021-02-28 Thread Alexey Dobriyan
On Sun, Feb 28, 2021 at 01:37:41PM -0500, Paul Moore wrote: > On Sun, Feb 28, 2021 at 12:04 PM Alexey Dobriyan wrote: > > > > From 097f2c8b2af7d9e88cff59376ea0ad51b95341cb Mon Sep 17 00:00:00 2001 > > From: Alexey Dobriyan > > Date: Tue, 9 Feb 2021 00:39:23 +030

[PATCH 12/11] pragma once: scripted treewide conversion

2021-02-28 Thread Alexey Dobriyan
). Not compile tested on csky, hexagon, nds32, openrisc. Love, Alexey Signed-off-by: Alexey Dobriyan #!/bin/sh -x find . -type f -name '*.h' -print |\ LC_ALL=C sort |\ sed -e 's#^./##g' |\ xargs ./scripts/pragma-once.py find . -type

[PATCH 11/11] pragma once: conversion script (in Python 2)

2021-02-28 Thread Alexey Dobriyan
>From 2bffcdfec69a8d28e9cb2c535724fbba8e12b820 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 14:47:34 +0300 Subject: [PATCH 11/11] pragma once: conversion script (in Python 2) Script accepts list of files to be converted from the command line, strips include guard if

[PATCH 10/11] pragma once: delete few backslashes

2021-02-28 Thread Alexey Dobriyan
>From 251ca5673886b5bb0a42004944290b9d2b267a4a Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 19 Feb 2021 13:37:24 +0300 Subject: [PATCH 10/11] pragma once: delete few backslashes Some macros contain one backslash too many and end up being the last macro in a header file. When #pra

[PATCH 09/11] pragma once: convert scripts/selinux/genheaders/genheaders.c

2021-02-28 Thread Alexey Dobriyan
>From 097f2c8b2af7d9e88cff59376ea0ad51b95341cb Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 00:39:23 +0300 Subject: [PATCH 09/11] pragma once: convert scripts/selinux/genheaders/genheaders.c Generate security/selinux/flask.h and security/selinux/av_permissions.h with

[PATCH 07/11] pragma once: convert kernel/time/timeconst.bc

2021-02-28 Thread Alexey Dobriyan
>From e428633ff0df5fe8501aaf785c6961fc766344b2 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 00:31:23 +0300 Subject: [PATCH 07/11] pragma once: convert kernel/time/timeconst.bc Generate include/generated/timeconst.h without include guard. Signed-off-by: Alexey Dobri

[PATCH 08/11] pragma once: convert scripts/atomic/

2021-02-28 Thread Alexey Dobriyan
>From f10fe79897fa9600f144c76bc5df52dba28b7a66 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 01:37:55 +0300 Subject: [PATCH 08/11] pragma once: convert scripts/atomic/ Generate atomic headers without include guards. Signed-off-by: Alexey Dobriyan --- include/asm-gene

[PATCH 06/11] pragma once: convert include/linux/cb710.h

2021-02-28 Thread Alexey Dobriyan
>From 1c4107e55b322dada46879837d4d64841bc5f150 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 16:56:54 +0300 Subject: [PATCH 06/11] pragma once: convert include/linux/cb710.h This file is concatenation of two files with two include guards. Convert it manually. Signed-

[PATCH 04/11] pragma once: convert drivers/gpu/drm/pl111/pl111_nomadik.h

2021-02-28 Thread Alexey Dobriyan
>From fe8504a1a0b5352cbc676b933c3dbb79ae9f59c9 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 16:50:24 +0300 Subject: [PATCH 04/11] pragma once: convert drivers/gpu/drm/pl111/pl111_nomadik.h This file has broken include guard, convert it manually. Signed-off-by: Ale

[PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h

2021-02-28 Thread Alexey Dobriyan
>From 1f58b4923ca9bfb8b1e73554d3793ee98ab58a77 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 17:14:25 +0300 Subject: [PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h This file has broken include guard which is not obvious just by looking at the c

[PATCH 03/11] pragma once: convert arch/s390/tools/gen_facilities.c

2021-02-28 Thread Alexey Dobriyan
>From 45622ce1e4db512ad603dd90f959e61285b7541a Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 14:43:52 +0300 Subject: [PATCH 03/11] pragma once: convert arch/s390/tools/gen_facilities.c Generate arch/s390/include/generated/asm/facility-defs.h without include guard. Sig

[PATCH 01/11] pragma once: delete include/linux/atm_suni.h

2021-02-28 Thread Alexey Dobriyan
>From c17ac63e1334c742686cd411736699c1d34d45a7 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 10 Feb 2021 21:07:45 +0300 Subject: [PATCH 01/11] pragma once: delete include/linux/atm_suni.h This file has been empty since 2.3.99-pre3! Delete it instead of converting to #pragma o

[PATCH 02/11] pragma once: convert arch/arm/tools/gen-mach-types

2021-02-28 Thread Alexey Dobriyan
>From 72842f89ae91a4d02ea29604f87c373052bd3f64 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 9 Feb 2021 14:37:40 +0300 Subject: [PATCH 02/11] pragma once: convert arch/arm/tools/gen-mach-types Generate arch/arm/include/generated/asm/mach-types.h without include guard. Signed-

[PATCH 00/11] pragma once: treewide conversion

2021-02-28 Thread Alexey Dobriyan
This is bulk deletion of preprocessor include guards and conversion to #pragma once directive. See [PATCH 11/11] and [PATCH 12/11] for the script and rationale. Everything else is trivial stuff.

Re: #pragma once (was Re: incoming)

2021-02-26 Thread Alexey Dobriyan
On Fri, Feb 26, 2021 at 01:53:48PM -0800, Linus Torvalds wrote: > On Fri, Feb 26, 2021 at 12:17 PM Alexey Dobriyan wrote: > > > > I want to sent treewide "#pragma once" conversion: > > Are there *any* advantages to it? > > It's non-standard, It is effective

#pragma once (was Re: incoming)

2021-02-26 Thread Alexey Dobriyan
Linus wrote: > I'm hoping to just do -rc1 this weekend after all - despite my late > start due to loss of power for several days. > > I'll allow late stragglers with good reason through, but the fewer of > those there are, the better, of course. I want to sent treewide "#pragma once"

Re: [PATCH] proc: Convert S_ permission uses to octal

2021-02-13 Thread Alexey Dobriyan
On Fri, Feb 12, 2021 at 04:01:48PM -0600, Eric W. Biederman wrote: > Joe Perches writes: > > > Convert S_ permissions to the more readable octal. > Something like that should be able to address the readability while > still using symbolic constants. Macros are easy. I've sent a patch long time

Re: [PATCH v5 2/2] procfs/dmabuf: Add inode number to /proc/*/fdinfo

2021-02-08 Thread Alexey Dobriyan
On Mon, Feb 08, 2021 at 03:22:44PM +, Matthew Wilcox wrote: > On Mon, Feb 08, 2021 at 03:14:28PM +, Kalesh Singh wrote: > > - seq_printf(m, "pos:\t%lli\nflags:\t0%o\nmnt_id:\t%i\n", > > + seq_printf(m, "pos:\t%lli\nflags:\t0%o\nmnt_id:\t%i\ninode_no:\t%lu\n", > > You changed it

Re: [PATCH 1/5] sched: make struct task_struct::state 32-bit

2021-02-08 Thread Alexey Dobriyan
On Mon, Feb 08, 2021 at 04:25:35PM +0100, Peter Zijlstra wrote: > On Mon, Feb 08, 2021 at 05:52:45PM +0300, Alexey Dobriyan wrote: > > On Mon, Feb 08, 2021 at 05:30:25PM +0300, Alexey Dobriyan wrote: > > > On Mon, Feb 08, 2021 at 11:34:18AM +0100, Peter Zijlstra wrote: > >

Re: [PATCH 1/5] sched: make struct task_struct::state 32-bit

2021-02-08 Thread Alexey Dobriyan
On Mon, Feb 08, 2021 at 05:30:25PM +0300, Alexey Dobriyan wrote: > On Mon, Feb 08, 2021 at 11:34:18AM +0100, Peter Zijlstra wrote: > > On Sat, Feb 06, 2021 at 06:18:32PM +0300, Alexey Dobriyan wrote: > > > > > Silently delete "extern" from prototypes. > >

Re: [PATCH 1/5] sched: make struct task_struct::state 32-bit

2021-02-08 Thread Alexey Dobriyan
On Mon, Feb 08, 2021 at 11:39:25AM +0100, Peter Zijlstra wrote: > On Sat, Feb 06, 2021 at 06:18:32PM +0300, Alexey Dobriyan wrote: > > 32-bit accesses are shorter than 64-bit accesses on x86_64. > > Nothing uses 64-bitness of struct task_struct::state. > > > > Pr

Re: [PATCH 1/5] sched: make struct task_struct::state 32-bit

2021-02-08 Thread Alexey Dobriyan
On Mon, Feb 08, 2021 at 11:34:18AM +0100, Peter Zijlstra wrote: > On Sat, Feb 06, 2021 at 06:18:32PM +0300, Alexey Dobriyan wrote: > > > Silently delete "extern" from prototypes. > > NAK, extern is right. Extern is only necessary for variables.

[PATCH 5/5] sched: make multiple runqueue task counters 32-bit

2021-02-06 Thread Alexey Dobriyan
to futex pid limits), then per-runqueue counters can't as well. This patchset has been sponsored by REX Prefix Eradication Society. Signed-off-by: Alexey Dobriyan --- kernel/sched/loadavg.c |2 +- kernel/sched/sched.h | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions

[PATCH 4/5] sched: make nr_iowait_cpu() return 32-bit

2021-02-06 Thread Alexey Dobriyan
Runqueue ->nr_iowait counters are 32-bit anyway. Propagate 32-bitness into other code, but don't try too hard. Signed-off-by: Alexey Dobriyan --- drivers/cpuidle/governors/menu.c |6 +++--- include/linux/sched/stat.h |2 +- kernel/sched/core.c |2 +- 3 fi

[PATCH 3/5] sched: make nr_iowait() return 32-bit value

2021-02-06 Thread Alexey Dobriyan
Creating 2**32 tasks to wait in D-state is impossible and wasteful. Return "unsigned int" and save on REX prefixes. Signed-off-by: Alexey Dobriyan --- fs/proc/stat.c |2 +- include/linux/sched/stat.h |2 +- kernel/sched/core.c|4 ++-- 3 files

[PATCH 2/5] sched: make nr_running() return 32-bit

2021-02-06 Thread Alexey Dobriyan
Creating 2**32 tasks to run is impossible due to futex pid limits and wasteful anyway. Nobody have done it. Bring nr_running() into 32-bit world to save on REX prefixes. Signed-off-by: Alexey Dobriyan --- fs/proc/loadavg.c |2 +- fs/proc/stat.c |2 +- include

[PATCH 1/5] sched: make struct task_struct::state 32-bit

2021-02-06 Thread Alexey Dobriyan
32-bit accesses are shorter than 64-bit accesses on x86_64. Nothing uses 64-bitness of struct task_struct::state. Propagate 32-bitness to other variables and functions. Silently delete "extern" from prototypes. Signed-off-by: Alexey Dobriyan --- block/blk-mq.c

[tip: timers/core] timens: Delete no-op time_ns_init()

2021-02-05 Thread tip-bot2 for Alexey Dobriyan
The following commit has been merged into the timers/core branch of tip: Commit-ID: 174bcc691f44fdd05046c694fc650933819f72c7 Gitweb: https://git.kernel.org/tip/174bcc691f44fdd05046c694fc650933819f72c7 Author:Alexey Dobriyan AuthorDate:Tue, 29 Dec 2020 00:54:02 +03:00

[tip: x86/cleanups] x86/asm: Fixup TASK_SIZE_MAX comment

2021-02-05 Thread tip-bot2 for Alexey Dobriyan
The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: 4f63b320afdd9af406f4426b0ff1a2cdb23e5b8d Gitweb: https://git.kernel.org/tip/4f63b320afdd9af406f4426b0ff1a2cdb23e5b8d Author:Alexey Dobriyan AuthorDate:Thu, 05 Mar 2020 21:17:19 +03:00

Re: linux-next: build failure after merge of the akpm-current tree

2021-01-27 Thread Alexey Dobriyan
On Wed, Jan 27, 2021 at 11:21:18PM +1100, Stephen Rothwell wrote: > Caused by commit > > 5567a1a4b1c3 ("ramfs: support O_TMPFILE") Can this be merged or sent to Al, please? It's ancient patch.

Re: [PATCH] fs/proc: Expose RSEQ configuration

2021-01-13 Thread Alexey Dobriyan
On Wed, Jan 13, 2021 at 06:41:27PM +0100, Piotr Figiel wrote: > +static int proc_pid_rseq(struct seq_file *m, struct pid_namespace *ns, > + struct pid *pid, struct task_struct *task) > +{ > + int res = lock_trace(task); > + > + if (res) > + return

Re: [PATCH] fs/proc: Expose RSEQ configuration

2021-01-13 Thread Alexey Dobriyan
On Wed, Jan 13, 2021 at 06:41:27PM +0100, Piotr Figiel wrote: > For userspace checkpoint and restore (C/R) some way of getting process > state containing RSEQ configuration is needed. > + seq_printf(m, "0x%llx 0x%x\n", (uint64_t)task->rseq, task->rseq_sig); %llx is too much on 32-bit. "%tx

[PATCH] timens: delete no-op time_ns_init()

2020-12-28 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan --- kernel/time/namespace.c |6 -- 1 file changed, 6 deletions(-) --- a/kernel/time/namespace.c +++ b/kernel/time/namespace.c @@ -465,9 +465,3 @@ struct time_namespace init_time_ns = { .ns.ops = _operations, .frozen_offsets = true

Re: + proc-wchan-use-printk-format-instead-of-lookup_symbol_name-fix.patch added to -mm tree

2020-12-28 Thread Alexey Dobriyan
On Tue, Dec 22, 2020 at 06:18:34PM -0800, a...@linux-foundation.org wrote: > > proc-wchan-use-printk-format-instead-of-lookup_symbol_name-fix.patch > --- > a/fs/proc/base.c~proc-wchan-use-printk-format-instead-of-lookup_symbol_name-fix > +++ a/fs/proc/base.c > @@ -384,15 +384,8 @@ static

[PATCH] proc: fix lookup in /proc/net subdirectories after setns(2)

2020-12-05 Thread Alexey Dobriyan
r /proc/net . Fixes: 1da4d377f943 ("proc: revalidate misc dentries") Reported-by: "Rantala, Tommi T. (Nokia - FI/Espoo)" Signed-off-by: Alexey Dobriyan --- fs/proc/generic.c | 24 ++-- fs/proc/internal.h |7 +++ fs/proc/proc_net.c

[PATCH] proc: fix lookup in /proc/net subdirectories after setns(2)

2020-12-05 Thread Alexey Dobriyan
r /proc/net . Fixes: 1da4d377f943 ("proc: revalidate misc dentries") Reported-by: "Rantala, Tommi T. (Nokia - FI/Espoo)" Signed-off-by: Alexey Dobriyan --- fs/proc/generic.c | 24 ++-- fs/proc/internal.h |7 +++ fs/proc/proc_net.c

Re: [PATCH 05/10] proc: use %u for pid printing and slightly less stack

2020-12-03 Thread Alexey Dobriyan
On Fri, Dec 04, 2020 at 02:31:59AM +0800, Wen Yang wrote: > From: Alexey Dobriyan > > [ Upstream commit e3912ac37e07a13c70675cd75020694de4841c74 ] > > PROC_NUMBUF is 13 which is enough for "negative int + \n + \0". > > However PIDs and TGIDs are never negati

[PATCH] mm: cleanup kstrto*() usage

2020-11-22 Thread Alexey Dobriyan
Range checks can folded into proper conversion function. kstrto*() exist for all arithmetic types. Signed-off-by: Alexey Dobriyan --- mm/khugepaged.c | 18 +- mm/ksm.c| 18 +- 2 files changed, 18 insertions(+), 18 deletions(-) --- a/mm/khugepaged.c

[PATCH] lib: cleanup kstrto*() usage

2020-11-22 Thread Alexey Dobriyan
Use proper conversion functions. kstrto*() variants exist for all standard types. Signed-off-by: Alexey Dobriyan --- lib/test_firmware.c |9 +++-- lib/test_kmod.c | 26 ++ 2 files changed, 13 insertions(+), 22 deletions(-) --- a/lib/test_firmware.c +++ b

[PATCH] driver core: cleanup kstrto*() usage

2020-11-22 Thread Alexey Dobriyan
kstrto*() functions can write result directly to target memory if no additional checks needs to be done. Signed-off-by: Alexey Dobriyan --- drivers/base/core.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1701,12

Re: [PATCH] kbuild: Run syncconfig with -s

2020-09-14 Thread Alexey Dobriyan
> BTW., there's another, rather spurious bug I recently triggered in kbuild. > > Occasionally when I Ctrl-C a kernel build on a system with a lot of CPUs, > the .o.cmd file gets corrupted: Those are temporary files, truncated at page boundary. $ stat -c %s XXX.pata_sil680.mod.o.cmd

Re: [RESEND PATCH 2/2] /proc/stat: Simplify iowait and idle calculations when cpu is offline

2020-09-10 Thread Alexey Dobriyan
On Wed, Sep 09, 2020 at 08:41:22AM -0600, Tom Hromatka wrote: > static u64 get_idle_time(struct kernel_cpustat *kcs, int cpu) > { > - u64 idle, idle_usecs = -1ULL; > + u64 idle, idle_usecs; > > - if (cpu_online(cpu)) > - idle_usecs = get_cpu_idle_time_us(cpu, NULL); > -

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-04 Thread Alexey Dobriyan
On Fri, Sep 04, 2020 at 08:00:24AM +0200, Ingo Molnar wrote: > * Christoph Hellwig wrote: > > this series removes the last set_fs() used to force a kernel address > > space for the uaccess code in the kernel read/write/splice code, and then > > stops implementing the address space overrides

make defconfig (Re: + x86-defconfigs-explicitly-unset-config_64bit-in-i386_defconfig.patch added to -mm tree)

2020-08-21 Thread Alexey Dobriyan
On Thu, Aug 20, 2020 at 02:29:40PM -0700, a...@linux-foundation.org wrote: > Subject: x86/defconfigs: Explicitly unset CONFIG_64BIT in i386_defconfig > > A recent refresh of the defconfigs got rid of the following (unset) > config: > > # CONFIG_64BIT is not set > > Innocuous as it seems, when

Re: [PATCH 1/2] mm: add GFP mask param to strndup_user

2020-08-16 Thread Alexey Dobriyan
On Sat, Aug 15, 2020 at 11:42:10PM +0100, Al Viro wrote: > On Sat, Aug 15, 2020 at 11:23:43AM -0700, Pascal Bouchareine wrote: > > Let caller specify allocation. > > Preserve existing calls with GFP_USER. > > Bloody bad idea, unless you slap a BUG_ON(flags & GFP_ATOMIC) on it, > to make sure

Re: [PATCH 00/23] proc: Introduce /proc/namespaces/ directory to expose namespaces lineary

2020-08-03 Thread Alexey Dobriyan
On Mon, Aug 03, 2020 at 01:03:17PM +0300, Kirill Tkhai wrote: > On 31.07.2020 01:13, Eric W. Biederman wrote: > > Kirill Tkhai writes: > > > >> On 30.07.2020 17:34, Eric W. Biederman wrote: > >>> Kirill Tkhai writes: > >>> > Currently, there is no a way to list or iterate all or subset of

Re: [PATCH 11/23] fs: Add /proc/namespaces/ directory

2020-07-30 Thread Alexey Dobriyan
On Thu, Jul 30, 2020 at 03:00:19PM +0300, Kirill Tkhai wrote: > # ls /proc/namespaces/ -l > lrwxrwxrwx 1 root root 0 Jul 29 16:50 'cgroup:[4026531835]' -> > 'cgroup:[4026531835]' > lrwxrwxrwx 1 root root 0 Jul 29 16:50 'ipc:[4026531839]' -> 'ipc:[4026531839]' > lrwxrwxrwx 1 root root 0 Jul 29

make oldconfig (Re: mmotm 2020-07-27-18-18 uploaded (mm/page_alloc.c))

2020-07-29 Thread Alexey Dobriyan
On Tue, Jul 28, 2020 at 06:44:19PM -0700, Andrew Morton wrote: > On Tue, 28 Jul 2020 15:39:21 -0700 Randy Dunlap wrote: > > > On 7/28/20 2:55 PM, Andrew Morton wrote: > > > On Tue, 28 Jul 2020 05:33:58 -0700 Randy Dunlap > > > wrote: > > > > > >> On 7/27/20 6:19 PM, Andrew Morton wrote: > >

Re: [PATCH v3] proc,fcntl: introduce F_SET_DESCRIPTION

2020-07-27 Thread Alexey Dobriyan
On Fri, Jul 24, 2020 at 10:22:36PM -0700, Pascal Bouchareine wrote: > This command attaches a description to a file descriptor for > troubleshooting purposes. The free string is displayed in the > process fdinfo file for that fd /proc/pid/fdinfo/fd. > > One intended usage is to allow processes to

[tip: locking/core] rwsem: fix commas in initialisation

2020-07-17 Thread tip-bot2 for Alexey Dobriyan
The following commit has been merged into the locking/core branch of tip: Commit-ID: a9232dc5607dbada801f2fe83ea307cda762969a Gitweb: https://git.kernel.org/tip/a9232dc5607dbada801f2fe83ea307cda762969a Author:Alexey Dobriyan AuthorDate:Sat, 11 Jul 2020 17:59:54 +03:00

Re: [PATCH] rwsem: fix commas in initialisation

2020-07-13 Thread Alexey Dobriyan
On Mon, Jul 13, 2020 at 01:51:41PM +0200, Peter Zijlstra wrote: > On Sat, Jul 11, 2020 at 05:59:54PM +0300, Alexey Dobriyan wrote: > > Leading comma prevents arbitrary reordering of initialisation clauses. > > The whole point of C99 initialisation is to allow any such reord

[PATCH] rwsem: fix commas in initialisation

2020-07-11 Thread Alexey Dobriyan
Leading comma prevents arbitrary reordering of initialisation clauses. The whole point of C99 initialisation is to allow any such reordering. Signed-off-by: Alexey Dobriyan --- include/linux/rwsem.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/include/linux/rwsem.h

[PATCH] ipc: uninline functions

2020-07-10 Thread Alexey Dobriyan
Two functions are only called via function pointers, don't bother inlining them. Signed-off-by: Alexey Dobriyan --- ipc/sem.c |3 +-- ipc/shm.c |3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/ipc/sem.c +++ b/ipc/sem.c @@ -585,8 +585,7 @@ static int newary(struct

Re: [PATCH 1/3] readfile: implement readfile syscall

2020-07-04 Thread Alexey Dobriyan
Al wrote: > > On Sat, Jul 04, 2020 at 09:41:09PM +0200, Miklos Szeredi wrote: > > 1) just leave the first explanation (it's an open + read + close > > equivalent) and leave out the rest > > > > 2) add a loop around the vfs_read() in the code. > > 3) don't bother with the entire thing, until

Re: [PATCH] fs/proc: add short desc for /proc/softirqs

2020-07-01 Thread Alexey Dobriyan
On Wed, Jul 01, 2020 at 10:35:03PM +0800, zhenwei pi wrote: > Only softirq name is not friendly to end-users, typically 'HI' is > difficult to understand. During developing irqtop/lsirq utilities > for util-linux, Karel Zak considered that we should give more > information to end-users. Discuss

Re: process '/usr/bin/rsync' started with executable stack

2020-06-23 Thread Alexey Dobriyan
On Tue, Jun 23, 2020 at 02:33:50PM -0700, Christian Kujau wrote: > On Tue, 23 Jun 2020, Kees Cook wrote: > > > $ checksec --format=json --extended --file=`which rsync` | jq > > > { > > > "/usr/bin/rsync": { > > > "relro": "full", > > > "canary": "yes", > > > "nx": "no", > >

Re: process '/usr/bin/rsync' started with executable stack

2020-06-23 Thread Alexey Dobriyan
On Tue, Jun 23, 2020 at 02:33:50PM -0700, Christian Kujau wrote: > On Tue, 23 Jun 2020, Kees Cook wrote: > > > $ checksec --format=json --extended --file=`which rsync` | jq > > > { > > > "/usr/bin/rsync": { > > > "relro": "full", > > > "canary": "yes", > > > "nx": "no", > >

Re: process '/usr/bin/rsync' started with executable stack

2020-06-23 Thread Alexey Dobriyan
On Tue, Jun 23, 2020 at 02:33:50PM -0700, Christian Kujau wrote: > On Tue, 23 Jun 2020, Kees Cook wrote: > > > $ checksec --format=json --extended --file=`which rsync` | jq > > > { > > > "/usr/bin/rsync": { > > > "relro": "full", > > > "canary": "yes", > > > "nx": "no", > >

Re: process '/usr/bin/rsync' started with executable stack

2020-06-23 Thread Alexey Dobriyan
On Wed, Jun 24, 2020 at 12:12:18AM +0300, Alexey Dobriyan wrote: > On Tue, Jun 23, 2020 at 10:39:26AM -0700, Christian Kujau wrote: > > Hi, > > > > exactly this[0] happened today, on a 5.6.5 kernel: > > > > process '/usr/bin/rsync' started with executable sta

Re: process '/usr/bin/rsync' started with executable stack

2020-06-23 Thread Alexey Dobriyan
On Tue, Jun 23, 2020 at 10:39:26AM -0700, Christian Kujau wrote: > Hi, > > exactly this[0] happened today, on a 5.6.5 kernel: > > process '/usr/bin/rsync' started with executable stack > > But I can't reproduce this message, and rsync (v3.2.0, not exactly > abandonware) runs several times a

Re: [PATCH] linux++, this: rename "struct notifier_block *this"

2020-06-20 Thread Alexey Dobriyan
On Fri, Jun 19, 2020 at 11:37:47AM -0700, Linus Torvalds wrote: > On Thu, Jun 18, 2020 at 2:06 PM Alexey Dobriyan wrote: > > > > Rename > > struct notifier_block *this > > to > > struct notifier_block *nb > > > > "nb" is arg

Re: [PATCH 3/3] io_uring: add support for zone-append

2020-06-19 Thread Alexey Dobriyan
> uint64_t val = cqe->res; // assuming non-error here > > if (cqe->flags & IORING_CQE_F_ZONE_FOO) > val |= (cqe->flags >> 16) << 32ULL; Jens, ULL in shift doesn't do anything for widening the result. You need val |= (uint64_t)(cqe->flags >> 16) << 32;

[PATCH] linux++, this: rename "struct notifier_block *this"

2020-06-18 Thread Alexey Dobriyan
25.c Both gcc and g++ accept new name. It would make my adventure of carrying linux++ patchset slightly less miserable. Signed-off-by: Alexey Dobriyan --- arch/alpha/kernel/setup.c|2 +- arch/mips/kernel/pm-cps.c|2 +- arch/mips/s

Re: [PATCH] x86/asm/64: Align start of __clear_user() loop to 16-bytes

2020-06-18 Thread Alexey Dobriyan
On Thu, Jun 18, 2020 at 04:39:35PM +, David Laight wrote: > From: Alexey Dobriyan > > Sent: 18 June 2020 14:17 > ... > > > > diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c > > > > index fff28c6f73a2..b0dfac3d3df7 100644 >

Re: [PATCH] x86/asm/64: Align start of __clear_user() loop to 16-bytes

2020-06-18 Thread Alexey Dobriyan
On Thu, Jun 18, 2020 at 10:48:05AM +, David Laight wrote: > From: Matt Fleming > > Sent: 18 June 2020 11:20 > > x86 CPUs can suffer severe performance drops if a tight loop, such as > > the ones in __clear_user(), straddles a 16-byte instruction fetch > > window, or worse, a 64-byte cacheline.

Re: [PATCH] mm, slab: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.

2020-06-17 Thread Alexey Dobriyan
> static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags) > { > - return kmem_cache_alloc(k, flags | __GFP_ZERO); > + return kmem_cache_zalloc(k, flags); > } That's a good one.

Re: [PATCH] proc/base: Skip assignment to len when there is no error on d_path in do_proc_readlink.

2020-05-27 Thread Alexey Dobriyan
On Wed, May 27, 2020 at 09:41:53AM -0500, Eric W. Biederman wrote: > Kaitao Cheng writes: > > > we don't need {len = PTR_ERR(pathname)} when IS_ERR(pathname) is false, > > it's better to move it into if(IS_ERR(pathname)){}. > > Please look at the generated code. > > I believe you will find

Re: [PATCH] proc: fix inode uid/gid writeback race

2019-10-21 Thread Alexey Dobriyan
On Mon, Oct 21, 2019 at 11:24:27AM +0200, Marco Elver wrote: > On Sun, 20 Oct 2019 at 19:30, Alexey Dobriyan wrote: > > > > (euid, egid) pair is snapshotted correctly from task under RCU, > > but writeback to inode can be done in any order. > > > > Fix by doing wr

Re: [BUGFIX PATCH v2 1/5] selftests: proc: Make va_max 1GB on 32bit arch

2019-10-21 Thread Alexey Dobriyan
On Mon, Oct 21, 2019 at 05:28:09PM +0900, Masami Hiramatsu wrote: > Currently proc-self-map-files-002.c sets va_max (max test address > of user virtual address) to 4GB, but it is too big for 32bit > arch and 1UL << 32 is overflow on 32bit long. > > Make va_max 1GB on 32bit arch like i386 and arm.

Re: [PATCH] fs: proc: Clarify warnings for invalid proc dir names

2019-10-21 Thread Alexey Dobriyan
On Sun, Oct 20, 2019 at 06:17:42PM -0400, Joel Savitz wrote: > When one attempts to create a directory in /proc with an invalid name, > such as one in a subdirectory that doesn't exist, one with a name beyond > 256 characters, or a reserved name such as '.' or '..', the kernel > throws a warning

[PATCH] proc: fix inode uid/gid writeback race

2019-10-20 Thread Alexey Dobriyan
df8...@syzkaller.appspotmail.com Signed-off-by: Alexey Dobriyan --- fs/proc/base.c | 25 +++-- fs/proc/fd.c |2 +- fs/proc/internal.h |2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1743,6 +1743,25 @@ void task_dump_owner(str

[PATCH] tags: fix "config ..." false positives

2019-10-20 Thread Alexey Dobriyan
option determines the parameter's default value.$/;" r Signed-off-by: Alexey Dobriyan --- scripts/tags.sh |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -213,8 +213,8 @@ regex_c=( '/\<\(DEFINE\|DECLARE\)_STA

  1   2   3   4   5   6   7   8   9   10   >