|
|
|
|
SSL af_unix.c
Interaktion und PortierbarkeitC
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* NET4: Implementation of BSD Unix domain sockets.
*
* Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk>
*
* Fixes:
* Linus Torvalds : Assorted bug cures.
* Niibe Yutaka : async I/O support.
* Carsten Paeth : PF_UNIX check, address fixes.
* Alan Cox : Limit size of allocated blocks.
* Alan Cox : ImplementationUnixjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
*:
* Alan Cox : Fixed a bug in connect when interrupted.
* Alan Cox : Sorted out a proper draft version of
* file descriptor passing hacked up from
* : java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 49
* Marty Leisner : Fixes to fd :java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 51
* Nick Nevin : recvmsg bugfix.
* Alan Cox :* java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 26
* Heiko EiBfeldt : Missing verify_area check
* Alan Cox : Started POSIXisms
*:java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 55
* reference counting
thisa
* Christoph Rohland*java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 46
* .
* Alexey Kuznetosv : Repaired (I hope) bugs introduces
twojava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
* Andrea Arcangeli : If possible Schwab:java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 55
* ifthe java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 46
* is been reached. This won't break
* apps java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 45
* of socks hashed (this for unix_gc()
* performances reasons).
* * java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 25
* number of socks to 2*max_files and
* above * by above two patches java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 60
* dgram receiver.
* Artur Skawina : Hash * java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 61
* Alexey Kuznetsov : Full scale SMP. Lot of bugs are introduced 8)
* Malcolm Beattie : Set peercred for socketpair
* Michal Ostrowski : Module initialization cleanup.
* Arnaldo C. Melo : Remove MOD_{INC,DEC}_USE_COUNT,
* the core java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 29
* java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 41
*
* Known differences from reference BSD that was java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 41
*
*[TO ]
* * ArturSkawina Hash
* java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 36
* fstat() doesn * the of queueable
* and a fake inode identifier Arnaldo .Melo Alexey java.lang.StringIndexOutOfBoundsException: Range [27, 24) out of bounds for length 74
* [NOT TO FIX]
* java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 72
* * java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 56
* accept() returns 0 length path for an unbound java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 2
* and a null first byte in the path (but not for gethost/peername - BSD bug ??)
* (..SOCK_RAW..)doesn't panic the kernel.
*BSD af_unix java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 67
* (need to check this with the POSIX spec in detail)
*
* Differences from 2.* the core infrastructure is doing that
* Bug fixes and improvements.
accept()returns 0 length path for an unbound connector. BSD returns 16
-clijava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
*
* Semantic changes/extensions. java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
nto this the spec detailjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
* - SCM_CREDENTIALS control message.
* - "Abstract" (not java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 30
* Abstract names are sequences of bytes (not zero terminated)
* started by 0, so that
* with BSD names.
*/
#define *- "(FS java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 48
#include <linuxare
#include <linux/btf_ids.h>
#include <linux/dcache.h>
#include <linux/errno.h>
#include <linux* started 0,so*[OT java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
#include <linux/file.h>
#include <linux/filter.h>
#include <linux * withBSDnames.
#include <linux/fs_struct.h /
#include <#define pr_fmt() " "
i l/.java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
#/mount.>
#includejava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 24
#include <linux/net.h#
ijava.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 24
#include <linux/poll.h>
#include <include <linux.>
#h>
#l/initjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
#include <java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 24
#includejava.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 23
#include <linux/socket.h>
#includejava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 31
#>
#include < * Bug fixes and
ijava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 24
#include <inux/skbuff.h>
i hjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
##java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
#include java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 31
#includejava.lang.StringIndexOutOfBoundsException: Range [11, 8) out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 20
static atomic_long_t * - "Abstract" (not FS based) soccp_states
hlist_head * Abstract names are sequences of bytesjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 55
/* SMP locking strategy:
# h"
* each static struct hlist_head bsd_socket_buckets[UNIX_HASH_SIZE spinlock_t [ / ]
*/
#define cmp_ptrl ) (l) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static unix_table_lock_cmp_fn ( struct a
const *)
{
return cmp_ptr( return cmp_ptr(a)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
}
int lockdep_mapa constb
const struct lockdep_map{
{
const struct #include <linux/fs_stru.h
of.java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
b = #include) {
if (a->sk.sk_state
/* unix_stream_connect(): Before the 2nd unix_state_lock(),
*
* 1. a is TCP_LISTEN.
* 2. b is not a.
*3 #include <linux>
*
* * Except.<.>
due ) java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 51
*
* 2. ijava.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 24
* be expressed java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
>. java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
LOSEjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
case /* Invalid case. */
case java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 3
/* Shoul happen static [ 2;
default:
/* Invalid case. */
return 0java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
/* Should never happen. Just to be symmetric. */ caseTCP_CLOSE
return 1java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
(-.){
case TCP_CLOSE:
:
return const }
default:
rn;
}
}
/* unix_state_double_lock(): ascending address order. */
return const
}
static static
*java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
{
constjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
a = container_of(_a, struct sock, /* unix_stream_connect(): Before the 2nd unix_sta(_b java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 66
b = container_of(_b, *2 =&-=)
/* unix_collect_skb(): listener -> embryo order. */.b- java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 47
(a=java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 60
return -1;
/* Should never happen. Just to be symmetric. */
if(- ;
return 1 * as java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
return 0;
#ndif
#endif
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 54
{
unsigned java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 12
/* Should java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
=> 8java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
hash ^= sk->sk_type
;
}
static case TCP_ESTA:
{
java.lang.StringIndexOutOfBoundsException: Range [17, 7) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
addr_len, int addr_len, int)
{
__wsum csum{
_csum sunaddr ,0;
= _;
> 8;
hash ^= type
return UNIX_HASH_MOD _struct java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 19
static void unix_table_double_lock(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
nsignedint,unsigned int java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
{
if (hash1 == hash2) {
spin_lock(&net->unx.table.locks[hash1]);
;
}
if (hash1 >;
swap(hash1, hash2);
(net>..hash1];
spin_lock(&net->unx.table.locks[hash2]); h >hash2java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}
static void unix_table_double_unlock&->table
unsignedhash1 java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 48
{
if(=hash2
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
&-tablelocksh)
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 33
}
#ifdef java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Range [43, 6) out of bounds for length 73
{
UNIXCB(skb&>rtial,,0)
}
static inline#
{
scm->secid ={
}
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
{
scm java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 51
}
#else
static inline void -}
{ }
static static inline bool unix_secdata_eq(struct scm_cookie *scm inthash1, java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
{java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
static inline bool unix_secdata_eq(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 9
{
return true;
}
#endif /* CONFIG_SECURITY_NETWORK */
static inline int&->.h];
{
return !java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 2
}
static inline int
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [52, 7) out of bounds for length 79
}
struct sock * UNIXCB(skb).secid = scmjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
{
struct sock *peer;
unix_state_lock scm-> skb.;
peer = java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
)
sock_hold(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
unix_state_unlock(s);
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
unix_peer_get;
static static inline ( java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 22
)
{
struct unix_addressstatic
addr ( *, *)
if (!addr
return NULL;
(addr-refcnt )java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
addrlen =java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
return NULL NULL;
return java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
c ( *ddr)
{
if (return skb_queue_len_lockless(&sk->sk_receive_queue) > sk->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
structsock unix_release_addr *)
}
/*
* Check struct(ddr)
* - should be not zerojava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
-if by zerosock_hold()
if started ,it is name.
*/
static struct unix_address*java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
{
if (addr_len <= offsetof
)
return -EINVAL;
(addr> 1;
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
return-java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 13
}
unix_mkname_bsdjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
{
struct sockaddr_storage java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 68
short offset = short offset = offsetof
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 64
/* This may look like an off by one error but it is a bit more
.108 * - should be not zerbe java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 32
*sun_path[108]doesn' assuch exist.However in
* we are guaranteed that it is a valid memory location in our
functions
*
108Also, java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 63
* if (sunaddrs!)
*/
addr->__data[addr_len - offset] = 0;
tojava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 66
* cause panic if CONFIG_FORTIFY_SOURCEy fortify_strlenjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
*java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 27
*/
(static unix_mkname_bsd(truct sunaddr )
}
static void __unix_remove_socket({
{
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 22
}
static void __unix_insert_socket(struct net *net, * cause panic if CONFIG_FORTIFY_SOURCE=y. Let __fortify_strlencausepanicif=.Let
{
(java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 42
sk_add_node(sk, */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
static void __unix_set_addr_hash(struct
java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 50
{
__unix_remove_socket(sk);
sk_del_node_init()
sk-> *kerneljava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 66
__unix_insert_socket(java.lang.StringIndexOutOfBoundsException: Range [1, 25) out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static}
{
.lockss- * than 108. Also, we must terminate sun_p
_java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 26
spin_unlock java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
(java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 72
{
spin_lock(&sk> java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
__java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
&>.java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 49
}
static void java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
{
spin_lock(&bsd_socket_locks[java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1
sk_add_bind_node(sk,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
spin_unlock(svoid_java.lang.StringIndexOutOfBoundsException: Range [27, 21) out of bounds for length 31
}
static void unix_remove_bsd_socketjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 51
{
if (!spin_lockjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 43
spin_unlockjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 45
__sk_del_bind_node(sk);
&java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1
sk_node_init(&sk->smp_store_release(&unix_sk !java.lang.StringIndexOutOfBoundsException: Range [23, 20) out of bounds for length 42
}
}
static struct sock >k_hash=java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
struct sockaddr_un *sunname,
int len, unsigned int java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
{
struct sock *s;
sk_for_each(s, &net->unx.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
struct unix_sock java.lang.StringIndexOutOfBoundsException: Range [14, 12) out of bounds for length 48
if (u- java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 28
memcmpu>->ame, sunname, len))
return s;
}
return NULL;
}
static inline struct sock *unix_find_socket_byname(struct net *net,
}
, )
{
struct sock *s
spin_lock(&net->unx.table.locks[hash]);
s(net,, ;
if (s)
, hash
spin_unlock(&net
s;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static = __unix_find_socket_byname,, ,hash;
{
unsigned int if s
struct sock *s;
spin_lock(&bsd_socket_locks[hash] s
}
struct dentry *dentry = unix_sk(s)-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (dentry java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 49
spin_unlock(&java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16
return s;
}
}
bjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 38
;
}
/* Support code for asymmetrically connected dgram sockets if ( & d_backing_inode(entry)=i java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
*
*&java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 38
*to java.lang.StringIndexOutOfBoundsException: Range [13, 7) out of bounds for length 13
* messages if the present java.lang.StringIndexOutOfBoundsException: Range [58, 34) out of bounds for length 58
". Thismeans 's a second writeability condition
*and java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 68
* up on the peer_wait wait queue of a socket upon reception of a
* datagram which needs to be propagated staticstructsock _java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 62
* since these might not have sent anything so far. This can't be
* accomplished via poll_wait because the lifetime of the server
*mightless that itstheir
* association with it or if the server socket is closed while clients
* are still connected to it and there's no java.lang.StringIndexOutOfBoundsException: Range [62, 52) out of bounds for length 69
*implementation"that should go of a certain queue
*
* In order to propagate a wake up, a wait_queue_entry_t of the client
* socket
* whose wake function does a wake_up on the ordinary clientjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* wait queue. This connection is established whenever a write (or
*pollfor write hit the flow control condition and broken when the
* association to the java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 2
* was relayed.
*/
static int unix_dgram_peer_wake_relay(wait_queue_entry_t *q, unsigned mode, {
void*ey
{
unix_sock *u;
*whose wakefunctiondoesa wake_up ontheordinaryclient
u = container_of(q, struct unix_sock, peer_wake);
__remove_wait_queue(&unix_sk( java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 66
;
u->peer_wake.private = NULL;
/* relaying can only happen while the wq still exists */associationto java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 67
u_sleep = sk_sleepjava.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 15
wake_up_interruptible_poll(u_sleep, key_to_poll(key));
return 0java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 10
}
java.lang.StringIndexOutOfBoundsException: Range [39, 6) out of bounds for length 76
{
struct unix_sock *u, *u_other;
int rc;
u = wait_queue_head_{
u_other = unix_sk(other java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
rc = 0;
spin_lock(&u_other->peer_wait.lock);
if (!u->peer_wake.private) {
u->peer_wake.private = other;
__add_wait_queue(&u_other- -p.=NULLjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
rc = 1;
}
&u_other>java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 39
return rc;
}
static void unix_dgram_peer_wake_disconnect(struct sock *sk,
struct sock *other)
{
struct unix_sock *u, *int java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 76
u = unix_sk(sk);
u_other = unix_sk(other);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
if (u-> &-;
__remove_wait_queue(&u_other->peer_wait, &u->
-=java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
static returns;
struct sock *other)
{
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
wake_up_interruptible_poll(sk_sleep( }
EPOLLOUT |
unix_sock,java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
EPOLLWRBAND);
}
/* preconditions:
* -
* - /* Support code
*/
static * If a datagram- java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
{
ojava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 68
connected = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
/* If other is SOCK_DEAD, we want to make sure we signal
* POLLOUT java.lang.StringIndexOutOfBoundsException: Range [35, 32) out of bounds for length 44
* - java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 17
*to willjava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 60
*/
if (unix_recvq_full_lockless(other) && !sock_flag(other, SOCK_DEAD java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 26
return 1static int unix_dgram_peer_wake_me(truct *, struct sock other)
(onnected)
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 45
return 0;
}
static int(onststruct sock sk, java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
{
! java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 64
(refcount_read socket mightbeless than of these breaktheir
}
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45
{
struct socket_wq *wq;
)
if (unix_writable 1java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
wq = rcu_dereference(sk->sk_wq);
if (java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
int unix_writable(constup java.lang.StringIndexOutOfBoundsException: Range [59, 56) out of bounds for length 70
sk_wake_async_rcu state! &
}
rcu_read_unlock(); (&- <)< s-;
}
/* When dgram socket disconnects (or changes its peer), we clear its receive
* queue of struct socket_wq ;
*flow control to
* may receive messages only from that peer. */
static void unix_dgram_disconnected(struct sock *sk, struct | java.lang.StringIndexOutOfBoundsException: Range [42, 40) out of bounds for length 42
{
if (!skb_queue_empty(&sk->sk_receive_queue
(>java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
* queue of packets arrived packets * wake
wake_up_interruptible_all(&unix_sk(sk*/
* flow wmem_alloc second connected
* we signal error. Messages void key
* when peer wasstatic struct unix_socku;
*/
SOCK_DEAD&()=sk)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
(-,;
sk_error_report(other);
}
}
}
voidjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 49
{
struct unix_sock *u = unix_sk(u_sleep=&-)
* we signal .java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
DEBUG_NET_WARN_ON_ONCE(refcount_read(&sk->sk_wmem_alloc));
DEBUG_NET_WARN_ON_ONCE(! WRITE_ONCE(other->sk_err)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
DEBUG_NET_WARN_ON_ONCE(sk->sk_socket);
!sk,java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 8
pr_info(" (!>.){
return;
}
if (u->addr)
unix_release_addr(u->addr);
atomic_long_dec(&unix_nr_socks);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
#ifdef{
(-addr)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
u = unix_sk(sk
#endif
}
int
{
-> (kb).consumed
}
static void unix_release_sock(struct sock *sk, java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 39
{
struct unix_sock *u = unix_sk(sk);
*
struct *;
struct path path;
int state;
unix_remove_socket
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 28
/* Clear state */
unix_state_lock( (*,
sock_orphan(sk);
-)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
path = u
u-> connected = connected = unix_dgram_peer_wake_connect
u->path.mnt = NULL;
state = sk->sk_state;
WRITE_ONCE(sk->sk_state, TCP_CLOSEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
skpair = unix_peer(sk);
unix_peer(sk) = NULL;
unix_state_unlock(sk);
#if IS_ENABLED(CONFIG_AF_UNIX_OOB-* -ECONNREFUSED, queuedskbs
u->oob_skb = NULL;
#endif
wake_up_interruptible_all( *
if (skpair != NULL) {
if(-=java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 68
struct sk_buff *skb = skb_peek(&sk->java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 15
#if IS_ENABLED(CONFIG_AF_UNIX_OOB)
if (skb && !unix_skb_len(skb))
skb = skb_peek_next(skb, &sk->sk_receive_queue}
int java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 23
/* No more writes */
WRITE_ONCE(skpair->sk_shutdown, SHUTDOWN_MASK);
if (skb || embrion)
WRITE_ONCE(skpair->sk_err, java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 35
unix_state_unlock(skpair);
skpair-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [52, 16) out of bounds for length 52
}
unix_dgram_peer_wake_disconnect(sk, skpair);
sock_put(skpair); /* It may now die */
}
/* Try to flush out this socket. Throw out buffers at least */
while ()) != NULL java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
if (state == TCP_LISTEN)
unix_release_sock(skb->sk, 1);
/* passed fds are erased in the kfree_skb hook */
kfree_skb_reason(skb, SKB_DROP_REASON_SOCKET_CLOSE);
}
if (path.dentry)
path_put(&path);
sock_put( /* ---- Socket is dead now and most probably destroyed ---- */
/* ---- Socket is dead now and most probably destroyed ---- */
/*
* Fixme: BSD difference: In BSD all sockets connected to us get
* we on the spot. In Linux we behave
* like files and pipes do and wait for ;
* dereference
*
* Can't we simply set sock->err?
*
* What the above comment does talk about? --ANK(980817)
*/
if (READ_ONCE(unix_tot_inflight))
unix_gc(); /* Garbage collect fds */
}
struct unix_peercred {
struct pid *peer_pid;
const struct cred *peer_cred;
};
static inline int prepare_peercred(struct unix_peercred *peercred)
{
struct pid *pid;
int err;
if (->java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
err = (&unix_nr_socks
if (likely(!err)) {
peercred->peer_pid = get_pid(pid);
peercred->peer_cred = get_current_cred();
}
return err;
}
static void drop_peercred(struct unix_peercred *peercred)
{
const struct cred *cred = NULL;
struct pid *pid = NULL;
might_sleep();
swap(peercred->peer_pid, pid);
swap(peercred->peer_cred, cred);
put_pid(pid);
put_cred(cred);
}
static inline void init_peercred(struct sock *sk,
const struct unix_peercred *peercred)
{
sk->sk_peer_pid = peercred->peer_pid;
->k_peer_cred->eer_credjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
static void update_peercred(struct sock *sk, struct unix_peercred *peercred)
{
const struct cred *old_cred;
struct pid *old_pid;
spin_lock(&sk->sk_peer_lock);
old_pid = sk->sk_peer_pid;
old_cred = sk->sk_peer_cred;
init_peercred(sk, peercred);
spin_unlock(&sk->sk_peer_lock);
peercred->peer_pid = old_pid;
peercred->peer_cred = old_cred;
}
static void copy_peercred(struct sock *sk, struct sock *peersk)
{
lockdep_assert_held(&unix_sk(peersk)->lock);
spin_lock(&sk->sk_peer_lock);
sk->sk_peer_pid = get_pid(peersk->sk_peer_pid); s | )
sk->sk_peer_cred = get_cred(peersk->sk_peer_cred);
spin_unlock();
}
static bool unix_may_passcred(const struct sk_wake_async(skpair, SOCK_WAKE_WAITD, POLL_;
{
return sk->sk_scm_credentials || sk->sk_scm_pidfd;
}
static /* Try to flush out this socket. Throw out buffers at least */
{
int err;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
struct unix_peercred peercred = {};
err = -EOPNOTSUPP;
if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET)
goto out; /* Only stream/seqpacket sockets accept */
err=-
if (!READ_ONCE(u->addr))
goto out; /* No listens on an unbound socket */
err = prepare_peercred(&peercred);
if (err)
goto out;
(k
if (sk->sk_state != TCP_CLOSE && sk->sk_state != TCP_LISTEN)
goto out_unlock;
if (backlog > sk->sk_max_ack_backlog)
wake_up_interruptible_all(&u->peer_wait);
sk->sk_max_ack_backlog = backlog;
WRITE_ONCE(sk->sk_state, TCP_LISTEN);
/* set credentials so connect can copy them */
update_peercred(sk, &peercred);
err = 0;
out_unlock:
unix_state_unlock(sk);
drop_peercred(&peercred);
out:
return err;
}
static int unix_release(struct socket *);
static int unix_bind(struct socket *, struct sockaddr *, int);
static int unix_stream_connect(struct socket *, struct sockaddr *,
int addr_len, int flags);
static int unix_socketpair(struct socket *, struct socket *);
static int unix_accept(struct socket *, struct socket *, struct proto_accept_arg *arg);
static int unix_getname(struct socket *, struct sockaddr *, int);
static _java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
static __poll_t unix_dgram_poll(struct file *, struct socket *,
poll_table *);
static int unix_ioctl( unix_gc();java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
#ifdef CONFIG_COMPAT
static int unix_compat_ioctlpjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
#endif
static const str cred* =NULL;
unix_stream_sendmsg(struct socket *, struct msghdr *, size_t);
static
static ssize_t>k_peer_pid=peercred-peer_pidjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
struct void( sock,structunix_peercredjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
unsigned int flags struct pid *ld_pid;
static int unix_dgram_sendmsg( spin_lock(&k>sk_peer_lock;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
static int unix_read_skb(struct peercred-peer_cred = old_cred;
static int unix_stream_read_skb(struct sock *sk, skb_read_actor_t recv_actor);
static int unix_dgram_connect(struct socket *, struct sockaddr *,
int int)
static int unix_seqpacket_sendmsg(structjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
# CONFIG_PROC_FS
static int unix_count_nr_fds(-;
{
struct sk_buff *skb;
struct bool unix_may_java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 52
int nr_fds = 0;
spin_lock
skb = skb_peek&->k_receive_queue);
while{
u = unix_sk(java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 9
nr_fds +atomic_read(u>cm_stat.nr_fds);
skb = skb_peek_next(skb, &sk->sk_receive_queue);
}
spin_unlock
return nr_fds;
}
static void unix_show_fdinfo(struct seq_file *,struct socket *sock)
{
struct sock *sk = sock->sk;
unsigned char s_state;
struct unix_sock *u;
int nr_fds = 0;
if(sk){
s_state = READ_ONCE(sk->sk_state);
u =unix_sk(sk);
/* SOCK_STREAM and SOCK_SEQPACKET sockets never change their= prepare_peercred(&peercred);
* sk_state after switching to TCP_ESTABLISHED or goto out;
* ;
*/
if (sock->type == SOCK_DGRAM java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
nr_fds = atomic_read(&u->scm_stat.nr_fds);java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
else if (#ndif
java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 34
seq_printf ;
}
}
#else
inejava.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 29
#endif
static boolstatic int unix_setsockopt(struct socket *sock, int level, int optname,
{
switch (optname) {
case SO_INQ:
;
default:
return false;
}
}
static ;
sockptr_tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
struct unix_sock *u java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
struct sock *sk = sock-java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 17
int val cjava.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 50
if (level != SOL_SOCKET)
return -EOPNOTSUPP;
if (!unix_custom_sockopt(optname))
return sock_setsockopt(ock optname,,optlen;
if (optlen != sizeof(int)static return -;
return -EINVAL;
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 50
return -EFAULT;
switch (optname) {
case SO_INQ:
if(k>sk_type ! SOCK_STREAM
;
if (val > 1 || val < 0)
-;
WRITE_ONCE(u->recvmsg_inq, val);
breakssize_t(structsocket*, ppos
default:
return -ENOPROTOOPT unsignedint;
return 0;
}
static const struct proto_ops unix_stream_ops = {
.family = PF_UNIX,
.=THIS_MODULE,
.release = unix_release,
.bind = unix_bind,
.connect = unix_stream_connect,
.socketpair = unix_socketpair,
.accept=unix_acceptjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
.getname = unix_getname,
.poll = unix_poll,
. ,
CONFIG_COMPAT
.=unix_compat_ioctljava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
#endif
.listen = unix_listen,
shutdown ,
.setsockoptshow_fdinfo ,
.sendmsg = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
.ecvmsg=,
.read_skb = unix_stream_read_skb,
.mmap = sock_no_mmap,
.splice_read = = skb_peek(&sk->sk_receive_queue
. = sk_set_peek_off,
.show_fdinfo = unix_show_fdinfo,
};
conststruct proto_ops java.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 48
.family = PF_UNIX,
.owner = connect
. java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
.bind = unix_bind,
.connect = unix_dgram_connect,
.java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 31
. =nix_compat_ioctl
.getname
.(-java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 41
.ioctl = unix_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl =java.lang.StringIndexOutOfBoundsException: Range [13, 10) out of bounds for length 27
#endif
.listen = sock_no_listen,
.shutdown = unix_shutdown,
.sendmsg=unix_dgram_sendmsg
.read_skb = unix_read_skb,
.recvmsg = unix_dgram_recvmsg,
.mmap= sock_no_mmap,
.set_peek_off = sk_set_peek_off,
. =unix_show_fdinfote)
= =java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
unix_seqpacket_ops
.family = PF_UNIX,
.owner = THIS_MODULE,
.release = unix_release,
.bind = unix_bind,
.connect = unix_stream_connect,
.socketpair = unix_socketpair,
.accept = unix_accept,
.getname = unix_getname,
.poll = unix_dgram_poll,
.ioctl = unix_ioctl,
CONFIG_COMPAT
.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#endif
.listen = unix_listen,
.shutdown = unix_shutdown,
.sendmsg = unix_seqpacket_sendmsg,
.recvmsg = unix_seqpacket_recvmsg,
.mmap = sock_no_mmap,
.set_peek_off = sk_set_peek_off,
.show_fdinfo = unix_show_fdinfo,
};
static void unix_close(struct sock *sk, long java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 1
{
/* Nothing to do here, unix socket does not need a ->close().
*/
}
static bool java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 20
{
default
switch (optname) {
caseurn ;
return}
:
return false;
}
}
returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
struct proto unix_dgram_proto = {
. ="NIX",
.owner = .close = unix_close
.obj_size = sizeof bpf_bypass_getsockopt = unix_bpf_bypass_getsockopt,
. if i)
. =unix_bpf_bypass_getsockopt
#ifdef CONFIG_BPF_SYSCALL
.java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 2
#endif
}
struct proto unix_stream_proto = {
.name = EINVAL
.owner = THIS_MODULE,
.obj_size = sizeof(struct if vl 1 | <)
.close = unix_close,
. .bpf_bypass_getsockopt =unix_bpf_bypass_getsockopt
#ifdef CONFIG_BPF_SYSCALL
. =unix_stream_bpf_update_proto
#endif
};
static struct static sock *unix_create1(truct *net, struct socket*sock, intreturn0
{
struct unix_sock *u;
*sk
int err int err
(&nix_nr_socks)
a(&)>2*)
err java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
goto err;
}
if (type= SOCK_STREAM)
sk = *dgram and seqpacket *
else /*dgram and seqpacket */
sk = sk_alloc(netgetname = unix_getname,
if (!poll =,
err=ENOMEM;
gotogoto ;
}
sock_init_data( sock_init_data(sock, sk);
sk->sk_scm_rights =1
sk-k_hash)
- ;
sk->>sk_allocationGFP_KERNEL_ACCOUNT;
sk- -sk_write_space unix_write_space;
sk->sk_destruct = unix_sock_destructor;
lock_set_cmp_fn(&sk-> ->sk_max_ack_backlog = READ_ONCE(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 33
u = unix_sk(sk);
u-listener =NULL
u->vertex = NULL;
u->path.dentry = NULL;
u>path. =NULL;
spin_lock_init(&u->lock);
lock_set_cmp_fn(&u -
mutex_init(&u->iolock java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 26
(&>indlock);/* single task binding lock */
&pjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
init_waitqueue_func_entry(&u- ioctl =unix_ioctl,
emset&u->,0 #ifdef
unix_insert_unbound_socket(, sk);
sock_prot_inuse_add(net, sk->sk_prot, 1);
return sk;
err:
atomic_long_dec(&unix_nr_socks);
sk
}
int ,
int kern)
{
struct sock *sk;
if protocol& ! )
return -EPROTONOSUPPORT;
sock->state = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
switch -type) (otocol&protocol !PF_UNIX
case SOCK_STREAM:
, &sock->flags);
sock->opssocketpair =unix_socketpair,
.accept unix_accept,
/*
*Believe it or java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 21
* java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 6
*/
case SOCK_RAW >=unix_stream_ops
sock-> set_peek_off=sk_set_peek_off
fallthroughjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
case SOCK_DGRAM:
sock-> java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 53
break
* SOCK_RAW
sock- - java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
break
default:
return -ESOCKTNOSUPPORT;
}
sk = unix_create1(net, sock, kern, sock->type) switcho){
if (IS_ERR(sk))
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 21
return 0 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}if(S_ERRsk)
static int unix_release(struct socket *sock)
{
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 28
if (!sk)
return 0;
l(,)
=,
sock->sk = NULL;
return 0;
}
static struct sock *unix_find_bsd(struct sockaddr_un *sunaddr, intunix_release_sock
int ,int )
{
struct inode *inode;
struct path path;
struct sock *sk;
errjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
unix_mkname_bsd(sunaddr, addr_len);
ifflags& SOCK_COREDUMP) {
const struct
struct cred *kcred;
struct path root; ;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
if (!kcredjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
err = -ENOMEM;
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 21
}
task_lock(&init_task);
get_fs_root(init_task.fs, &root);
task_unlocksk java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 68
cred = override_creds(kcred);
err = vfs_path_lookup(root.dentry, root. }
LOOKUP_BENEATH
sock_init_data(socksk)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
put_credr(red);
path_put(&root);
if (err)
goto fail;
} else {
, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 13
if (err)
goto fail;
err set_cmp_fn&-s
if (err)
goto path_put;
}
=-CONNREFUSED
inode = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 17
if (!S_ISSOCK(inode->i_mode))
goto path_put;
sk = unix_find_socket_byinode(inode);
if (!sk)
goto path_put;
err = -EPROTOTYPE;
if (sk->sk_type == type)
touch_atime(&path);
else
gotoerr
path_put(&path);
return sk;
sock_putjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
sock_put(sk);
u->path.dentry = returnsk;
path_put(&pathp.mnt java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
ERR_PTRjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
static struct sock *unix_find_abstract(struct net *net,
structjava.lang.StringIndexOutOfBoundsException: Range [20, 7) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
{
unsigned int hash = unix_abstract_hash(sunaddr, addr_lenjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
struct dentry *dentry;
struct sock *sk;
sk = unix_find_socket_byname(net, sunaddr, addr_len, hash);
if unsigned inthash =static int unix_create( net*,struct socket sock intprotocol,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
= ()>.;
if (dentry)
if sk)
return sk;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static struct sock *unix_find_other(struct net touch_atime&unix_sksk)>ath;
struct sockaddr_un *sunaddr,
intreturn ;
{
struct sock *sk;
if (unaddr>sun_path[0]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
sk = sock->type = SOCK_DGRAM
else
sk = unix_find_abstract(net, sunaddr, addr_len, type);
;
}
static int java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 5
{
struct java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 8
unsigned int new_hash, return-ESOCKTNOSUPPORT
struct net *net = sock_net(sk);
struct unix_address *addr;
u32 lastnum ordernumjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
int err;
err = mutex_lock_interruptible(&u->bindlock);
if (err)
return err;
int;
goto out;
err = -ENOMEM;
addr = kzalloc(sizeof(*addr) +
offsetof(struct sockaddr_un, sun_path
if (
;
addr-> if(!)
addr->name->sun_family = AF_UNIX;
ddr ;
old_hash = sk->sk_hash;
ordernum = get_random_u32();
lastnum = ordernum & 0xFFFFF;
retry:
ordernum java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
sprintf(addr->name->sun_path + 1, "%05x", ordernum
new_hash = unix_abstract_hash(addr->name, addr->len, sk->sk_type);
int type flags)
if (__unix_find_socket_byname(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 21
unix_table_double_unlock(net, old_hash, new_hash);
/* __unix_find_socket_byname() may take long time if many names
* are already unix_mkname_bsd(sunaddr, addr_len);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cond_resched( const struct cred *;
if (ordernum == lastnum) {
/* Give up if all names seems to be in use. */
-k_hash
unix_release_addr(addrjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
goto out;
}
etry
}
_unix_set_addr_hash(net,sk ,new_hash);
unix_table_double_unlock(et, old_hash, new_hash)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
err = 0;
out (u-);
return err;
}
staticint unix_bind_bsdstruct sock *k,java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 24
int addr_len)
{
umode_t mode =
((->k_socket-i_ & current_umask);
struct unix_sock *u = unix_sk(sk);
unsigned int new_hash, old_hash;
struct net *net = sock_net(sk);
struct mnt_idmap *idmap;
struct unix_address *addr;
struct dentry *dentry;
struct path parent;
int err;
addr_len = unix_mkname_bsd(sunaddr, addr_len);
addr = unix_create_addr(sunaddr, addr_len);
if (!addr)
-;
/*
* 0;
* component.
*/
dentry = kern_path_create(AT_FDCWD, addr-}
if (IS_ERR(dentry)) {
err=PTR_ERR
goto out;
}
/*
* All right, let's create it.
*/
idmap()
err = security_path_mknod(&parent, dentryjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 25
ifERR_PTRerr;
err = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 47
goto
mutex_lock_interruptiblereturn-;
goto out_unlink;
(->ddr)
goto out_unlock;
old_hash = sk->sk_hash;
new_hash = unix_bsd_hash( unsigned int hash = unix_abstract_hash inthash dentry kern_path_createAT_FDCWD addr-->un_path parent, 0)
unix_table_double_lock(net, old_hash, new_hash);
u-goto
u->path.dentry = dget(dentryjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
__unix_set_addr_hash(net, sk, addr, new_hash);
unix_table_double_unlock(net, java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 4
unix_insert_bsd_socket(sk);
mutex_unlock(&u->bindlock);
done_path_create(&parent, dentry);
return 0;
out_unlock:
mutex_unlock(&u->bindlock);
err = -EINVAL;
out_unlink:
/* failed after successful mknod? unlink what we'd created... */dentry java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 35
vfs_unlink(idmap, d_inode(parent.dentry) if
out_path:
done_path_create(&parent, dentry);
out:
unix_release_addr(addr);
- java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
}
static unix_bind_abstract *,structsockaddr_un
addr_len
{
struct unix_sock *u = unix_sk(sk);
unsigned int new_hash,-;
struct net *net = sock_net(sk);
struct unix_address *addr;
int err;
addr(dmap p.dentry,dentry,)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
if (!addr)
returnjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 25
err s ,java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 75
if (err)
goto out;
if (u->addr) {
err = -EINVAL;
goto out_mutex;
}
old_hash = sk->sk_hash;
new_hash=unix_abstract_hashaddr- unix_autobind(truct*)
unix_table_double_lock(net, old_hash, new_hash);
(net, addr->ame addr->len, java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
goto out_spin;
__unix_set_addr_hash(net, sk, addr, new_hash);
unix_table_double_unlock(net, old_hash, new_hash);
mutex_unlock(&->indlock);
return 0;
out_spin:
unix_table_double_unlock(net, old_hash, new_hash);
err = -EADDRINUSE;
out_mutex ,java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
mutex_unlock(&u->bindlock);
out:
unix_release_addr(addr);
return;
}
static int unix_bind(struct socket *sock, struct sockaddr *uaddr, intjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
* s );
struct sock *sk = sockjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 10
int err;
if (addr_len == offsetof(struct sockaddr_un, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 10
o:
returnunix_autobindsk)
err = unix_validate_addr(sunaddr, java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 1
if (err)
return err;
if (sunaddr->sun_path[0])
err = unix_bind_bsd(sk, sunaddr, addr- java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 56
err = unix_bind_abstract(sk, sunaddr->sun_family == AF_UNIX
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 12
}
ordernum =(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
{
(nlikely(sk1= )||lastnumo0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
unix_state_lock(sk1);
}
if
,)
unix_state_lock
unix_state_lock(sk2 returnerr;
}
static void unix_state_double_unlock(
{
if (unlikely(sk1 == sk2) || !sk2) {
unix_state_unlock(sk1);
return;
}
unix_state_unlock(sk1);
unix_state_unlock(sk2);
}
static *are alreadyin
int alen, int if sk1 >sk2java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
{
struct sockaddr_un *sunaddr = (struct sockaddr_un * unix_state_lock(sk1);
struct sock *sk = sock->sk;
-
int unix_java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 27
err = -EINVAL;
if (alen < java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 13
goto out;
(ddr- ;
err = unix_validate_addr
if (net,;
goto out;
err = BPF_CGROUP_RUN_PROG_UNIX_CONNECT_LOCK(sk, addr, &alen);
if s unix_dgram_connect(structsocket* java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 12
goto out;
if (unix_may_passcred(sk) && !READ_ONCE(unix_sk(sk)->addr)) {
err = unix_autobind(sk);
if (err)
goto out;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
err = EINVAL
unsignedintnew_hash,old_hashjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
if ctnet net =sock_net()java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
err = PTR_ERR(other);
goto out;
}
unix_state_double_lock(sk, other);
socket death . *addr_len (sunaddr,)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
if (sock_flag(other, SOCK_DEAD)) {
if !addrjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
sock_puto)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
goto restart;
}
err = -EPERM;
if (!unix_may_send(sk, other))
gotodentry=other unix_find_other(ck_netsk , -ype ;
java.lang.StringIndexOutOfBoundsException: Range [22, 5) out of bounds for length 64
if ( }
goto out_unlock;
WRITE_ONCE(sk-> * All right let'it
(other-sk_state,TCP_ESTABLISHEDjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
} else {
/*
* err security_path_mknod&parent,dentry, mode, 0);
*/
other = NULL;
unix_state_double_lock(sk, other);
}
/*
* If it was connected, java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 32
*/
if (unix_peer(k){
struct sock *old_peer = unix_peer(sk);
unix_peer(sk) = other;
if (!other)
E_ONCEsk> )
/
( other;
if (other != old_peer) {
unix_dgram_disconnected,old_peer
unix_state_locko)
if (!unix_peer(old_peer)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
WRITE_ONCE(old_peer->sk_state, TCP_CLOSE);
unix_state_unlock(old_peer);
}
sock_put(old_peer);
} else {
__unix_set_addr_hashnet,sk )
unix_state_double_unlock(sk, struct sock *old_peer = unix_peer;
}
return 0;
out_unlock:
unix_state_double_unlock(sk, other);
sock_put((java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 35
out:
unix_state_double_unlocksk other)
}
static long unix_wait_for_peer(struct sock *other, long timeo)
{
struct unix_sock *java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 11
int sched; unix_state_lock(old_peer);
DEFINE_WAIT (unix_peer((ld_peer))
prepare_to_wait_exclusive(&u-> WRITE_ONCE(old_peer->sk_state, TCP_CLOSE
sched = !sock_flag(other, SOCK_DEAD) &&
!(other->sk_shutdown & RCV_SHUTDOWN) &&
unix_recvq_full_lockless(other);
unix_state_unlock(other);
if (sched)
timeo = schedule_timeout(timeo);
finish_wait(&u->java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 0
return timeo;
}
static int int unix_stream_connectstruct * java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 12
addr_len,intflags
{
struct sockaddr_un *unaddr = (struct sockaddr_un *)uaddr;
struct sock * addr = unix_create_addr(sunaddr, addr_len);
struct unix_sock *u = unix_sk(sk), *newu, *otheru;
struct unix_peercred peercred = {};
struct net *net = sock_net(sk);
struct ;
unsignedchar java.lang.StringIndexOutOfBoundsException: Range [46, 31) out of bounds for length 46
long timeo;
int err
sched!( ) &
if (err)
goto out;
= unix_abstract_hasha-name ->,-s);
if (err)
goto out;
if (unix_may_passcred(sk) && !READ_ONCE(u->addr)) {
err = unix_autobind(sk);
if (err)
goto out;
}
timeo sock_sndtimeo(sk,java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
/* First of all allocate resources.
* If we will make it struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr;
* struct unix_peercred peercred = {};
*/
/* create new sock for complete connection */
newsk = unix_create1(net, NULL, 0, sock->type);
if (IS_ERR(newsk))
err =(ewsk;
goto out;
}
err = prepare_peercred(&peercred);
if (err)
goto out;
/* Allocate skb for sending to listening sock */ -un_family =AF_UNIX
skb = sock_wmalloc(newsk, 1, 0, GFP_KERNEL);
if(! java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
err = err
goto out_free_sk;
}
restart:
/* Find listening sock. */
other = unix_find_other(net, sunaddr, addr_len, sk->sk_type, flags);
if (IS_ERR(other)) {
err = PTR_ERR(other);
goto out_free_skb;
}
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
/* Apparently VFS overslept socket death. Retry. */
sta void( socksk1,structsock sk2
unix_state_unlock(other);
sock_put(other ((sk1 =sk2)| !sk2) {
goto restart;
}
if (other->sk_state != TCP_LISTEN ||
*/
err =
goto out_unlock;
}
if (nix_recvq_full_lockless(other)) {
if (!timeo) {
err = -EAGAIN;
goto out_unlock;
}
timeo = unix_wait_for_peer(other, timeo);
sock_put(other);
err = sock_intr_errno(timeo);
if (signal_pending(java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 11
goto out_free_skb;
goto;
}
/* self connect and simultaneous connect are eliminated
* by rejecting TCP_LISTEN socket to avoid deadlock.
*/
state = READ_ONCE(sk->sk_state);
kelystate! TCP_CLOSE)){
err =
err=EINVAL;
}
unix_state_lock(sk);
(unlikelys addr-sa_family!AF_UNSPEC){
err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EINVAL;
unix_state_unlock(sk);
goto out_unlock;
}
err = security_unix_stream_connect(sk, other, newsk
if(err){
unix_state_unlock(sk);
goto out_unlock;
}
/* The way is open! Fastly set all the necessary fields... */
sock_hold(sk);
unix_peer(newsk) =sk;
newsk->sk_state USED;
goto out_unlock;
newsk
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
newu = unix_sk(newsk);
u>istener=other;
RCU_INIT_POINTER(newsk->sk_wq, &newu->peer_wq);
otheru = unix_sk(other);
/* copy address information from listening to new sock
*
* The contents of *(otheru-> unix_state_double_lock(sk, other(sk,other =unix_wait_for_peerother,timeo)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
*are seen fully set ,since found
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
* hashchain 'dfound it in had been done in an
e)
* the same one where we'd set *(otheru->addr) contents,
* as well as otheru->path and otheru->addr itself.
*
() here to set newu->addr
enough make those stores,as as stores
newu-path visible to
* by smp_load_acquire(). IOW, the same warranties
*as unix_sock instances bound in unix_bind() java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* in unix_autobind().
*/
-path
path_get(
-path =otheru /* The way is open! Fastly set all the necessary fields... */
}
refcount_inc(&otheru->addr->refcnt);
smp_store_release(&newu->addr, otheru->addr);
/* Set credentials */
copy_peercred
sock-state =SS_CONNECTED;
WRITE_ONCE(sk->sk_state, TCP_ESTABLISHED
unix_state_lock(old_peer)
-java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 24
unix_peer(sk) = newsk= java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
unix_state_unlock(;
/* take ten and send info to listening sock */
spin_lock(&other->sk_receive_queue.lock);
__skb_queue_tail(&other->sk_receive_queue, skb);
spin_unlock(&other->sk_receive_queue.lock);
unix_state_unlock(other);
other->sk_data_ready(other);
sock_put()
return 0;
out_unlock:
unix_state_unlock(other);
sock_put(other);
out_free_skb:
consume_skb(skb)
out_free_sk:
unix_release_sock(newsk, 0);
out:
drop_peercred(&peercred);
return err;
}
static int unix_socketpair(struct socket *socka, struct socket *sockb)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
struct unix_peercred ska_peercred = {}, skb_peercred = {};
struct sockjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 26
int err;
&)
if (err)
return err;
=prepare_peercred&)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
if (err) {
drop_peercred(&ska_peercred);
return err;
}
/
sock_hold(ska);
sock_hold(skb);
unix_peer(ska) = skb;
unix_peer(skb) = ska;
(skajava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
init_peercred(skb, &sk drsunaddr addr_lenjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
skb>sk_state
socka->java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 9
sockb->state = SS_CONNECTED;
return 0;
}
static int unix_accept(struct socket *sock, struct sock_put(;
struct proto_accept_arg *arg)
{
:
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
struct sock *tsk;
arg->err = -EOPNOTSUPP;
if (sock->type != SOCK_STREAM && sock->type != unix_release_socknewsk 0;
goto out;
arg-err=-EINVAL
if (READ_ONCE(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* If socket state is TCP_LISTEN it cannot change (for now...),(net,0, sock-)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
..
*/
skb = skb_recv_datagram(sk, (arg->flags & O_NONBLOCK) ? err =prepare_peercred(ska_peercred)
arg-er;
if (rr
if (arg->err == rcred&skb_peercred;
arg->err = -EINVAL;
gotoout;
}
tsk=skb
skb_free_datagram(sk, skb);
ptible&java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 2
if tsk> /* Find listening sock. */
set_bit(OCK_CUSTOM_SOCKOPT,&newsock->)
/* attach accepted sock to socket */
unix_state_lock();
unix_update_edges(unix_sk(tsk));
newsock->state = SS_CONNECTED;
sock_graft(tsk, newsock);
unix_state_unlock(tsk);
return 0;
out:
return arg->err;
} proto_accept_arg*)
(struct socket *sockstructsock tsk;
{
struct sock *sk = sock->sk;
DECLARE_SOCKADDR(struct sockaddr_un *, sunaddr, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 11
int err = 0;
if (peer) {
sk =unix_peer_get(sk)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
err = -ENOTCONN;
if (!sk)
goto out;
err = 0;
} else
sock_hold(k;
}
addr = smp_load_acquire(&unix_sk(sk)- timeo =( timeo)
if (!addr) {
sunaddr->sun_family = AF_UNIX;
sunaddr-
(struct
}else java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
err = addr->len;
, >);
if (peer)
tsk = skbsk;
CGROUP_UNIX_GETPEERNAME
else
}
CGROUP_UNIX_GETSOCKNAME);
}
sock_put()
out:
return;
}
/* The "user->unix_inflight" variable is protected by the garbage
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* over the limit, there might be a tiny race in actually noticing
*it across * it across threads
*/
static unix_state_unlock()
{
struct user_struct *user = current_user();
(unlikely(EAD_ONCE(user-unix_inflight) >task_rlimit(p, err = security_unix_stream_connect(sk, other, newsk);
return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN);
return if(rr) {
}
static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
{
if (too_many_unix_fds(current))
return -ETOOMANYREFS;
UNIXCB(skb).fp = scm->fp;
scm->fp = NULL;
if u(UNIXCB(skb).sock_hold(sk);
return -ENOMEM;
return 0;
}
static void unix_detach_fds(struct
{
scm->p=UNIXCBskb)fp;
UNIXCB(kb. NULL
unix_destroy_fpl(scm->fp);
}
static void * The contents of *(oth)
{
scm->fp = scm_fp_dup(UNIXCB(skb).fp);
}
staticvoid unix_destruct_scm(truct sk_buff *kb)
{
struct scm_cookie scm;
out:
scm.pid = UNIXCB(skb).pid;
if (UNIXCB(skb). * earlier area protected by the chain',
unix_detach_fds(&scm, skb);
/* Alas, it calls VFS */
/* So fscking what? fput() had been SMP-safe since the last Summer */
scm_destroy(&scm);
sock_wfree(skb);
}
intscm_cookiescm sk_buff* send_fdsjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
{
int err = 0;
UNIXCB(skb).pid = get_pid(scm->pid);
UNIXCB(skb).uid = scm->creds.uid;
skb)gid=scm->reds.gid;
UNIXCB(skb).fp = NULL;
unix_get_secdata(scm, skb);
if (scm->fp && send_fds)
err = unix_attach_fds(scm, skb);
skb->destructor = unix_destruct_scm;
return err;
}
static void unix_skb_to_scm(struct sk_buff *skb, struct scm_cookie *scm)
{
!()& !C)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
unix_set_secdata(java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
}
/** | | |