+ /*+ * some Samsung Android phones in modem mode have the same ID+ * as SPH-I500, but they are ACM devices, so dont bind to them+ */+ if (id->idVendor == SAMSUNG_VENDOR_ID &&+ id->idProduct == SAMSUNG_SPH_I500_ID &&+ serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM &&+ serial->dev->descriptor.bDeviceSubClass ==+ USB_CDC_SUBCLASS_ACM)+ return -ENODEV;+ if (serial->dev->actconfig->desc.bConfigurationValue != 1) { dev_err(&serial->dev->dev, "active config #%d != 1 ??\n", serial->dev->actconfig->desc.bConfigurationValue);diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.cindex b582f09..88ba4d4 100644--- a/fs/ecryptfs/inode.c+++ b/fs/ecryptfs/inode.c@@ -988,6 +988,8 @@ int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry), ecryptfs_dentry_to_lower(dentry), &lower_stat); if (!rc) {+ fsstack_copy_attr_all(dentry->d_inode,+ ecryptfs_inode_to_lower(dentry->d_inode), NULL); generic_fillattr(dentry->d_inode, stat); stat->blocks = lower_stat.blocks; }diff --git a/fs/eventpoll.c b/fs/eventpoll.cindex 085c5c0..b0286c6 100644--- a/fs/eventpoll.c+++ b/fs/eventpoll.c@@ -63,6 +63,13 @@ * cleanup path and it is also acquired by eventpoll_release_file() * if a file has been pushed inside an epoll set and it is then * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL).+ * It is also acquired when inserting an epoll fd onto another epoll+ * fd. We do this so that we walk the epoll tree and ensure that this+ * insertion does not create a cycle of epoll file descriptors, which+ * could lead to deadlock. We need a global mutex to prevent two+ * simultaneous inserts (A into B and B into A) from racing and+ * constructing a cycle without either insert observing that it is+ * going to. * It is possible to drop the "ep->mtx" and to use the global * mutex "epmutex" (together with "ep->lock") to have it working, * but having "ep->mtx" will make the interface more scalable.@@ -227,6 +234,9 @@ static int max_user_watches __read_mostly; */ static DEFINE_MUTEX(epmutex);

+ /*+ * When we insert an epoll file descriptor, inside another epoll file+ * descriptor, there is the change of creating closed loops, which are+ * better be handled here, than in more critical paths.+ *+ * We hold epmutex across the loop check and the insert in this case, in+ * order to prevent two separate inserts from racing and each doing the+ * insert "at the same time" such that ep_loop_check passes on both+ * before either one does the insert, thereby creating a cycle.+ */+ if (unlikely(is_file_epoll(tfile) && op == EPOLL_CTL_ADD)) {+ mutex_lock(&epmutex);+ did_lock_epmutex = 1;+ error = -ELOOP;+ if (ep_loop_check(ep, tfile) != 0)+ goto error_tgt_fput;+ }++ mutex_lock(&ep->mtx);

+ blks_per_cluster = XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_blocklog;++ /*+ * For bulkstat and handle lookups, we have an untrusted inode number+ * that we have to verify is valid. We cannot do this just by reading+ * the inode buffer as it may have been unlinked and removed leaving+ * inodes in stale state on disk. Hence we have to do a btree lookup+ * in all cases where an untrusted inode number is passed.+ */+ if (flags & XFS_IGET_UNTRUSTED) {+ error = xfs_imap_lookup(mp, tp, agno, agino, agbno,+ &chunk_agbno, &offset_agbno, flags);+ if (error)+ return error;+ goto out_map;+ }+ /* * If the inode cluster size is the same as the blocksize or * smaller we get to the buffer by simple arithmetics.@@ -1280,24 +1363,6 @@ xfs_imap( return 0; }

-STATIC void-xfs_bulkstat_one_dinode(- xfs_mount_t *mp, /* mount point for filesystem */- xfs_ino_t ino, /* inode number to get data for */- xfs_dinode_t *dic, /* dinode inode pointer */- xfs_bstat_t *buf) /* return buffer */-{- /*- * The inode format changed when we moved the link count and- * made it 32 bits long. If this is an old format inode,- * convert it in memory to look like a new one. If it gets- * flushed to disk we will convert back before flushing or- * logging it. We zero out the new projid field and the old link- * count field. We'll handle clearing the pad field (the remains- * of the old uuid field) when we actually convert the inode to- * the new format. We don't change the version number so that we- * can distinguish this from a real new format inode.- */- if (dic->di_version == 1) {- buf->bs_nlink = be16_to_cpu(dic->di_onlink);- buf->bs_projid = 0;- } else {- buf->bs_nlink = be32_to_cpu(dic->di_nlink);- buf->bs_projid = be16_to_cpu(dic->di_projid);- }+ error = formatter(buffer, ubsize, ubused, buf);

+/**+ * get_task_cred - Get another task's objective credentials+ * @task: The task to query+ *+ * Get the objective credentials of a task, pinning them so that they can't go+ * away. Accessing a task's credentials directly is not permitted.+ *+ * The caller must also make sure task doesn't get deleted, either by holding a+ * ref on task or by holding tasklist_lock to prevent it from being unlinked.+ */+const struct cred *get_task_cred(struct task_struct *task)+{+ const struct cred *cred;++ rcu_read_lock();++ do {+ cred = __task_cred((task));+ BUG_ON(!cred);+ } while (!atomic_inc_not_zero(&((struct cred *)cred)->usage));++ rcu_read_unlock();+ return cred;+}+ /* * Allocate blank credentials, such that the credentials can be filled in at a * later date without risk of ENOMEM.@@ -230,13 +255,13 @@ struct cred *cred_alloc_blank(void) #endif

/* See is we support the id. Supported IDs have name and * length fields set, so that we can allocated and use * them. We can safely just check for name, for without the * name, we can't allocate the TFM. */- if (!sctp_hmac_list[id].hmac_name)+ if (!sctp_hmac_list[id].hmac_name) {+ id = 0; continue;+ }