, 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
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
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
, 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
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
5 matches
Mail list logo