Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64047
b: refs/heads/master
c: 0894910
h: refs/heads/master
i:
  64045: 94a97ef
  64043: 8c0e784
  64039: 6c3798a
  64031: 027a8c4
v: v3
  • Loading branch information
Linus Torvalds committed Aug 18, 2007
1 parent ea68af5 commit c0eb277
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fb0582f91fdd62b67bf54a440d7c79b19ed84da8
refs/heads/master: 0894910cce8d9105e5d8457fd8686fe96dc958eb
2 changes: 1 addition & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ P: Steve French
M: sfrench@samba.org
L: linux-cifs-client@lists.samba.org
L: samba-technical@lists.samba.org
W: http://us1.samba.org/samba/Linux_CIFS_client.html
W: http://linux-cifs.samba.org/
T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
S: Supported

Expand Down
54 changes: 12 additions & 42 deletions trunk/arch/i386/boot/edd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,12 @@

#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)

struct edd_dapa {
u8 pkt_size;
u8 rsvd;
u16 sector_cnt;
u16 buf_off, buf_seg;
u64 lba;
u64 buf_lin_addr;
};

/*
* Read the MBR (first sector) from a specific device.
*/
static int read_mbr(u8 devno, void *buf)
{
struct edd_dapa dapa;
u16 ax, bx, cx, dx, si;

memset(&dapa, 0, sizeof dapa);
dapa.pkt_size = sizeof(dapa);
dapa.sector_cnt = 1;
dapa.buf_off = (size_t)buf;
dapa.buf_seg = ds();
/* dapa.lba = 0; */

ax = 0x4200; /* Extended Read */
si = (size_t)&dapa;
dx = devno;
asm("pushfl; stc; int $0x13; setc %%al; popfl"
: "+a" (ax), "+S" (si), "+d" (dx)
: "m" (dapa)
: "ebx", "ecx", "edi", "memory");

if (!(u8)ax)
return 0; /* OK */
u16 ax, bx, cx, dx;

ax = 0x0201; /* Legacy Read, one sector */
cx = 0x0001; /* Sector 0-0-1 */
Expand All @@ -65,11 +37,10 @@ static int read_mbr(u8 devno, void *buf)
return -(u8)ax; /* 0 or -1 */
}

static u32 read_mbr_sig(u8 devno, struct edd_info *ei)
static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig)
{
int sector_size;
char *mbrbuf_ptr, *mbrbuf_end;
u32 mbrsig;
u32 buf_base, mbr_base;
extern char _end[];

Expand All @@ -85,15 +56,15 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei)

/* Make sure we actually have space on the heap... */
if (!(boot_params.hdr.loadflags & CAN_USE_HEAP))
return 0;
return -1;
if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr)
return 0;
return -1;

if (read_mbr(devno, mbrbuf_ptr))
return 0;
return -1;

mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
return mbrsig;
*mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
return 0;
}

static int get_edd_info(u8 devno, struct edd_info *ei)
Expand Down Expand Up @@ -160,6 +131,7 @@ void query_edd(void)
int do_edd = 1;
int devno;
struct edd_info ei, *edp;
u32 *mbrptr;

if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) {
if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip"))
Expand All @@ -168,7 +140,8 @@ void query_edd(void)
do_edd = 0;
}

edp = (struct edd_info *)boot_params.eddbuf;
edp = boot_params.eddbuf;
mbrptr = boot_params.edd_mbr_sig_buffer;

if (!do_edd)
return;
Expand All @@ -186,11 +159,8 @@ void query_edd(void)
boot_params.eddbuf_entries++;
}

if (do_mbr) {
u32 mbr_sig;
mbr_sig = read_mbr_sig(devno, &ei);
boot_params.edd_mbr_sig_buffer[devno-0x80] = mbr_sig;
}
if (do_mbr && !read_mbr_sig(devno, &ei, mbrptr++))
boot_params.edd_mbr_sig_buf_entries = devno-0x80+1;
}
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/boot/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void store_video_mode(void)

/* Not all BIOSes are clean with respect to the top bit */
boot_params.screen_info.orig_video_mode = ax & 0x7f;
boot_params.screen_info.orig_video_page = page;
boot_params.screen_info.orig_video_page = page >> 8;
}

/*
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/cifs/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ Version 1.50
Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is
done with "serverino" mount option). Add support for POSIX Unlink
(helps with certain sharing violation cases when server such as
Samba supports newer POSIX CIFS Protocol Extensions).
Samba supports newer POSIX CIFS Protocol Extensions). Add "nounix"
mount option to allow disabling the CIFS Unix Extensions for just
that mount. Fix hang on spinlock in find_writable_file (race when
reopening file after session crash).

Version 1.49
------------
Expand Down
13 changes: 13 additions & 0 deletions trunk/fs/cifs/README
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,26 @@ A partial list of the supported mount options follows:
noposixpaths If CIFS Unix extensions are supported, do not request
posix path name support (this may cause servers to
reject creatingfile with certain reserved characters).
nounix Disable the CIFS Unix Extensions for this mount (tree
connection). This is rarely needed, but it may be useful
in order to turn off multiple settings all at once (ie
posix acls, posix locks, posix paths, symlink support
and retrieving uids/gids/mode from the server) or to
work around a bug in server which implement the Unix
Extensions.
nobrl Do not send byte range lock requests to the server.
This is necessary for certain applications that break
with cifs style mandatory byte range locks (and most
cifs servers do not yet support requesting advisory
byte range locks).
remount remount the share (often used to change from ro to rw mounts
or vice versa)
servern Specify the server 's netbios name (RFC1001 name) to use
when attempting to setup a session to the server. This is
This is needed for mounting to some older servers (such
as OS/2 or Windows 98 and Windows ME) since they do not
support a default server name. A server name can be up
to 15 characters long and is usually uppercased.
sfu When the CIFS Unix Extensions are not negotiated, attempt to
create device files and fifos in a format compatible with
Services for Unix (SFU). In addition retrieve bits 10-12
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/cifs/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ u) DOS attrs - returned as pseudo-xattr in Samba format (check VFAT and NTFS for

v) mount check for unmatched uids

w) Add mount option for Linux extension disable per mount, and partial
disable per mount (uid off, symlink/fifo/mknod on but what about posix acls?)
w) Add support for new vfs entry points for setlease and fallocate

x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of
processes can proceed better in parallel (on the server)
Expand Down
33 changes: 23 additions & 10 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,25 @@ static int cifs_readpage(struct file *file, struct page *page)
return rc;
}

static int is_inode_writable(struct cifsInodeInfo *cifs_inode)
{
struct cifsFileInfo *open_file;

read_lock(&GlobalSMBSeslock);
list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
if (open_file->closePend)
continue;
if (open_file->pfile &&
((open_file->pfile->f_flags & O_RDWR) ||
(open_file->pfile->f_flags & O_WRONLY))) {
read_unlock(&GlobalSMBSeslock);
return 1;
}
}
read_unlock(&GlobalSMBSeslock);
return 0;
}

/* We do not want to update the file size from server for inodes
open for write - to avoid races with writepage extending
the file - in the future we could consider allowing
Expand All @@ -1912,19 +1931,13 @@ static int cifs_readpage(struct file *file, struct page *page)
page caching in the current Linux kernel design */
int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
{
struct cifsFileInfo *open_file = NULL;

if (cifsInode)
open_file = find_writable_file(cifsInode);
if (!cifsInode)
return 1;

if (open_file) {
if (is_inode_writable(cifsInode)) {
/* This inode is open for write at least once */
struct cifs_sb_info *cifs_sb;

/* there is not actually a write pending so let
this handle go free and allow it to
be closable if needed */
atomic_dec(&open_file->wrtPending);

cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb);
if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) {
/* since no page cache to corrupt on directio
Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/cifs/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,

/* 2000 big enough to fit max user, domain, NOS name etc. */
str_area = kmalloc(2000, GFP_KERNEL);
if (str_area == NULL) {
cifs_small_buf_release(smb_buf);
return -ENOMEM;
}
bcc_ptr = str_area;

ses->flags &= ~CIFS_SES_LANMAN;
Expand Down
13 changes: 9 additions & 4 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,12 @@ int flush_old_exec(struct linux_binprm * bprm)
*/
current->mm->task_size = TASK_SIZE;

if (bprm->e_uid != current->euid || bprm->e_gid != current->egid ||
file_permission(bprm->file, MAY_READ) ||
(bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) {
if (bprm->e_uid != current->euid || bprm->e_gid != current->egid) {
suid_keys(current);
set_dumpable(current->mm, suid_dumpable);
current->pdeath_signal = 0;
} else if (file_permission(bprm->file, MAY_READ) ||
(bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) {
suid_keys(current);
set_dumpable(current->mm, suid_dumpable);
}
Expand Down Expand Up @@ -1177,8 +1180,10 @@ void compute_creds(struct linux_binprm *bprm)
{
int unsafe;

if (bprm->e_uid != current->uid)
if (bprm->e_uid != current->uid) {
suid_keys(current);
current->pdeath_signal = 0;
}
exec_keys(current);

task_lock(current);
Expand Down

0 comments on commit c0eb277

Please sign in to comment.