xpmem: Add xpmem_openat

In arm64, glibc-open of /dev/xpmem is hooked in sys_openat. This
commit adds xpmem_openat which is called by sys_openat.
This commit silently applies copy_from_user fix to sys_open as well.

Change-Id: I3b4f7bf0e152c359250bb2b56910db9192390cb1
Fujitsu: POSTK_DEBUG_ARCH_DEP_46, POSTK_DEBUG_ARCH_DEP_62
This commit is contained in:
Masamichi Takagi
2018-10-26 15:51:53 +09:00
committed by Dominique Martinet
parent e12d5ed341
commit 04c11f35e9
6 changed files with 83 additions and 110 deletions

View File

@ -305,8 +305,8 @@ static int xpmem_pin_page(struct xpmem_thread_group *, struct thread *,
static void xpmem_unpin_pages(struct xpmem_segment *, struct process_vm *,
unsigned long, size_t);
static struct xpmem_thread_group * __xpmem_tg_ref_by_tgid_nolock_internal(
pid_t, int, int);
static struct xpmem_thread_group *__xpmem_tg_ref_by_tgid_nolock_internal(
pid_t tgid, int index, int return_destroying);
static inline struct xpmem_thread_group *__xpmem_tg_ref_by_tgid(
pid_t tgid,
@ -355,16 +355,16 @@ static inline struct xpmem_thread_group *__xpmem_tg_ref_by_tgid_nolock(
#define xpmem_tg_ref_by_tgid_nolock(t) __xpmem_tg_ref_by_tgid_nolock(t, 0)
#define xpmem_tg_ref_by_tgid_all_nolock(t) __xpmem_tg_ref_by_tgid_nolock(t, 1)
static struct xpmem_thread_group * xpmem_tg_ref_by_segid(xpmem_segid_t);
static struct xpmem_thread_group * xpmem_tg_ref_by_apid(xpmem_apid_t);
static void xpmem_tg_deref(struct xpmem_thread_group *);
static struct xpmem_thread_group *xpmem_tg_ref_by_segid(xpmem_segid_t);
static struct xpmem_thread_group *xpmem_tg_ref_by_apid(xpmem_apid_t);
static void xpmem_tg_deref(struct xpmem_thread_group *tg);
static struct xpmem_segment *xpmem_seg_ref_by_segid(struct xpmem_thread_group *,
xpmem_segid_t);
static void xpmem_seg_deref(struct xpmem_segment *);
static void xpmem_seg_deref(struct xpmem_segment *seg);
static struct xpmem_access_permit * xpmem_ap_ref_by_apid(
struct xpmem_thread_group *, xpmem_apid_t);
static void xpmem_ap_deref(struct xpmem_access_permit *);
static void xpmem_att_deref(struct xpmem_attachment *);
struct xpmem_thread_group *ap_tg, xpmem_apid_t apid);
static void xpmem_ap_deref(struct xpmem_access_permit *ap);
static void xpmem_att_deref(struct xpmem_attachment *att);
static int xpmem_validate_access(struct xpmem_access_permit *, off_t, size_t,
int, unsigned long *);