[PATCH v2] ipc: Fix ipc data structures inconsistency

2017-12-02 Thread Philippe Mikoyan
, shm_nattch = 1, ...} Signed-off-by: Philippe Mikoyan Reviewed-by: Davidlohr Bueso --- Changes in v2: - Fixed 'operatoins' typo in util.c ipc/msg.c | 20 ++-- ipc/sem.c | 10 ++ ipc/shm.c | 19 ++- ipc/util.c | 5 - 4 files changed, 42

Re: [PATCH 2/2] ipc: Fix ipc data structures inconsistency

2017-12-02 Thread Philippe Mikoyan
On Fri, 1 Dec 2017 09:20:07 -0800 Davidlohr Bueso wrote: > > Hmm yeah that's pretty fishy, also shm_atime = 0, no? > Yeah, definitely, other data structure fields can also be inconsistent, and applying not only to shmem, but also to other ipc mechanisms. Thank you for noting the typo, 'll se

[PATCH 0/2] ipc: Fix ctl(..IPC_STAT..) bugs

2017-11-29 Thread Philippe Mikoyan
before filling data structure fields. Note that lock is taken after permissions and security checks in order to increase performance. 2) By filling certain data structure fields directly in do_shmat in order to fill shm_nattch and other fields atomically. shm_open call is removed from shm_mmap. Philip

[PATCH 2/2] ipc: Fix ipc data structures inconsistency

2017-11-29 Thread Philippe Mikoyan
, shm_nattch = 1, ...} Signed-off-by: Philippe Mikoyan --- ipc/msg.c | 20 ++-- ipc/sem.c | 10 ++ ipc/shm.c | 19 ++- ipc/util.c | 5 - 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/ipc/msg.c b/ipc/msg.c index 06be5a9adfa4..047579b42de4

[PATCH 1/2] ipc/shm: Fix shm_nattch incorrect value

2017-11-29 Thread Philippe Mikoyan
This patch fixes that do_shmat increases shm_nattch value twice. E.g. if memory segment was created just now and process attaches it, shmctl(..IPC_STAT..) of concurrently running process can at some point of time return data structure with 'shm_nattch' equal to 2. Signed-off-by: Philip