mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Steve French <sfrench@us.ibm.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [082/146] [CIFS] When mandatory encryption on share, fail mount
Date: Wed, 01 Jun 2011 17:00:18 +0900	[thread overview]
Message-ID: <20110601080346.248561465@blue.kroah.org> (raw)
In-Reply-To: <20110601080606.GA522@kroah.com>

2.6.38-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Steve French <sfrench@us.ibm.com>

commit 6848b7334b24b47aa3d0e70342ff839ffa95d5fa upstream.

    When mandatory encryption is configured in samba server on a
    share (smb.conf parameter "smb encrypt = mandatory") the
    server will hang up the tcp session when we try to send
    the first frame after the tree connect if it is not a
    QueryFSUnixInfo, this causes cifs mount to hang (it must
    be killed with ctl-c).  Move the QueryFSUnixInfo call
    earlier in the mount sequence, and check whether the SetFSUnixInfo
    fails due to mandatory encryption so we can return a sensible
    error (EACCES) on mount.

    In a future patch (for 2.6.40) we will support mandatory
    encryption.

Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/cifs/connect.c |   31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2431,7 +2431,7 @@ void reset_cifs_unix_caps(int xid, struc
 
 	if (!CIFSSMBQFSUnixInfo(xid, tcon)) {
 		__u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability);
-
+		cFYI(1, "unix caps which server supports %lld", cap);
 		/* check for reconnect case in which we do not
 		   want to change the mount behavior if we can avoid it */
 		if (vol_info == NULL) {
@@ -2449,6 +2449,9 @@ void reset_cifs_unix_caps(int xid, struc
 			}
 		}
 
+		if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)
+			cERROR(1, "per-share encryption not supported yet");
+
 		cap &= CIFS_UNIX_CAP_MASK;
 		if (vol_info && vol_info->no_psx_acl)
 			cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
@@ -2497,6 +2500,10 @@ void reset_cifs_unix_caps(int xid, struc
 			cFYI(1, "very large read cap");
 		if (cap & CIFS_UNIX_LARGE_WRITE_CAP)
 			cFYI(1, "very large write cap");
+		if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP)
+			cFYI(1, "transport encryption cap");
+		if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)
+			cFYI(1, "mandatory transport encryption cap");
 #endif /* CIFS_DEBUG2 */
 		if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
 			if (vol_info == NULL) {
@@ -2815,20 +2822,26 @@ try_mount_again:
 		goto remote_path_check;
 	}
 
-	/* do not care if following two calls succeed - informational */
-	if (!tcon->ipc) {
-		CIFSSMBQFSDeviceInfo(xid, tcon);
-		CIFSSMBQFSAttributeInfo(xid, tcon);
-	}
-
 	/* tell server which Unix caps we support */
-	if (tcon->ses->capabilities & CAP_UNIX)
+	if (tcon->ses->capabilities & CAP_UNIX) {
 		/* reset of caps checks mount to see if unix extensions
 		   disabled for just this mount */
 		reset_cifs_unix_caps(xid, tcon, sb, volume_info);
-	else
+		if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) &&
+		    (le64_to_cpu(tcon->fsUnixInfo.Capability) &
+		     CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)) {
+			rc = -EACCES;
+			goto mount_fail_check;
+		}
+	} else
 		tcon->unix_ext = 0; /* server does not support them */
 
+	/* do not care if following two calls succeed - informational */
+	if (!tcon->ipc) {
+		CIFSSMBQFSDeviceInfo(xid, tcon);
+		CIFSSMBQFSAttributeInfo(xid, tcon);
+	}
+
 	/* convert forward to back slashes in prepath here if needed */
 	if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) == 0)
 		convert_delimiter(cifs_sb->prepath, CIFS_DIR_SEP(cifs_sb));



  parent reply	other threads:[~2011-06-01  9:16 UTC|newest]

Thread overview: 155+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  8:06 [000/146] 2.6.38.8 stable review Greg KH
2011-06-01  7:58 ` [001/146] kmemleak: Do not return a pointer to an object that kmemleak did not get Greg KH
2011-06-01  7:58 ` [002/146] kmemleak: Initialise kmemleak after debug_objects_mem_init() Greg KH
2011-06-01  7:58 ` [003/146] [CPUFREQ] Fix _OSC UUID in pcc-cpufreq Greg KH
2011-06-01  7:59 ` [004/146] [CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks Greg KH
2011-06-01  7:59 ` [005/146] [CPUFREQ] Fix memory leak in cpufreq_stat Greg KH
2011-06-01  7:59 ` [006/146] net: recvmmsg: Strip MSG_WAITFORONE when calling recvmsg Greg KH
2011-06-01  7:59 ` [007/146] ftrace: Only update the function code on write to filter files Greg KH
2011-06-01  7:59 ` [008/146] [SCSI] qla2xxx: Fix hang during driver unload when vport is active Greg KH
2011-06-01  7:59 ` [009/146] [SCSI] qla2xxx: Fix virtual port failing to login after chip reset Greg KH
2011-06-01  7:59 ` [010/146] [SCSI] qla2xxx: Fix vport delete hang when logins are outstanding Greg KH
2011-06-01  7:59 ` [011/146] powerpc/kdump64: Dont reference freed memory as pacas Greg KH
2011-06-01  7:59 ` [012/146] powerpc/kexec: Fix memory corruption from unallocated slaves Greg KH
2011-06-01  7:59 ` [013/146] x86, cpufeature: Fix cpuid leaf 7 feature detection Greg KH
2011-06-01  7:59 ` [014/146] ath9k_hw: do noise floor calibration only on required chains Greg KH
2011-06-01  7:59 ` [015/146] ath9k_hw: fix power for the HT40 duplicate frames Greg KH
2011-06-01  7:59 ` [016/146] ath9k_hw: fix dual band assumption for XB113 Greg KH
2011-06-01  7:59 ` [017/146] ath9k_hw: Fix STA connection issues with AR9380 (XB113) Greg KH
2011-06-01  7:59 ` [018/146] powerpc: Set nr_cpu_ids early and use it to free PACAs Greg KH
2011-06-01  7:59 ` [019/146] powerpc/oprofile: Handle events that raise an exception without overflowing Greg KH
2011-06-01  7:59 ` [020/146] iwlagn: fix iwl_is_any_associated Greg KH
2011-06-01  7:59 ` [021/146] block: rescan partitions on invalidated devices on -ENOMEDIA Greg KH
2011-06-01  7:59 ` [022/146] block: move bd_set_size() above rescan_partitions() in Greg KH
2011-06-01  7:59 ` [023/146] paride: Convert to bdops->check_events() Greg KH
2011-06-01  7:59 ` [024/146] gdrom,viocd: " Greg KH
2011-06-01  7:59 ` [025/146] ide: " Greg KH
2011-06-01  7:59 ` [026/146] block: dont block events on excl write for non-optical Greg KH
2011-06-01  8:15   ` Tejun Heo
2011-06-01  8:58     ` Greg KH
2011-06-01  9:15       ` Jens Axboe
2011-06-03  6:02         ` Greg KH
2011-06-03  6:39           ` Jens Axboe
2011-06-01  7:59 ` [027/146] block: Fix discard topology stacking and reporting Greg KH
2011-06-01  7:59 ` [028/146] block: add proper state guards to __elv_next_request Greg KH
2011-06-01  7:59 ` [029/146] block: always allocate genhd->ev if check_events is Greg KH
2011-06-01  7:59 ` [030/146] mtd: mtdconcat: fix NAND OOB write Greg KH
2011-06-01  7:59 ` [031/146] mtd: return badblockbits back Greg KH
2011-06-01  7:59 ` [032/146] x86, 64-bit: Fix copy_[to/from]_user() checks for the Greg KH
2011-06-01  7:59 ` [033/146] ext4: fix possible use-after-free in Greg KH
2011-06-01  7:59 ` [034/146] iwlwifi: fix bugs in change_interface Greg KH
2011-06-01  7:59 ` [035/146] nl80211: Fix set_key regression with some drivers Greg KH
2011-06-01  7:59 ` [036/146] mac80211: fix a few RCU issues Greg KH
2011-06-01  7:59 ` [037/146] [PARISC] wire up fanotify syscalls Greg KH
2011-06-01  7:59 ` [038/146] [PARISC] wire up clock_adjtime syscall Greg KH
2011-06-01  7:59 ` [039/146] [PARISC] wire up the fhandle syscalls Greg KH
2011-06-01  8:45   ` [Stable-review] " Ben Hutchings
2011-06-01  8:58     ` Greg KH
2011-06-01  7:59 ` [040/146] [PARISC] wire up syncfs syscall Greg KH
2011-06-01  8:46   ` [Stable-review] " Ben Hutchings
2011-06-01  7:59 ` [041/146] drm: Send pending vblank events before disabling vblank Greg KH
2011-06-01  7:59 ` [042/146] pata_cm64x: fix boot crash on parisc Greg KH
2011-06-01  7:59 ` [043/146] ext3: Fix fs corruption when make_indexed_dir() fails Greg KH
2011-06-01  7:59 ` [044/146] jbd: Fix forever sleeping process in do_get_write_access() Greg KH
2011-06-01  7:59 ` [045/146] jbd: fix fsync() tid wraparound bug Greg KH
2011-06-01  7:59 ` [046/146] ext4: release page cache in ext4_mb_load_buddy error path Greg KH
2011-06-01  7:59 ` [047/146] bonding: 802.3ad - fix agg_device_up Greg KH
2011-06-01  7:59 ` [048/146] bridge: fix forwarding of IPv6 Greg KH
2011-06-01  7:59 ` [049/146] ieee802154: Remove hacked CFLAGS in net/ieee802154/Makefile Greg KH
2011-06-01  7:59 ` [050/146] irda: fix locking unbalance in irda_sendmsg Greg KH
2011-06-01  7:59 ` [051/146] inetpeer: reduce stack usage Greg KH
2011-06-01  7:59 ` [052/146] ipv6: Remove hoplimit initialization to -1 Greg KH
2011-06-01  7:59 ` [053/146] ipv6: udp: fix the wrong headroom check Greg KH
2011-06-01  7:59 ` [054/146] macvlan: fix panic if lowerdev in a bond Greg KH
2011-06-01  7:59 ` [055/146] net: Do not wrap sysctl igmp_max_memberships in IP_MULTICAST Greg KH
2011-06-01  7:59 ` [056/146] net: use hlist_del_rcu() in dev_change_name() Greg KH
2011-06-01  7:59 ` [057/146] Revert "bridge: Forward reserved group addresses if !STP" Greg KH
2011-06-01  7:59 ` [058/146] Revert "tcp: disallow bind() to reuse addr/port" Greg KH
2011-06-01  7:59 ` [059/146] SCTP: fix race between sctp_bind_addr_free() and sctp_bind_addr_conflict() Greg KH
2011-06-01  7:59 ` [060/146] tcp: len check is unnecessarily devastating, change to WARN_ON Greg KH
2011-06-01  7:59 ` [061/146] vlan: fix GVRP at dismantle time MIME-Version: 1.0 Greg KH
2011-06-01  7:59 ` [062/146] igmp: call ip_mc_clear_src() only when we have no users of ip_mc_list Greg KH
2011-06-01  7:59 ` [063/146] net: add skb_dst_force() in sock_queue_err_skb() Greg KH
2011-06-01  8:00 ` [064/146] sch_sfq: avoid giving spurious NET_XMIT_CN signals Greg KH
2011-06-01  8:00 ` [065/146] sctp: fix memory leak of the ASCONF queue when free asoc Greg KH
2011-06-01  8:00 ` [066/146] sch_sfq: fix peek() implementation Greg KH
2011-06-01  8:00 ` [067/146] bonding: prevent deadlock on slave store with alb mode (v3) Greg KH
2011-06-01  8:00 ` [068/146] [SCSI] mpt2sas: move even handling of Greg KH
2011-06-01  8:00 ` [069/146] [SCSI] bnx2i: Fixed packet error created when the sq_size is Greg KH
2011-06-01  8:00 ` [070/146] [SCSI] bnx2i: Updated the connection shutdown/cleanup Greg KH
2011-06-01  8:00 ` [071/146] [SCSI] Fix Ultrastor asm snippet Greg KH
2011-06-01  8:00 ` [072/146] [SCSI] target: Fix multi task->task_sg[] chaining logic bug Greg KH
2011-06-01  8:00 ` [073/146] [SCSI] target: Fix interrupt context bug with stats_lock and Greg KH
2011-06-01  8:00 ` [074/146] [SCSI] target: Fix bug with task_sg chained Greg KH
2011-06-01  8:00 ` [075/146] [SCSI] target: Fix task->task_execute_queue=1 clear bug + Greg KH
2011-06-01  8:00 ` [076/146] x86, ioapic: Fix potential resume deadlock Greg KH
2011-06-01  8:00 ` [077/146] x86, amd: Do not enable ARAT feature on AMD processors below Greg KH
2011-06-01  8:00 ` [078/146] x86, amd: Use _safe() msr access for GartTlbWlk disable code Greg KH
2011-06-01  8:00 ` [079/146] x86, cpufeature: Update CPU feature RDRND to RDRAND Greg KH
2011-06-01  8:00 ` [080/146] oprofile, x86: Enable preemption during pci device setup in Greg KH
2011-06-01  8:00 ` [081/146] rcu: Fix unpaired rcu_irq_enter() from locking selftests Greg KH
2011-06-01  8:00 ` Greg KH [this message]
2011-06-01  8:00 ` [083/146] staging: usbip: fix wrong endian conversion Greg KH
2011-06-01  8:00 ` [084/146] staging: r8712u: Fix driver to support ad-hoc mode Greg KH
2011-06-01  8:00 ` [085/146] Fix for buffer overflow in ldm_frag_add not sufficient Greg KH
2011-06-01  8:00 ` [086/146] seqlock: Dont smp_rmb in seqlock reader spin loop Greg KH
2011-06-01  8:00 ` [087/146] md: Fix race when creating a new md device Greg KH
2011-06-01  8:00 ` [088/146] md/bitmap: fix saving of events_cleared and other state Greg KH
2011-06-01  8:00 ` [089/146] mm: vmscan: correct use of pgdat_balanced in Greg KH
2011-06-01  8:00 ` [090/146] mm: vmscan: correctly check if reclaimer should schedule Greg KH
2011-06-01  8:00 ` [091/146] ips: use interruptible waits in ips-monitor Greg KH
2011-06-01  8:00 ` [092/146] ALSA: HDA: Use one dmic only for Dell Studio 1558 Greg KH
2011-06-01  8:00 ` [093/146] ALSA: HDA: Add quirk for Lenovo U350 Greg KH
2011-06-01  8:00 ` [094/146] ALSA: hda - Fix input-src parse in patch_analog.c Greg KH
2011-06-01  8:00 ` [095/146] ALSA: hda - Use LPIB for ATI/AMD chipsets as default Greg KH
2011-06-01  8:00 ` [096/146] ASoC: Ensure output PGA is enabled for line outputs in Greg KH
2011-06-01  8:00 ` [097/146] ASoC: Add some missing volume update bit sets for wm_hubs Greg KH
2011-06-01  8:00 ` [098/146] HID: magicmouse: ignore ivalid report id while switching Greg KH
2011-06-01  8:00 ` [099/146] mm/page_alloc.c: prevent unending loop in Greg KH
2011-06-01  8:00 ` [100/146] loop: limit max_part module param to DISK_MAX_PARTS Greg KH
2011-06-01  8:00 ` [101/146] loop: handle on-demand devices correctly Greg KH
2011-06-01  8:00 ` [102/146] i2c/writing-clients: Fix foo_driver.id_table Greg KH
2011-06-01  8:00 ` [103/146] USB: CP210x Add 4 Device IDs for AC-Services Devices Greg KH
2011-06-01  8:00 ` [104/146] USB: moto_modem: Add USB identifier for the Motorola VE240 Greg KH
2011-06-01  8:00 ` [105/146] USB: serial: ftdi_sio: adding support for TavIR STK500 Greg KH
2011-06-01  8:00 ` [106/146] USB: gadget: g_multi: fixed vendor and product ID in inf Greg KH
2011-06-01  8:00 ` [107/146] USB: gamin_gps: Fix for data transfer problems in native Greg KH
2011-06-01  8:00 ` [108/146] Bind only modem AT command endpoint to option module Greg KH
2011-06-01  8:00 ` [109/146] USB: cdc_acm: Fix oops when Droids MuIn LCD is connected Greg KH
2011-06-01  8:00 ` [110/146] xhci: Fix bug in control transfer cancellation Greg KH
2011-06-01  8:00 ` [111/146] usb/gadget: at91sam9g20 fix end point max packet size Greg KH
2011-06-01  8:00 ` [112/146] usb: gadget: rndis: dont test against req->length Greg KH
2011-06-01  8:00 ` [113/146] xhci: Fix full speed bInterval encoding Greg KH
2011-06-01  8:00 ` [114/146] xhci: Fix memory leak in ring cache deallocation Greg KH
2011-06-01  8:00 ` [115/146] xhci: Fix memory leak bug when dropping endpoints Greg KH
2011-06-01  8:00 ` [116/146] USB: option: add support for Huawei E353 device Greg KH
2011-06-01  8:00 ` [117/146] OHCI: fix regression caused by nVidia shutdown workaround Greg KH
2011-06-01  8:00 ` [118/146] USB: remove remaining usages of hcd->state from usbcore and Greg KH
2011-06-01  8:00 ` [119/146] [media] cx88: protect per-device driver list with device Greg KH
2011-06-01  8:00 ` [120/146] [media] cx88: fix locking of sub-driver operations Greg KH
2011-06-01  8:00 ` [121/146] [media] cx88: hold device lock during sub-driver Greg KH
2011-06-01  8:00 ` [122/146] sh: clkfwk: fixup clk_rate_table_build parameter in div6 Greg KH
2011-06-01  8:00 ` [123/146] sh: fixup fpu.o compile order Greg KH
2011-06-01  8:01 ` [124/146] p54usb: add zoom 4410 usbid Greg KH
2011-06-01  8:01 ` [125/146] eCryptfs: Allow 2 scatterlist entries for encrypted Greg KH
2011-06-01  8:01 ` [126/146] UBIFS: fix a rare memory leak in ro to rw remounting path Greg KH
2011-06-01  8:01 ` [127/146] kbuild: Fix GNU make v3.80 compatibility Greg KH
2011-06-01  8:01 ` [128/146] i8k: Avoid lahf in 64-bit code Greg KH
2011-06-01  8:01 ` [129/146] cpuidle: menu: fixed wrapping timers at 4.294 seconds Greg KH
2011-06-01  8:01 ` [130/146] idle governor: Avoid lock acquisition to read pm_qos before Greg KH
2011-06-01  8:01 ` [131/146] dm table: reject devices without request fns Greg KH
2011-06-01  8:01 ` [132/146] ARM: 6941/1: cache: ensure MVA is cacheline aligned in Greg KH
2011-06-01  8:01 ` [133/146] tmpfs: fix race between truncate and writepage Greg KH
2011-06-01  8:01 ` [134/146] atm: expose ATM device index in sysfs Greg KH
2011-06-01  8:01 ` [135/146] brd: limit max_part module param to DISK_MAX_PARTS Greg KH
2011-06-01  8:01 ` [136/146] brd: handle on-demand devices correctly Greg KH
2011-06-01  8:01 ` [137/146] drm/i915: fix user irq miss in BSD ring on g4x Greg KH
2011-06-01  8:01 ` [138/146] drm/radeon/evergreen/btc/fusion: setup hdp to invalidate and Greg KH
2011-06-01  8:01 ` [139/146] drm/radeon/kms: add wait idle ioctl for eg->cayman Greg KH
2011-06-01  8:01 ` [140/146] SUNRPC: Deal with the lack of a SYN_SENT sk->sk_state_change Greg KH
2011-06-01  8:01 ` [141/146] NFSv4: Handle expired stateids when the lease is still valid Greg KH
2011-06-01  8:01 ` [142/146] NFSv4.1: Fix the handling of NFS4ERR_SEQ_MISORDERED errors Greg KH
2011-06-01  8:01 ` [143/146] PCI: Add quirk for setting valid class for TI816X Endpoint Greg KH
2011-06-01  8:01 ` [144/146] xen mmu: fix a race window causing leave_mm BUG() Greg KH
2011-06-01  8:01 ` [145/146] ext4: Use schedule_timeout_interruptible() for waiting in Greg KH
2011-06-01  8:01 ` [146/146] AppArmor: fix oops in apparmor_setprocattr Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110601080346.248561465@blue.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfrench@us.ibm.com \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®