2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-04 03:33:58 +08:00

File locking fixes for v5.11

-----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEES8DXskRxsqGE6vXTAA5oQRlWghUFAl/XZLITHGpsYXl0b25A
 a2VybmVsLm9yZwAKCRAADmhBGVaCFcqBD/9M40l1rZ5cq62f4j9/17jd8TDOfCCu
 VFhngc7DzvlVQMSktvoQLJlRs/SDFQGr88RrzWp6xAwJO9F60/4zVFSrbfYfjEid
 3hhIq8WioZotsGH3OWLArLUFLlLjtuNAP7WnLmacrqkx3y3BKGe5spKn9bxBxlgf
 trRtXITf8fJ5K8eSooRYf28YyugRDa+Ue/Pe0TjWudzgcCp1dlWxQKt9Ag0N+q+E
 6t5W5MgWWkfVcCX8Z2foL7I6Iqq4dqBfwZcopYjFHB9B+E6TN9rr6GA88xtKEaWG
 4nSZ7GKksu1oNb3amFdE5IWFYuAuLh2+TQGaJdhzcX08CstdhuPPRehuvCCW5I8l
 A9719WR6BW+KHHq4Id4eqpFR0g6y5Lx1JqBCsfIORuqna3pu19d9z+idVH50/TUw
 gGVRs7txfSU0NPIpQaX2z96S3ZQZZmelSIzj9+sYIPe5u8LCBtO8PVyT/N0qXvzL
 nf5t7rZGaTrUcGSeuPki01AhHbUNEx9EFnMJ5QuuXhPRq7WlP+BoQmLolRtuRxiF
 KcMvvpWjgD9MfkHWOFDsTnQCquQk8mb0R7YcFWbomMmxI3JQdDly3JjKn519LQvO
 mb320naW/oxnXHsaMHMM08azHsB+KhY84tW9c2iPB29swvTmOUrxXyhxdcFE3ayr
 UezM2hjt/zT61w==
 =rDoO
 -----END PGP SIGNATURE-----

Merge tag 'locks-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux

Pull file locking fixes from Jeff Layton:
 "A fix for some undefined integer overflow behavior, a typo in a
  comment header, and a fix for a potential deadlock involving internal
  senders of SIGIO/SIGURG"

* tag 'locks-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
  fcntl: Fix potential deadlock in send_sig{io, urg}()
  locks: fix a typo at a kernel-doc markup
  locks: Fix UBSAN undefined behaviour in flock64_to_posix_lock
This commit is contained in:
Linus Torvalds 2020-12-15 18:34:15 -08:00
commit a725cb4d70
2 changed files with 8 additions and 6 deletions

View File

@ -781,9 +781,10 @@ void send_sigio(struct fown_struct *fown, int fd, int band)
{
struct task_struct *p;
enum pid_type type;
unsigned long flags;
struct pid *pid;
read_lock(&fown->lock);
read_lock_irqsave(&fown->lock, flags);
type = fown->pid_type;
pid = fown->pid;
@ -804,7 +805,7 @@ void send_sigio(struct fown_struct *fown, int fd, int band)
read_unlock(&tasklist_lock);
}
out_unlock_fown:
read_unlock(&fown->lock);
read_unlock_irqrestore(&fown->lock, flags);
}
static void send_sigurg_to_task(struct task_struct *p,
@ -819,9 +820,10 @@ int send_sigurg(struct fown_struct *fown)
struct task_struct *p;
enum pid_type type;
struct pid *pid;
unsigned long flags;
int ret = 0;
read_lock(&fown->lock);
read_lock_irqsave(&fown->lock, flags);
type = fown->pid_type;
pid = fown->pid;
@ -844,7 +846,7 @@ int send_sigurg(struct fown_struct *fown)
read_unlock(&tasklist_lock);
}
out_unlock_fown:
read_unlock(&fown->lock);
read_unlock_irqrestore(&fown->lock, flags);
return ret;
}

View File

@ -542,7 +542,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
if (l->l_len > 0) {
if (l->l_len - 1 > OFFSET_MAX - fl->fl_start)
return -EOVERFLOW;
fl->fl_end = fl->fl_start + l->l_len - 1;
fl->fl_end = fl->fl_start + (l->l_len - 1);
} else if (l->l_len < 0) {
if (fl->fl_start + l->l_len < 0)
@ -750,7 +750,7 @@ static void __locks_wake_up_blocks(struct file_lock *blocker)
}
/**
* locks_delete_lock - stop waiting for a file lock
* locks_delete_block - stop waiting for a file lock
* @waiter: the lock which was waiting
*
* lockd/nfsd need to disconnect the lock while working on it.