You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Catherine Zhang
877ce7c1b3
[AF_UNIX]: Datagram getpeersec
...
This patch implements an API whereby an application can determine the
label of its peer's Unix datagram sockets via the auxiliary data mechanism of
recvmsg.
Patch purpose:
This patch enables a security-aware application to retrieve the
security context of the peer of a Unix datagram socket. The application
can then use this security context to determine the security context for
processing on behalf of the peer who sent the packet.
Patch design and implementation:
The design and implementation is very similar to the UDP case for INET
sockets. Basically we build upon the existing Unix domain socket API for
retrieving user credentials. Linux offers the API for obtaining user
credentials via ancillary messages (i.e., out of band/control messages
that are bundled together with a normal message). To retrieve the security
context, the application first indicates to the kernel such desire by
setting the SO_PASSSEC option via getsockopt. Then the application
retrieves the security context using the auxiliary data mechanism.
An example server application for Unix datagram socket should look like this:
toggle = 1;
toggle_len = sizeof(toggle);
setsockopt(sockfd, SOL_SOCKET, SO_PASSSEC, &toggle, &toggle_len);
recvmsg(sockfd, &msg_hdr, 0);
if (msg_hdr.msg_controllen > sizeof(struct cmsghdr)) {
cmsg_hdr = CMSG_FIRSTHDR(&msg_hdr);
if (cmsg_hdr->cmsg_len <= CMSG_LEN(sizeof(scontext)) &&
cmsg_hdr->cmsg_level == SOL_SOCKET &&
cmsg_hdr->cmsg_type == SCM_SECURITY) {
memcpy(&scontext, CMSG_DATA(cmsg_hdr), sizeof(scontext));
}
}
sock_setsockopt is enhanced with a new socket option SOCK_PASSSEC to allow
a server socket to receive security context of the peer.
Testing:
We have tested the patch by setting up Unix datagram client and server
applications. We verified that the server can retrieve the security context
using the auxiliary data mechanism of recvmsg.
Signed-off-by: Catherine Zhang <cxzhang@watson.ibm.com>
Acked-by: Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
19 years ago
..
a.out.h
Linux-2.6.12-rc2
20 years ago
anna.h
Linux-2.6.12-rc2
20 years ago
as85ep1.h
Linux-2.6.12-rc2
20 years ago
asm.h
Linux-2.6.12-rc2
20 years ago
atomic.h
Don't include linux/config.h from anywhere else in include/
19 years ago
auxvec.h
[PATCH] auxiliary vector cleanups
20 years ago
bitops.h
Don't include linux/config.h from anywhere else in include/
19 years ago
bug.h
[PATCH] remove all kernel BUGs
20 years ago
bugs.h
Linux-2.6.12-rc2
20 years ago
byteorder.h
Linux-2.6.12-rc2
20 years ago
cache.h
[PATCH] Kill L1_CACHE_SHIFT_MAX
19 years ago
cacheflush.h
Linux-2.6.12-rc2
20 years ago
checksum.h
[PATCH] v850: Update checksum.h to match changed function signatures
20 years ago
clinkage.h
Linux-2.6.12-rc2
20 years ago
cputime.h
Linux-2.6.12-rc2
20 years ago
current.h
Linux-2.6.12-rc2
20 years ago
delay.h
[PATCH] include/asm-v850/ "extern inline" -> "static inline"
20 years ago
div64.h
Linux-2.6.12-rc2
20 years ago
dma-mapping.h
Don't include linux/config.h from anywhere else in include/
19 years ago
dma.h
Linux-2.6.12-rc2
20 years ago
elf.h
Linux-2.6.12-rc2
20 years ago
emergency-restart.h
[PATCH] Add emergency_restart()
20 years ago
entry.h
Linux-2.6.12-rc2
20 years ago
errno.h
Linux-2.6.12-rc2
20 years ago
fcntl.h
[PATCH] Clean up struct flock64 definitions
20 years ago
flat.h
Linux-2.6.12-rc2
20 years ago
fpga85e2c.h
Linux-2.6.12-rc2
20 years ago
futex.h
[PATCH] consolidate asm/futex.h
19 years ago
gbus_int.h
Linux-2.6.12-rc2
20 years ago
hardirq.h
Don't include linux/config.h from anywhere else in include/
19 years ago
highres_timer.h
Linux-2.6.12-rc2
20 years ago
hw_irq.h
[PATCH] genirq: add ->retrigger() irq op to consolidate hw_irq_resend()
19 years ago
io.h
[PATCH] v850: Update ioremap return type and add ioread/iowrite functions
20 years ago
ioctl.h
[PATCH] Generic ioctl.h
19 years ago
ioctls.h
Linux-2.6.12-rc2
20 years ago
ipc.h
Linux-2.6.12-rc2
20 years ago
ipcbuf.h
Linux-2.6.12-rc2
20 years ago
irq.h
[PATCH] adjust handle_IRR_event() return type
19 years ago
kmap_types.h
Linux-2.6.12-rc2
20 years ago
linkage.h
[PATCH] abstract type/size specification for assembly
19 years ago
local.h
Linux-2.6.12-rc2
20 years ago
ma.h
Linux-2.6.12-rc2
20 years ago
ma1.h
Linux-2.6.12-rc2
20 years ago
machdep.h
Don't include linux/config.h from anywhere else in include/
19 years ago
macrology.h
Linux-2.6.12-rc2
20 years ago
me2.h
Linux-2.6.12-rc2
20 years ago
mman.h
[PATCH] add asm-generic/mman.h
19 years ago
mmu.h
[PATCH] v850: Update mmu.h header to match implementation changes
20 years ago
mmu_context.h
Linux-2.6.12-rc2
20 years ago
module.h
Linux-2.6.12-rc2
20 years ago
msgbuf.h
Linux-2.6.12-rc2
20 years ago
mutex.h
[PATCH] mutex subsystem, add default include/asm-*/mutex.h files
19 years ago
namei.h
Linux-2.6.12-rc2
20 years ago
page.h
[PATCH] unify pfn_to_page: v850 pfn_to_page
19 years ago
param.h
Linux-2.6.12-rc2
20 years ago
pci.h
[PATCH] v850: Update PCI support
20 years ago
percpu.h
Linux-2.6.12-rc2
20 years ago
pgalloc.h
Linux-2.6.12-rc2
20 years ago
pgtable.h
Don't include linux/config.h from anywhere else in include/
19 years ago
poll.h
[PATCH] POLLRDHUP/EPOLLRDHUP handling for half-closed devices notifications
19 years ago
posix_types.h
Linux-2.6.12-rc2
20 years ago
processor.h
Don't include linux/config.h from anywhere else in include/
19 years ago
ptrace.h
Fix "stuct", "strut", "struc" typos
19 years ago
resource.h
Linux-2.6.12-rc2
20 years ago
rte_cb.h
Linux-2.6.12-rc2
20 years ago
rte_ma1_cb.h
Linux-2.6.12-rc2
20 years ago
rte_mb_a_pci.h
Linux-2.6.12-rc2
20 years ago
rte_me2_cb.h
Linux-2.6.12-rc2
20 years ago
rte_nb85e_cb.h
Linux-2.6.12-rc2
20 years ago
scatterlist.h
Linux-2.6.12-rc2
20 years ago
sections.h
Linux-2.6.12-rc2
20 years ago
segment.h
Linux-2.6.12-rc2
20 years ago
semaphore.h
[PATCH] include/asm-v850/ "extern inline" -> "static inline"
20 years ago
sembuf.h
Linux-2.6.12-rc2
20 years ago
serial.h
Don't include linux/config.h from anywhere else in include/
19 years ago
setup.h
Linux-2.6.12-rc2
20 years ago
shmbuf.h
Linux-2.6.12-rc2
20 years ago
shmparam.h
Linux-2.6.12-rc2
20 years ago
sigcontext.h
Linux-2.6.12-rc2
20 years ago
siginfo.h
Linux-2.6.12-rc2
20 years ago
signal.h
[PATCH] asm/signal.h unification
20 years ago
sim.h
Linux-2.6.12-rc2
20 years ago
sim85e2.h
Linux-2.6.12-rc2
20 years ago
sim85e2c.h
Linux-2.6.12-rc2
20 years ago
sim85e2s.h
Linux-2.6.12-rc2
20 years ago
simsyscall.h
Linux-2.6.12-rc2
20 years ago
socket.h
[AF_UNIX]: Datagram getpeersec
19 years ago
sockios.h
Linux-2.6.12-rc2
20 years ago
stat.h
Linux-2.6.12-rc2
20 years ago
statfs.h
Linux-2.6.12-rc2
20 years ago
string.h
Linux-2.6.12-rc2
20 years ago
system.h
[PATCH] Remove unused prepare_to_switch macro
19 years ago
teg.h
Linux-2.6.12-rc2
20 years ago
termbits.h
Linux-2.6.12-rc2
20 years ago
termios.h
Linux-2.6.12-rc2
20 years ago
thread_info.h
[PATCH] death of get_thread_info/put_thread_info
19 years ago
timex.h
Linux-2.6.12-rc2
20 years ago
tlb.h
Linux-2.6.12-rc2
20 years ago
tlbflush.h
[PATCH] include/asm-v850/ "extern inline" -> "static inline"
20 years ago
topology.h
Linux-2.6.12-rc2
20 years ago
types.h
[PATCH] sab: consolidate kmem_bufctl_t
20 years ago
uaccess.h
[PATCH] include/asm-v850/ "extern inline" -> "static inline"
20 years ago
ucontext.h
Linux-2.6.12-rc2
20 years ago
unaligned.h
[PATCH] include/asm-v850/ "extern inline" -> "static inline"
20 years ago
unistd.h
Remove unneeded _syscallX macros from user view in asm-*/unistd.h
19 years ago
user.h
Linux-2.6.12-rc2
20 years ago
v850e.h
Linux-2.6.12-rc2
20 years ago
v850e2.h
Linux-2.6.12-rc2
20 years ago
v850e2_cache.h
[PATCH] v850: Define L1_CACHE_SHIFT and L1_CACHE_SHIFT_MAX
20 years ago
v850e_cache.h
Linux-2.6.12-rc2
20 years ago
v850e_intc.h
Linux-2.6.12-rc2
20 years ago
v850e_timer_c.h
Linux-2.6.12-rc2
20 years ago
v850e_timer_d.h
Linux-2.6.12-rc2
20 years ago
v850e_uart.h
Don't include linux/config.h from anywhere else in include/
19 years ago
v850e_uarta.h
Linux-2.6.12-rc2
20 years ago
v850e_uartb.h
Linux-2.6.12-rc2
20 years ago
v850e_utils.h
Linux-2.6.12-rc2
20 years ago