Re: [PATCH v2] HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges

2018-11-19 Thread David Herrmann
Hey On Mon, Nov 19, 2018 at 1:52 PM Jiri Kosina wrote: > > > [ David added to CC ] > > On Wed, 14 Nov 2018, Eric Biggers wrote: > > > From: Eric Biggers > > > > When a UHID_CREATE command is written to the uhid char device, a > > copy_from_user() is done from a user pointer embedded in the comma

Re: [PATCH v2] HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges

2018-11-15 Thread David Herrmann
or via > kernel_write(). > +*/ > + if (file->f_cred != current_cred() || uaccess_kernel()) { I think `uaccess_kernel()` would be enough. UHID does not check any credentials. If you believe this should be there nevertheless,

Re: [PATCH v2] HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges

2018-11-15 Thread David Herrmann
Hey On Thu, Nov 15, 2018 at 9:14 AM Benjamin Tissoires wrote: > > On Thu, Nov 15, 2018 at 12:20 AM Dmitry Torokhov wrote: > > > I think it's best not to make > > > assumptions about how the interface will be used and to be consistent > > > with how > > > other ->write() methods in the kernel ha

Re: [PATCH] Revert "HID: uhid: use strlcpy() instead of strncpy()"

2018-11-15 Thread David Herrmann
Hi On Thu, Nov 15, 2018 at 12:09 AM Kees Cook wrote: > On Wed, Nov 14, 2018 at 9:40 AM, Laura Abbott wrote: [...] > > Can we switch to strscpy instead? This will quiet gcc and avoid the > > issues with strlcpy. > > Yes please: it looks like these strings are expected to be NUL > terminated, so s

[PATCH] Revert "HID: uhid: use strlcpy() instead of strncpy()"

2018-11-14 Thread David Herrmann
is always zero-terminated this way. This is the third time someone tried to replace strncpy with strlcpy in this function, and gets it wrong. I now added a comment that should at least make people reconsider. Signed-off-by: David Herrmann --- drivers/hid/uhid.c | 13 +++-- 1 file

[PATCH] HID: uhid: prevent splice(2)

2018-11-14 Thread David Herrmann
. Reported-by: syzbot+72473edc9bf4eb1c6...@syzkaller.appspotmail.com Signed-off-by: David Herrmann --- drivers/hid/uhid.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 3c5507313606..fefedc0b4dc6 100644 --- a/drivers/hid/uhid.c +++ b/drivers

Re: BUG: GPF in non-whitelisted uaccess (non-canonical address?)

2018-11-14 Thread David Herrmann
Hey On Wed, Nov 14, 2018 at 1:25 AM syzbot wrote: > syzbot has found a reproducer for the following crash on: > > HEAD commit:ccda4af0f4b9 Linux 4.20-rc2 > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=13b4e77b40 > kernel config: https://syzkaller.a

Re: [PATCH] HID: uhid: fix a missing-check bug

2018-05-06 Thread David Herrmann
Hey On Sat, May 5, 2018 at 6:17 AM, Wenwen Wang wrote: > In uhid_event_from_user(), if it is in_compat_syscall(), the 'type' of the > event is first fetched from the 'buffer' in userspace and checked. If the > 'type' is UHID_CREATE, it is a messed up request with compat pointer, which > could be

[PATCH v2 0/4] Introduce LSM-hook for socketpair(2)

2018-05-04 Thread David Herrmann
://www.spinics.net/lists/selinux/msg22674.html David Herrmann (3): security: add hook for socketpair() net: hook socketpair() into LSM selinux: provide socketpair callback Tom Gundersen (1): smack: provide socketpair callback include/linux/lsm_hooks.h | 7 +++ include/linux

[PATCH v2 3/4] selinux: provide socketpair callback

2018-05-04 Thread David Herrmann
Make sure to implement the new socketpair callback so the SO_PEERSEC call on socketpair(2)s will return correct information. Acked-by: Serge Hallyn Acked-by: Stephen Smalley Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- security/selinux/hooks.c | 13 + 1 file

[PATCH v2 4/4] smack: provide socketpair callback

2018-05-04 Thread David Herrmann
From: Tom Gundersen Make sure to implement the new socketpair callback so the SO_PEERSEC call on socketpair(2)s will return correct information. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- security/smack/smack_lsm.c | 22 ++ 1 file changed, 22

[PATCH v2 1/4] security: add hook for socketpair()

2018-05-04 Thread David Herrmann
igned-off-by: David Herrmann --- include/linux/lsm_hooks.h | 7 +++ include/linux/security.h | 7 +++ security/security.c | 6 ++ 3 files changed, 20 insertions(+) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index 9d0b286f3dba..8f1131c8dd54 100644 --- a/in

[PATCH v2 2/4] net: hook socketpair() into LSM

2018-05-04 Thread David Herrmann
Use the newly created LSM-hook for socketpair(). The default hook return-value is 0, so behavior stays the same unless LSMs start using this hook. Acked-by: Serge Hallyn Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- net/socket.c | 7 +++ 1 file changed, 7 insertions

Re: [PATCH 0/3] Introduce LSM-hook for socketpair(2)

2018-05-04 Thread David Herrmann
Hey On Wed, Apr 25, 2018 at 9:02 PM, James Morris wrote: > On Wed, 25 Apr 2018, Paul Moore wrote: > >> On Wed, Apr 25, 2018 at 2:44 PM, James Morris wrote: >> > On Mon, 23 Apr 2018, David Herrmann wrote: >> >> This patch series tries to close this gap and makes

[PATCH 1/3] security: add hook for socketpair(AF_UNIX, ...)

2018-04-23 Thread David Herrmann
is is unexpected and makes socketpair() less useful in situations where the security context is crucial to the application. With the new socketpair-hook this disparity can be solved by making socketpair() return the expected security context. Signed-off-by: David Herrmann --- include/linux/lsm_ho

[PATCH 2/3] net/unix: hook unix_socketpair() into LSM

2018-04-23 Thread David Herrmann
Use the newly created LSM-hook for unix_socketpair(). The default hook return-value is 0, so behavior stays the same unless LSMs start using this hook. Signed-off-by: David Herrmann --- net/unix/af_unix.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/unix/af_unix.c b/net/unix

[PATCH 3/3] selinux: provide unix_stream_socketpair callback

2018-04-23 Thread David Herrmann
Make sure to implement the new unix_stream_socketpair callback so the SO_PEERSEC call on socketpair(2)s will return correct information. Signed-off-by: David Herrmann --- security/selinux/hooks.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/security/selinux/hooks.c b

[PATCH 0/3] Introduce LSM-hook for socketpair(2)

2018-04-23 Thread David Herrmann
/master/src/util/test-peersec.c [2] https://www.spinics.net/lists/selinux/msg22674.html David Herrmann (3): security: add hook for socketpair(AF_UNIX, ...) net/unix: hook unix_socketpair() into LSM selinux: provide unix_stream_socketpair callback include/linux/lsm_hooks.h | 8

Re: [RFC/RFT patch 0/7] timekeeping: Unify clock MONOTONIC and clock BOOTTIME

2018-04-19 Thread David Herrmann
Hi On Fri, Apr 20, 2018 at 7:44 AM, Sergey Senozhatsky wrote: > On (04/20/18 06:37), David Herrmann wrote: >> >> I get lots of timer-errors on Arch-Linux booting current master, after >> a suspend/resume cycle. Just a selection of errors I see on resume: > > Hello

Re: [RFC/RFT patch 0/7] timekeeping: Unify clock MONOTONIC and clock BOOTTIME

2018-04-19 Thread David Herrmann
Hey On Tue, Mar 13, 2018 at 7:11 PM, John Stultz wrote: > On Mon, Mar 12, 2018 at 11:36 PM, Ingo Molnar wrote: >> Ok, I have edited all the changelogs accordingly (and also flipped around the >> 'clock MONOTONIC' language to the more readable 'the MONOTONIC clock' >> variant), >> the resulting

Re: [PATCH] platform/x86: thinkpad_acpi: suppress warning about palm detection

2018-01-12 Thread David Herrmann
Hi Andy On Fri, Jan 12, 2018 at 2:50 PM, Andy Shevchenko wrote: > On Fri, Jan 12, 2018 at 1:04 PM, David Herrmann wrote: >> This patch prevents the thinkpad_acpi driver from warning about 2 event >> codes returned for keyboard palm-detection. No behavioral changes, >> other

[PATCH] platform/x86: thinkpad_acpi: suppress warning about palm detection

2018-01-12 Thread David Herrmann
underneath the arrow key. Cc: Matthew Thode Signed-off-by: David Herrmann --- drivers/platform/x86/thinkpad_acpi.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 117be48ff4de..128f91af716e 100644

Re: [PATCH 4/6] hugetlbfs: implement memfd sealing

2017-11-05 Thread David Herrmann
Hi On Sat, Nov 4, 2017 at 12:31 AM, Mike Kravetz wrote: > On 11/03/2017 10:56 AM, Mike Kravetz wrote: >> On 11/03/2017 10:41 AM, David Herrmann wrote: >>> Hi >>> >>> On Fri, Nov 3, 2017 at 6:12 PM, Mike Kravetz >>> wrote: >>>&g

Re: [PATCH 4/6] hugetlbfs: implement memfd sealing

2017-11-03 Thread David Herrmann
Hi On Fri, Nov 3, 2017 at 6:12 PM, Mike Kravetz wrote: > On 11/03/2017 10:03 AM, David Herrmann wrote: >> Hi >> >> On Tue, Oct 31, 2017 at 7:40 PM, Marc-André Lureau >> wrote: >>> Implements memfd sealing, similar to shmem: >>> - WRITE: deny fal

Re: [PATCH 4/6] hugetlbfs: implement memfd sealing

2017-11-03 Thread David Herrmann
Hi On Tue, Oct 31, 2017 at 7:40 PM, Marc-André Lureau wrote: > Implements memfd sealing, similar to shmem: > - WRITE: deny fallocate(PUNCH_HOLE). mmap() write is denied in > memfd_add_seals(). write() doesn't exist for hugetlbfs. > - SHRINK: added similar check as shmem_setattr() > - GROW: adde

Re: [PATCH 1/2] shmem: drop lru_add_drain_all from shmem_wait_for_pins

2017-11-03 Thread David Herrmann
ke a wrong thing to do because it basically induces >> > unpredictable latency to the call because draining is not for free >> > (especially on larger machines with many cpus). >> > >> > Let's simply drop the call to lru_add_drain_all to address both issues. >> >

Re: [PATCH] hid/uhid: fix a double-fetch bug when copying event from user

2017-09-22 Thread David Herrmann
Hey On Wed, Sep 20, 2017 at 12:12 AM, Dmitry Torokhov wrote: > On Tue, Sep 19, 2017 at 2:54 PM, Meng Xu wrote: >> >> >> On 09/19/2017 05:31 PM, Dmitry Torokhov wrote: >>> >>> On Mon, Sep 18, 2017 at 10:21 PM, Meng Xu wrote: When in_compat_syscall(), a user could make type != UHID_CREA

[PATCH] net/unix: drop obsolete fd-recursion limits

2017-07-17 Thread David Herrmann
with ETOOMANYREFS if a client maliciously modifies the FD while inflight. Cc: Alban Crequy Cc: Simon McVittie Signed-off-by: David Herrmann --- include/net/af_unix.h | 1 - net/unix/af_unix.c| 24 +--- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/inc

Re: [PATCH v2] HID: Replace semaphore driver_lock with mutex

2017-06-19 Thread David Herrmann
Hi On Wed, Jun 14, 2017 at 1:58 PM, Arnd Bergmann wrote: > Does that mean that we can have a concurrent hid_device_remove() > and hid_device_probe() on the same device, using different > drivers and actually still need the driver_lock for that? I would assume > that the driver core handles that p

Re: [PATCH v2] HID: Replace semaphore driver_lock with mutex

2017-06-14 Thread David Herrmann
Hey On Wed, Jun 14, 2017 at 9:20 AM, Arnd Bergmann wrote: > On Wed, Jun 14, 2017 at 7:22 AM, Binoy Jayan wrote: >> Hi, >> >> On 14 June 2017 at 01:55, Arnd Bergmann wrote: >> The mutex code clearly states mutex_trylock() must not be used in interrupt context (see kernel/locking/mutex.

Re: [PATCH v2] HID: Replace semaphore driver_lock with mutex

2017-06-13 Thread David Herrmann
> separate patch, of course). The mutex code clearly states mutex_trylock() must not be used in interrupt context (see kernel/locking/mutex.c), hence we used a semaphore here. Unless the mutex code is changed to allow this, we cannot switch away from semaphores. Otherwise, this patch (given Ben

Re: [PATCH v7] Input: psxpad-spi - Add PlayStation 1/2 joypads via SPI interface Driver

2017-05-03 Thread David Herrmann
id, I think this driver now matches the gamepad spec that > we have in Drivers/input/gamepad.rst. Could you give it an one-over, as > far as mappings go, otherwise I think it can be applied and merged with > my 2nd pull request. Looks good to me: Acked-by: David Herrmann The FF code could

Re: Re: [PATCH] Input: evdev: fix queueing of SYN_DROPPED event for EVIOCG[type] IOCTL case

2017-02-23 Thread David Herrmann
Hi On Tue, Jan 31, 2017 at 5:09 PM, Aniroop Mathur wrote: > On Sun, Jan 22, 2017 at 6:45 PM, David Herrmann wrote: >> On Thu, Nov 24, 2016 at 9:11 PM, Aniroop Mathur wrote: >>> continue; >>> } else if (head != i) { >>

Re: [PATCH] Input: evdev: fix queueing of SYN_DROPPED event for EVIOCG[type] IOCTL case

2017-01-22 Thread David Herrmann
Hi On Thu, Nov 24, 2016 at 9:11 PM, Aniroop Mathur wrote: > Currently, when EVIOCG[type] ioctl call is issued and bits_to_user fails, > then SYN_DROPPED event is inserted in the event queue always. > > However, it is not compulsory that some events are flushed out on every > EVIOCG[type] ioctl ca

Re: [RFC PATCH] input: Add disable sysfs entry for every input device

2017-01-02 Thread David Herrmann
Hi On Sun, Dec 25, 2016 at 11:04 AM, Pali Rohár wrote: > This patch allows user to disable events from any input device so events > would not be delivered to userspace. > > Currently there is no way to disable particular input device by kernel. > User for different reasons would need it for integ

Re: [PATCH] drm: add fourcc codes for 16bit R and GR

2017-01-02 Thread David Herrmann
Hi On Mon, Jan 2, 2017 at 11:41 AM, Rainer Hochecker wrote: > From: Rainer Hochecker > > Add fourcc codes for 16bit planes. Required by mesa for > eglCreateImageKHR to access P010 surfaces created by vaapi. > > Signed-off-by: Rainer Hochecker > --- > include/uapi/drm/drm_fourcc.h | 6 ++ >

Re: [RFC PATCH 0/3] staging: remove fbdev drivers

2016-12-09 Thread David Herrmann
Hey On Fri, Dec 9, 2016 at 2:33 PM, Daniel Vetter wrote: >> > So it is possible, only reason vram dumb buffers look worse is that there's >> > only 3 and no one cares about them, vs about 20 and a very active community >> > of contributors (also for core drm improvements) for the other case. >> >

Re: drm: GPF in drm_getcap

2016-11-26 Thread David Herrmann
Hi On Sat, Nov 26, 2016 at 7:07 PM, Dmitry Vyukov wrote: > grep "card0" dmesg: > [5.298617] device: 'card0': device_add > [5.298946] PM: Adding info for No Bus:card0 > [6.436178] device: 'card0': device_add > [6.436488] PM: Adding info for No Bus:card0 > > > # ls -l /dev/dri/card0

Re: drm: GPF in drm_getcap

2016-11-26 Thread David Herrmann
Hi On Sat, Nov 26, 2016 at 6:50 PM, Dmitry Vyukov wrote: > On Sat, Nov 26, 2016 at 6:35 PM, David Herrmann wrote: >> Hi >> >> On Sat, Nov 26, 2016 at 6:17 PM, Dmitry Vyukov wrote: >>> On Fri, Sep 9, 2016 at 1:56 PM, Dmitry Vyukov wrote: >>>> Hello, &g

Re: drm: GPF in drm_getcap

2016-11-26 Thread David Herrmann
Hi On Sat, Nov 26, 2016 at 6:17 PM, Dmitry Vyukov wrote: > On Fri, Sep 9, 2016 at 1:56 PM, Dmitry Vyukov wrote: >> Hello, >> >> The following program triggers GPF in drm_getcap: >> >> // autogenerated by syzkaller (http://github.com/google/syzkaller) >> #include >> #include >> #include >> #in

[tip:x86/urgent] x86/sysfb: Fix lfb_size calculation

2016-11-16 Thread tip-bot for David Herrmann
Commit-ID: f96acec8c8020807429d21324547f4b904c37177 Gitweb: http://git.kernel.org/tip/f96acec8c8020807429d21324547f4b904c37177 Author: David Herrmann AuthorDate: Tue, 15 Nov 2016 13:01:58 +0100 Committer: Ingo Molnar CommitDate: Wed, 16 Nov 2016 09:38:23 +0100 x86/sysfb: Fix lfb_size

[tip:x86/urgent] x86/sysfb: Add support for 64bit EFI lfb_base

2016-11-16 Thread tip-bot for David Herrmann
Commit-ID: 9164b4ceb7b492a77c7fe770a4b9d1375c9cd45a Gitweb: http://git.kernel.org/tip/9164b4ceb7b492a77c7fe770a4b9d1375c9cd45a Author: David Herrmann AuthorDate: Tue, 15 Nov 2016 13:01:57 +0100 Committer: Ingo Molnar CommitDate: Wed, 16 Nov 2016 09:38:22 +0100 x86/sysfb: Add support

[PATCH 1/2] x86/sysfb: add support for 64bit EFI lfb_base

2016-11-15 Thread David Herrmann
the address is not 0 (i.e., unset), as well as does not overflow the physical address type. Signed-off-by: David Herrmann --- arch/x86/kernel/sysfb_simplefb.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/ker

[PATCH 2/2] x86/sysfb: fix lfb_size calculation

2016-11-15 Thread David Herrmann
. While at it, avoid variable abbreviations and rename 'len' to 'length', and use the correct types matching the screen_info definition. Signed-off-by: David Herrmann --- arch/x86/kernel/sysfb_simplefb.c | 25 + 1 file changed, 17 insertions(+), 8 deleti

[PATCH 0/2] x86 Simplefb Fixes

2016-11-15 Thread David Herrmann
ormal distribution. However, SimpleDRM is close to being merged, so x86-sysfb might get into some distros. Thanks David David Herrmann (2): x86/sysfb: add support for 64bit EFI lfb_base x86/sysfb: fix lfb_size calculation arch/x86/kernel/sysfb_simplefb.c | 39 +++--

Re: [RFC v1 00/14] Bus1 Kernel Message Bus

2016-11-02 Thread David Herrmann
Hi On Thu, Oct 27, 2016 at 2:45 AM, Kirill A. Shutemov wrote: > On Wed, Oct 26, 2016 at 10:34:30PM +0200, David Herrmann wrote: >> Long story short: We have uid<->uid quotas so far, which prevent DoS >> attacks, unless you get access to a ridiculous amount of local UIDs

Re: [RFC v1 04/14] bus1: util - fixed list utility library

2016-10-27 Thread David Herrmann
Hi On Thu, Oct 27, 2016 at 2:37 PM, Peter Zijlstra wrote: > On Wed, Oct 26, 2016 at 09:18:00PM +0200, David Herrmann wrote: >> + e = kmalloc_array(sizeof(*e), BUS1_FLIST_BATCH + 1, gfp); > >> +#define BUS1_FLIST_BATCH (1024) > >> +struct

Re: [RFC v1 04/14] bus1: util - fixed list utility library

2016-10-27 Thread David Herrmann
Hi On Thu, Oct 27, 2016 at 2:56 PM, Arnd Bergmann wrote: > On Thursday, October 27, 2016 2:48:46 PM CEST David Herrmann wrote: >> On Thu, Oct 27, 2016 at 2:37 PM, Peter Zijlstra wrote: >> > On Wed, Oct 26, 2016 at 09:18:00PM +0200, David Herrmann wrote: >> >> +

Re: [RFC v1 00/14] Bus1 Kernel Message Bus

2016-10-26 Thread David Herrmann
Hi On Wed, Oct 26, 2016 at 9:39 PM, Linus Torvalds wrote: > So the thing that tends to worry me about these is resource management. > > If I understood the documentation correctly, this has per-user > resource management, which guarantees that at least the system won't > run out of memory. Good.

[RFC v1 02/14] bus1: provide stub cdev /dev/bus1

2016-10-26 Thread David Herrmann
Signed-off-by: David Herrmann --- include/uapi/linux/bus1.h | 138 ++ init/Kconfig | 17 ++ ipc/Makefile | 1 + ipc/bus1/Makefile | 6 ++ ipc/bus1/main.c | 80 +++ ipc/bus1

[RFC v1 03/14] bus1: util - active reference utility library

2016-10-26 Thread David Herrmann
they have much more strict state-transitions. Prior art can be seen in super-blocks ('atomic_t s_active'), and kernfs ('atomic_t active'). Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- ipc/bus1/Makefile | 3 +- ipc

[RFC v1 08/14] bus1: implement peer management context

2016-10-26 Thread David Herrmann
impression of atomic operations (i.e., making the API appear consistent and coherent). This only adds the peer context, the ioctls will be implemented in follow-up patches. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- ipc/bus1/Makefile | 2 + ipc/bus1/main.c | 17

[RFC v1 09/14] bus1: provide transaction context for multicasts

2016-10-26 Thread David Herrmann
Signed-off-by: David Herrmann --- ipc/bus1/Makefile | 1 + ipc/bus1/peer.c | 2 + ipc/bus1/peer.h | 3 + ipc/bus1/tx.c | 360 ++ ipc/bus1/tx.h | 102 5 files changed, 468 insertions(+) create mode 100644 ipc

[RFC v1 05/14] bus1: util - pool utility library

2016-10-26 Thread David Herrmann
data transfers, directly from the sender's address space into the pool of the destination peer. The allocation algorithm is based on the Android Binder code and has served their needs well for many years now. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- ipc/bus1/Mak

[RFC v1 13/14] bus1: limit and protect resources

2016-10-26 Thread David Herrmann
: David Herrmann --- ipc/bus1/message.c | 47 +- ipc/bus1/peer.c | 95 ++- ipc/bus1/peer.h | 2 + ipc/bus1/security.h | 45 + ipc/bus1/user.c | 475 ipc/bus1/user.h | 75 - 6 files changed, 728

[RFC v1 07/14] bus1: tracking user contexts

2016-10-26 Thread David Herrmann
are fairly divided among all communicating peers. This only implements the user tracking, the resource limits will be added in follow-up patches. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- ipc/bus1/Makefile | 1 + ipc/bus1/main.c | 3 ++ ipc/bus1/user

[RFC v1 06/14] bus1: util - queue utility library

2016-10-26 Thread David Herrmann
nd sender), with a cached pointer to the front of the queue. It will be embedded in every peer participating on the bus1 kernel message bus1. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- ipc/bus1/Makefile | 3 +- ipc/bus1/util/queue.c | 445 +

[RFC v1 00/14] Bus1 Kernel Message Bus

2016-10-26 Thread David Herrmann
Hi This proposal introduces bus1.ko, a kernel messaging bus. This is not a request for inclusion, yet. It is rather an initial draft and a Request For Comments. While bus1 emerged out of the kdbus project, bus1 was started from scratch and the concepts have little in common. In a nutshell, bus1 p

[RFC v1 14/14] bus1: basic user-space kselftests

2016-10-26 Thread David Herrmann
From: Tom Gundersen This adds kselftests integration and provides some basic API tests for bus1. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- tools/testing/selftests/bus1/.gitignore | 2 + tools/testing/selftests/bus1/Makefile | 19 ++ tools/testing/selftests/bus1

[RFC v1 10/14] bus1: add handle management

2016-10-26 Thread David Herrmann
at message transactions are asynchronous. That is, there is no unique point in time that a message is synchronized with another message. Hence, whether a specific handle passed with a message is still valid or not, cannot be predicted by the sender, but only by one of the receivers. Signed-off

[RFC v1 11/14] bus1: implement message transmission

2016-10-26 Thread David Herrmann
Gundersen Signed-off-by: David Herrmann --- ipc/bus1/Makefile | 1 + ipc/bus1/message.c | 613 + ipc/bus1/message.h | 171 +++ ipc/bus1/peer.c| 2 + ipc/bus1/peer.h| 2 + ipc/bus1/util.c| 162 ++ ipc

[RFC v1 01/14] bus1: add bus1(7) man-page

2016-10-26 Thread David Herrmann
how they work. Build the bus1-documentation via: $ make -C Documentation/bus1/ mandocs $ make -C Documentation/bus1/ htmldocs Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- Documentation/bus1/.gitignore | 2 + Documentation/bus1/Makefile | 41

[RFC v1 12/14] bus1: hook up file-operations

2016-10-26 Thread David Herrmann
From: Tom Gundersen This hooks up all the file-operations on a bus1-file-descriptor. It implements the ioctls as defined in the UAPI, as well as mmap() and poll() support. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- ipc/bus1/main.c | 46 +++ ipc/bus1/peer.c | 934

[RFC v1 04/14] bus1: util - fixed list utility library

2016-10-26 Thread David Herrmann
be required by the upcoming bus1 message-transactions. They must support large auxiliary data transfers, in case users want to send their entire handle state via the bus. Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann --- ipc/bus1/Makefile | 3 +- ipc/bus1/uti

Re: drm: NULL pointer dereference in drm_mode_object_find()

2016-09-21 Thread David Herrmann
Hi On Fri, Aug 19, 2016 at 7:10 PM, Alexander Potapenko wrote: > Hello, > > the program below triggers a NULL deref in DRM code when ran on QEMU: > > === > BUG: unable to handle kernel NULL pointer dereference at (null) > IP: [< inline

Re: drm: NULL pointer dereference in drm_mode_object_find()

2016-09-21 Thread David Herrmann
Hi On Tue, Sep 20, 2016 at 11:25 AM, Alexander Potapenko wrote: > On Tue, Sep 20, 2016 at 11:21 AM, David Herrmann > wrote: >> Hi >> >> On Mon, Sep 5, 2016 at 10:30 AM, Dmitry Vyukov wrote: >>> On Fri, Aug 19, 2016 at 7:10 PM, Alexander Potapenko >>>

Re: drm: NULL pointer dereference in drm_mode_object_find()

2016-09-20 Thread David Herrmann
Hi On Mon, Sep 5, 2016 at 10:30 AM, Dmitry Vyukov wrote: > On Fri, Aug 19, 2016 at 7:10 PM, Alexander Potapenko > wrote: >> Hello, >> >> the program below triggers a NULL deref in DRM code when ran on QEMU: >> >> === >> BUG: unable to handle kerne

Re: drm: WARNING in ioremap_wc

2016-09-02 Thread David Herrmann
Hey On Fri, Sep 2, 2016 at 2:23 PM, Dmitry Vyukov wrote: > On Mon, Aug 29, 2016 at 8:05 AM, Daniel Vetter wrote: >> On Sun, Aug 28, 2016 at 07:36:59PM +0200, Dmitry Vyukov wrote: >>> Hello, >>> >>> The following program triggers WARNING in ioremap_wc: >> >> Yup, that should also be fixed in linu

Re: [PATCH v4 3/5] drm: add SimpleDRM driver

2016-09-01 Thread David Herrmann
. > diff --git a/drivers/gpu/drm/simpledrm/Makefile > b/drivers/gpu/drm/simpledrm/Makefile > new file mode 100644 > index 000..f6a62dc > --- /dev/null > +++ b/drivers/gpu/drm/simpledrm/Makefile > @@ -0,0 +1,4 @@ > +simpledrm-y := simpledrm_drv.o simpledrm_kms.o simpledr

Re: [PATCH 0/2] drm: add SimpleDRM driver

2016-08-04 Thread David Herrmann
Hi On Thu, Aug 4, 2016 at 5:34 PM, Luc Verhaegen wrote: > Do we really want to recreate a 400+ email thread again, or are we > capable of learning from the past? No we don't. And no-one intends to. I am fully aware of the discussion that introduced the clock-dependencies to simplefb, and I gladl

Re: [PATCH 1/3 v4] drm: Introduce drm_connector_register_all() helper

2016-03-29 Thread David Herrmann
ting > driver-specific implementations with the generic one. > > Signed-off-by: Alexey Brodkin > Cc: Daniel Vetter > Cc: David Airlie > Cc: David Herrmann > --- > > Changes v3 -> v4: > * In drm_connector_register_all() fail path which calls unregister_all() >

Re: [PATCH 2/4 v3] drm: Introduce drm_connector_register_all() helper

2016-03-23 Thread David Herrmann
Hi On Wed, Mar 23, 2016 at 9:42 AM, Alexey Brodkin wrote: > As a pair to already existing drm_connector_unregister_all() we're adding > generic implementation of what is already done in some drivers. > > Once this helper is implemented we'll be ready to switch existing > driver-specific implement

Re: [PATCH v2 3/9] efi/x86: efifb: move DMI based quirks handling out of generic code

2016-03-21 Thread David Herrmann
Hi On Fri, Mar 18, 2016 at 5:47 PM, Ard Biesheuvel wrote: > The efifb quirks handling based on DMI identification of the platform is > specific to x86, so move it to x86 arch code. > > Signed-off-by: Ard Biesheuvel Fine with me: Acked-by: David Herrmann Thanks David >

Re: [PATCH v2 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device

2016-03-21 Thread David Herrmann
Hi On Fri, Mar 18, 2016 at 5:47 PM, Ard Biesheuvel wrote: > This adds code to the ARM and arm64 EFI init routines to expose a platform > device of type 'efi-framebuffer' if struct screen_info has been populated > appropriately from the GOP protocol by the stub. Since the framebuffer may > potenti

Re: [PATCH] HID: wiimote: Fix wiimote mp scale linearization

2016-03-19 Thread David Herrmann
t; if (!(ext[3] & 0x01)) > - z *= 18; > + z = (z * 2000 * 9) / 440; So 2000/440 ~= 4.5, so this is exactly what the initial comment said. Patch looks good to me: Reviewed-by: David Herrmann Thanks David > else > z *= 9; > > -- > 2.1.4 >

Re: [PATCH, RESEND] drm: avoid uninitialized timestamp use in wait_vblank

2016-02-26 Thread David Herrmann
++ b/drivers/gpu/drm/drm_irq.c > @@ -997,8 +997,10 @@ u32 drm_vblank_count_and_time(struct drm_device *dev, > unsigned int pipe, > int count = DRM_TIMESTAMP_MAXRETRIES; > u32 cur_vblank; > > - if (WARN_ON(pipe >= dev->num_crtcs)) > + if (WARN_ON(pip

Re: [PATCH v2] unix: properly account for FDs passed over unix sockets

2016-02-03 Thread David Herrmann
Hi On Wed, Feb 3, 2016 at 12:36 PM, Simon McVittie wrote: > Am I right in saying that the advice I give to D-Bus users should be > something like this? > > * system services should not send fds at all, unless they trust the > dbus-daemon > * system services should not send fds via D-Bus that wi

Re: [PATCH v2] unix: properly account for FDs passed over unix sockets

2016-02-02 Thread David Herrmann
Hi On Sun, Jan 10, 2016 at 7:54 AM, Willy Tarreau wrote: > It is possible for a process to allocate and accumulate far more FDs than > the process' limit by sending them over a unix socket then closing them > to keep the process' fd count low. > > This change addresses this problem by keeping tra

Re: [PATCH 1/2] ntp: Fix ADJ_SETOFFSET being used w/ ADJ_NANO

2016-01-22 Thread David Herrmann
> Cc: Sasha Levin > Cc: Richard Cochran > Cc: Thomas Gleixner > Cc: Prarit Bhargava > Cc: Harald Hoyer > Cc: Kay Sievers > Cc: David Herrmann > Reported-by: Harald Hoyer > Reported-by: Kay Sievers > Signed-off-by: John Stultz Thanks for picking this up. Lo

Re: [PATCH] vgaarb: fix signal handling in vga_get()

2015-12-14 Thread David Herrmann
Hi On Mon, Dec 14, 2015 at 9:19 AM, Kirill A. Shutemov wrote: > On Thu, Dec 10, 2015 at 11:28:58AM +0100, David Herrmann wrote: >> Hi >> >> On Mon, Nov 30, 2015 at 3:17 AM, Kirill A. Shutemov >> wrote: >> > There are few defects in vga_get() related to signal

Re: [PATCH] vgaarb: fix signal handling in vga_get()

2015-12-10 Thread David Herrmann
TASK_INTERRUPTIBLE : > TASK_UNINTERRUPTIBLE); > - if (signal_pending(current)) { > - rc = -EINTR; > + if (interruptible && signal_pending(current)) { > +

Re: kdbus refactoring?

2015-11-09 Thread David Herrmann
Hi On Mon, Nov 9, 2015 at 10:14 AM, Peter Zijlstra wrote: > On Mon, Nov 09, 2015 at 09:56:04AM +0100, David Herrmann wrote: > >> The submission and following year of development followed the 'kernel >> way'. > > This is not true; the last complete posting I c

Re: kdbus refactoring?

2015-11-09 Thread David Herrmann
Hi On Mon, Nov 9, 2015 at 9:48 AM, Peter Zijlstra wrote: > On Mon, Nov 09, 2015 at 09:34:37AM +0100, David Herrmann wrote: >> Hi >> >> On Mon, Nov 9, 2015 at 1:53 AM, Josh Triplett wrote: >> > Quoting Documentation/development-process/1.Intro: >> [...] >&

Re: kdbus refactoring?

2015-11-09 Thread David Herrmann
Hi On Mon, Nov 9, 2015 at 1:53 AM, Josh Triplett wrote: > Quoting Documentation/development-process/1.Intro: [...] >> Years of experience with the kernel development community have taught a >> clear lesson: kernel code which is designed and developed behind closed >> doors invariably has problems

Re: [PATCH] thinkpad_acpi: don't yell on unsupported brightness interfaces

2015-11-06 Thread David Herrmann
Hi Darren! On Wed, Oct 21, 2015 at 4:44 PM, Darren Hart wrote: > On Wed, Oct 21, 2015 at 12:33:52PM -0200, Henrique de Moraes Holschuh wrote: >> On Wed, Oct 21, 2015, at 08:46, David Herrmann wrote: >> > The thinkpad_acpi driver currently emits error messages on unsupport

Re: [PATCH v3] Input: uinput - add new UINPUT_DEV_SETUP and UI_ABS_SETUP ioctl

2015-10-25 Thread David Herrmann
axes and bits and then validate everything. Indeed, we now force the order to be abs-setup first, then device-setup as last step. Appended is a follow-up patch to cleanup ABS handling in uinput. It is untested. Benjamin, care to give it a spin? Thanks David >From 2568f83bcc5c4b8aeb14

[PATCH] thinkpad_acpi: don't yell on unsupported brightness interfaces

2015-10-21 Thread David Herrmann
are supported by the i915 driver just fine. Downgrade the error message to a normal pr_info() and stop telling people to report it to IBM. Signed-off-by: David Herrmann --- drivers/platform/x86/thinkpad_acpi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/platform

Re: [PATCH v7] Input: Add userio module

2015-10-08 Thread David Herrmann
questing > a recording from the user experiencing the issue without having to have > the physical hardware in front of them. > > Signed-off-by: Stephen Chandler Paul Apart from the serio-unregistration, all I have left is bike-shedding. Regardless of those changes, this is: Reviewed-

Re: [PATCH 00/44] kdbus cleanups

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > Hi all, > > This is a set of various kdbus code cleanups. Patches are ordered by > increasing complexity, starting with docs and comments fixes and > one-liners. > > Patch 29 is the revised version of > http://lkml.kernel.org/g/143549

Re: [PATCH 43/44] kdbus: Give up on failed fd allocation

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev wrote: > If we failed to allocate a file descriptor, do not try to do it again on > the next iteration. There are few chances that we will have success, and > we can simplify the algorithm assuming that valid fd numbers are not > mixed with -1

Re: [PATCH 38/44] kdbus: Fix error path in kdbus_user_lookup()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev wrote: > If idr_alloc() fails, we shouldn't call idr_remove() as latter produces > warning when called on non-allocated ids. Split cleanup code into three > parts for differrent cleanup scenarios before and after idr_alloc(). > > Signed-off-by

Re: [PATCH 31/44] kdbus: Cleanup kdbus_conn_move_messages()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev wrote: > - Move `r' and `ret' to scopes where they are used. Drop redundant >initialization of `ret'. > > - Initialize `bus' on declaration. > > - Replace list_for_each_entry_safe() with list_for_each_entry() when >iterating over li

Re: [PATCH 30/44] kdbus: Cleanup kdbus_meta_proc_mask()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > - Simplify if-statements > >'proc < KDBUS_META_PROC_NORMAL' test only makes sense when we call >kdbus_proc_permission(). Include it into 'prv_pid != req_pid' branch, >remove redundant assignment of `proc' var and reduce i

Re: [PATCH 26/44] kdbus: Cleanup kdbus_pin_dst()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > - Reduce scope of `owner' var to the block where it is actually used. >Use conditional operator to set its value. > > - Drop initialization of `dst' as it gets value later. > > - Drop separate exit point as we have only one use

Re: [PATCH 25/44] kdbus: Cleanup kdbus_cmd_conn_info()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > - Move `entry' and `owner' to the scope where they are used. Drop >redundand initialization of `entry'. Use conditional operator to set >the value of `owner'. > > - Set `ret' to zero right after call to kdbus_pool_slice_copy

Re: [PATCH 24/44] kdbus: Cleanup kdbus_conn_unicast()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > Do not initialize `name' and `ret' as values are assigned to them at > the first use by kdbus_pin_dst(). Simplify handling of > kdbus_conn_entry_insert() return value and drop useless goto. > > Signed-off-by: Sergei Zviagintsev > ---

Re: [PATCH 23/44] kdbus: Cleanup kdbus_conn_call()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > Do not initialize `wait' and `name' as values are assigned to them at > first use: `wait' gets its value from kdbus_reply_find(), `name' is set > by kdbus_pin_dst(). > > Remove redundant code. goto isn't required as we reached exit po

Re: [PATCH 21/44] kdbus: Cleanup tests in kdbus_cmd_send()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > Rearrange tests a little to make them look cleaner. What's wrong with 'else if'? Thanks David > Signed-off-by: Sergei Zviagintsev > --- > ipc/kdbus/connection.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) > >

Re: [PATCH 18/44] kdbus: Add var initialization to kdbus_conn_entry_insert()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > Assign zero to `ret' in the beginning of function instead of doing it > in the end. > > Signed-off-by: Sergei Zviagintsev > --- > ipc/kdbus/connection.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/ipc

Re: [PATCH 15/44] kdbus: Simplify bitwise expression in kdbus_meta_get_mask()

2015-10-08 Thread David Herrmann
Hi On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote: > Replace the expression with more concise and readable equivalent. It can > be proven by opening parentheses: > > r & ~((p | i) & r) == r & (~(p | i) | ~r) == > (r & ~(p | i)) | (r & ~r) == r & ~(p | i) == r & ~p & ~i But

  1   2   3   4   5   6   7   8   9   >