Skip to content

Commit

Permalink
xnu-1504.3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Darwin authored and das committed Jun 4, 2017
1 parent 778f7ec commit 7d720fa
Show file tree
Hide file tree
Showing 150 changed files with 11,165 additions and 4,716 deletions.
10 changes: 10 additions & 0 deletions bsd/conf/MASTER
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ options QUOTA # file system quotas # <quota>
options REV_ENDIAN_FS # Reverse Endian FS # <revfs>
options NAMEDSTREAMS # named stream vnop support # <namedstreams>
options CONFIG_VOLFS # volfs path support (legacy) # <config_volfs>
options CONFIG_IMGSRC_ACCESS # source of imageboot dmg # <config_imgsrc_access>

#
# NFS support
Expand Down Expand Up @@ -245,6 +246,8 @@ options randomipid # <inet,randomipid>

options ZLIB # inflate/deflate support # <zlib>

options IF_BRIDGE # <if_bridge>

makeoptions LIBDRIVER = "libDriver_kern.o" # <libdriver>
makeoptions LIBOBJC = "libkobjc.o" # <kernobjc>

Expand Down Expand Up @@ -306,6 +309,9 @@ options CONFIG_VFS_NAMES=4096 # <medium>
options CONFIG_VFS_NAMES=3072 # <small,xsmall>
options CONFIG_VFS_NAMES=2048 # <bsmall>

options CONFIG_MAX_CLUSTERS=8 # <xlarge,large,medium>
options CONFIG_MAX_CLUSTERS=4 # <small,xsmall,bsmall>

#
# configurable kauth credential related resources
#
Expand Down Expand Up @@ -409,6 +415,10 @@ options CONFIG_EMBEDDED # <config_embedded>
#
options CONFIG_ENFORCE_SIGNED_CODE # <config_embedded>

# support dynamic signing of code
#
options CONFIG_DYNAMIC_CODE_SIGNING # <dynamic_codesigning>

#
# code decryption... used on embedded for app protection
# must be set in all the bsd/conf and osfmk/conf MASTER files
Expand Down
6 changes: 3 additions & 3 deletions bsd/conf/MASTER.i386
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
# Standard Apple Research Configurations:
# -------- ----- -------- ---------------
# BASE = [ intel mach medium config_dtrace vol pst gdb kernobjc fixpri simple_clock mdebug kernserv driverkit uxpr kernstack ipc_compat ipc_debug sysv_sem sysv_msg sysv_shm audit panic_info config_imageboot config_workqueue psynch ]
# FILESYS = [ devfs revfs hfs journaling fdesc config_fse quota namedstreams fifo union config_volfs hfs_compression ]
# NETWORKING = [ inet inet6 compat_oldsock mrouting tcpdrop_synfin bpfilter ipdivert ipfirewall ipv6firewall ipfw2 dummynet traffic_mgt sendfile netmibs bond vlan gif stf zlib randomipid ifnet_input_chk config_mbuf_jumbo ipflow ]
# FILESYS = [ devfs revfs hfs journaling fdesc config_fse quota namedstreams fifo union config_volfs hfs_compression config_imgsrc_access ]
# NETWORKING = [ inet inet6 compat_oldsock tcpdrop_synfin bpfilter ipdivert ipfirewall ipv6firewall ipfw2 dummynet traffic_mgt sendfile netmibs bond vlan gif stf zlib randomipid ifnet_input_chk config_mbuf_jumbo ipflow ]
# NFS = [ nfsclient nfsserver ]
# VPN = [ ipsec ]
# RELEASE = [ BASE NETWORKING NFS VPN FILESYS libdriver ]
Expand All @@ -56,7 +56,7 @@
#
# EMBEDDED_BASE = [ intel mach bsmall vol pst gdb kernobjc fixpri simple_clock mdebug kernserv driverkit uxpr kernstack ipc_compat ipc_debug sysv_sem sysv_msg sysv_shm audit panic_info config_imageboot config_workqueue psynch ]
# EMBEDDED_FILESYS = [ devfs hfs journaling fdesc fifo ]
# EMBEDDED_NET = [ inet compat_oldsock mrouting tcpdrop_synfin bpfilter config_mbuf_noexpand ]
# EMBEDDED_NET = [ inet compat_oldsock tcpdrop_synfin bpfilter config_mbuf_noexpand ]
# EMBEDDED = [ EMBEDDED_BASE EMBEDDED_NET VPN EMBEDDED_FILESYS libdriver no_printf_str no_kprintf_str no_kdebug ]
# DEVELOPMENT = [ EMBEDDED_BASE EMBEDDED_NET NFS VPN EMBEDDED_FILESYS libdriver netmibs development mach_assert config_dtrace ]
#
Expand Down
2 changes: 1 addition & 1 deletion bsd/conf/MASTER.ppc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#
# BASE = [ ppc mach medium config_dtrace vol pst gdb noprofiling simple_clock kernstack sysv_sem sysv_msg sysv_shm audit panic_info config_imageboot config_workqueue ]
# FILESYS = [ devfs revfs hfs journaling fdesc config_fse quota namedstreams fifo union config_volfs hfs_compression ]
# NETWORKING = [ inet inet6 compat_oldsock mrouting tcpdrop_synfin bpfilter ipdivert ipfirewall ipv6firewall ipfw2 dummynet traffic_mgt sendfile netmibs bond vlan gif stf zlib randomipid ifnet_input_chk ipflow ]
# NETWORKING = [ inet inet6 compat_oldsock tcpdrop_synfin bpfilter ipdivert ipfirewall ipv6firewall ipfw2 dummynet traffic_mgt sendfile netmibs bond vlan gif stf zlib randomipid ifnet_input_chk ipflow ]
# NFS = [ nfsclient nfsserver ]
# VPN = [ ipsec ]
# RELEASE = [ BASE NETWORKING NFS VPN FILESYS libdriver ]
Expand Down
6 changes: 3 additions & 3 deletions bsd/conf/MASTER.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
# Standard Apple Research Configurations:
# -------- ----- -------- ---------------
# BASE = [ intel mach medium config_dtrace vol pst gdb kernobjc fixpri simple_clock mdebug kernserv driverkit uxpr kernstack ipc_compat ipc_debug sysv_sem sysv_msg sysv_shm audit panic_info config_imageboot config_workqueue psynch ]
# FILESYS = [ devfs revfs hfs journaling fdesc config_fse quota namedstreams fifo union config_volfs hfs_compression ]
# NETWORKING = [ inet inet6 compat_oldsock mrouting tcpdrop_synfin bpfilter ipdivert ipfirewall ipv6firewall ipfw2 dummynet traffic_mgt sendfile netmibs bond vlan gif stf zlib randomipid ifnet_input_chk config_mbuf_jumbo ipflow ]
# FILESYS = [ devfs revfs hfs journaling fdesc config_fse quota namedstreams fifo union config_volfs hfs_compression config_imgsrc_access ]
# NETWORKING = [ inet inet6 compat_oldsock tcpdrop_synfin bpfilter ipdivert ipfirewall ipv6firewall ipfw2 dummynet traffic_mgt sendfile netmibs bond vlan gif stf zlib randomipid ifnet_input_chk config_mbuf_jumbo ipflow ]
# NFS = [ nfsclient nfsserver ]
# VPN = [ ipsec ]
# RELEASE = [ BASE NETWORKING NFS VPN FILESYS libdriver ]
Expand All @@ -56,7 +56,7 @@
#
# EMBEDDED_BASE = [ intel mach bsmall vol pst gdb kernobjc fixpri simple_clock mdebug kernserv driverkit uxpr kernstack ipc_compat ipc_debug sysv_sem sysv_msg sysv_shm audit panic_info config_imageboot config_workqueue psynch ]
# EMBEDDED_FILESYS = [ devfs hfs journaling fdesc fifo ]
# EMBEDDED_NET = [ inet compat_oldsock mrouting tcpdrop_synfin bpfilter config_mbuf_noexpand ]
# EMBEDDED_NET = [ inet compat_oldsock tcpdrop_synfin bpfilter config_mbuf_noexpand ]
# EMBEDDED = [ EMBEDDED_BASE EMBEDDED_NET VPN EMBEDDED_FILESYS libdriver no_printf_str no_kprintf_str no_kdebug ]
# DEVELOPMENT = [ EMBEDDED_BASE EMBEDDED_NET NFS VPN EMBEDDED_FILESYS libdriver netmibs development mach_assert ]
#
Expand Down
5 changes: 3 additions & 2 deletions bsd/conf/files
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ OPTIONS/ipfw2 optional ipfw2
OPTIONS/ipfirewall optional ipfirewall
OPTIONS/ipv6firewall optional ipv6firewall
OPTIONS/tcpdebug optional tcpdebug
OPTIONS/bridge optional bridge
OPTIONS/if_bridge optional if_bridge
OPTIONS/faith optional faith
OPTIONS/gif optional gif
OPTIONS/netat optional netat
Expand Down Expand Up @@ -200,7 +200,8 @@ bsd/kern/decmpfs.c standard

bsd/net/bpf.c optional bpfilter
bsd/net/bpf_filter.c optional bpfilter
bsd/net/bridge.c optional bridge
bsd/net/if_bridge.c optional if_bridge
bsd/net/bridgestp.c optional if_bridge
bsd/net/bsd_comp.c optional ppp_bsdcomp
bsd/net/if.c optional networking
bsd/net/if_atmsubr.c optional atm
Expand Down
6 changes: 6 additions & 0 deletions bsd/dev/i386/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, dynamic_acceleration,
sizeof(boolean_t),
cpu_thermal, "I", "Dynamic Acceleration Technology (Turbo Mode)");

SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, invariant_APIC_timer,
CTLTYPE_INT | CTLFLAG_RD,
(void *)offsetof(cpuid_thermal_leaf_t, invariant_APIC_timer),
sizeof(boolean_t),
cpu_thermal, "I", "Invariant APIC Timer");

SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, thresholds,
CTLTYPE_INT | CTLFLAG_RD,
(void *)offsetof(cpuid_thermal_leaf_t, thresholds),
Expand Down
2 changes: 1 addition & 1 deletion bsd/hfs/hfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ extern int hfs_btsync(struct vnode *vp, int sync_transaction);
extern void replace_desc(struct cnode *cp, struct cat_desc *cdp);

extern int hfs_vgetrsrc(struct hfsmount *hfsmp, struct vnode *vp,
struct vnode **rvpp, int can_drop_lock);
struct vnode **rvpp, int can_drop_lock, int error_on_unlinked);

extern int hfs_update(struct vnode *, int);

Expand Down
18 changes: 14 additions & 4 deletions bsd/hfs/hfs_cnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ static void hfs_reclaim_cnode(struct cnode *);

static int hfs_isordered(struct cnode *, struct cnode *);

inline int hfs_checkdeleted (struct cnode *cp) {
return ((cp->c_flag & (C_DELETED | C_NOEXISTS)) ? ENOENT : 0);
}


/*
* Last reference to an cnode. If necessary, write or delete it.
Expand Down Expand Up @@ -195,7 +199,7 @@ hfs_vnop_inactive(struct vnop_inactive_args *ap)
if ((cp->c_blocks > 0) && (forkcount == 1) && (vp != cp->c_rsrc_vp)) {
struct vnode *rvp = NULLVP;

error = hfs_vgetrsrc(hfsmp, vp, &rvp, FALSE);
error = hfs_vgetrsrc(hfsmp, vp, &rvp, FALSE, FALSE);
if (error)
goto out;
/*
Expand Down Expand Up @@ -612,9 +616,15 @@ hfs_getnewvnode(
return (ENOENT);
}

/* Hardlinks may need an updated catalog descriptor */
if ((cp->c_flag & C_HARDLINK) && descp->cd_nameptr && descp->cd_namelen > 0) {
replace_desc(cp, descp);
/*
* Hardlinks may need an updated catalog descriptor. However, if
* the cnode has already been marked as open-unlinked (C_DELETED), then don't
* replace its descriptor.
*/
if (!(hfs_checkdeleted(cp))) {
if ((cp->c_flag & C_HARDLINK) && descp->cd_nameptr && descp->cd_namelen > 0) {
replace_desc(cp, descp);
}
}
/* Check if we found a matching vnode */
if (*vpp != NULL)
Expand Down
10 changes: 10 additions & 0 deletions bsd/hfs/hfs_cnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ enum { kFinderInvisibleMask = 1 << 14 };
FTOC(fp)->c_rsrc_vp : \
FTOC(fp)->c_vp)

/*
* This is a helper function used for determining whether or not a cnode has become open
* unlinked in between the time we acquired its vnode and the time we acquire the cnode lock
* to start manipulating it. Due to the SMP nature of VFS, it is probably necessary to
* use this macro every time we acquire a cnode lock, as the content of the Cnode may have
* been modified in betweeen the lookup and a VNOP. Whether or not to call this is dependent
* upon the VNOP in question. Sometimes it is OK to use an open-unlinked file, for example, in,
* reading. But other times, such as on the source of a VNOP_RENAME, it should be disallowed.
*/
int hfs_checkdeleted (struct cnode *cp);

/*
* Test for a resource fork
Expand Down
5 changes: 3 additions & 2 deletions bsd/hfs/hfs_readwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -3296,6 +3296,7 @@ hfs_vnop_pageout(struct vnop_pageout_args *ap)
vm_offset_t a_pl_offset;
int a_flags;
int is_pageoutv2 = 0;
kern_return_t kret;

cp = VTOC(vp);
fp = VTOF(vp);
Expand Down Expand Up @@ -3339,9 +3340,9 @@ hfs_vnop_pageout(struct vnop_pageout_args *ap)
else {
request_flags = UPL_UBC_PAGEOUT | UPL_RET_ONLY_DIRTY;
}
ubc_create_upl(vp, ap->a_f_offset, ap->a_size, &upl, &pl, request_flags);
kret = ubc_create_upl(vp, ap->a_f_offset, ap->a_size, &upl, &pl, request_flags);

if (upl == (upl_t) NULL) {
if ((kret != KERN_SUCCESS) || (upl == (upl_t) NULL)) {
retval = EINVAL;
goto pageout_done;
}
Expand Down
Loading

0 comments on commit 7d720fa

Please sign in to comment.