[ Upstream commit ccf16413e520164eb718cf8b22a30438da80ff23 ]
kernel ulong and compat_ulong_t may not be same width. Use type directly
to eliminate mismatches.
This would result in truncation rather than EFBIG for 32bit mode for
large disks.
Reviewed-by: Bart Van Assche <bvanassche(a)acm.org>
Signed-off-by: Khazhismel Kumykov <khazhy(a)google.com>
Reviewed-by: Chaitanya Kulkarni <kch(a)nvidia.com>
Link: https://lore.kernel.org/r/20220414224056.2875681-1-khazhy@google.com
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
[compat_ioctl is it's own file in 5.4-stable and earlier]
---
The original commit should apply to the newer stables, this should apply
to all the older stables.
block/compat_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index 7f053468b50d..d490ac220ba8 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -393,7 +393,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
return 0;
case BLKGETSIZE:
size = i_size_read(bdev->bd_inode);
- if ((size >> 9) > ~0UL)
+ if ((size >> 9) > ~(compat_ulong_t)0)
return -EFBIG;
return compat_put_ulong(arg, size >> 9);
--
2.36.0.rc0.470.gd361397f0d-goog
Hi Daniel,
On Mon, Apr 25, 2022 at 9:00 PM Daniel Harding <dharding(a)living180.net> wrote:
> The commit "Restrict usage of GPIO chip irq members before initialization" breaks suspend on a
> Dell Inspiron 5515 laptop in a very severe way.
Does this commit, which is already upstream in Torvald's tree, solve the issue?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/d…
Yours,
Linus Walleij
In function dvb_register_device() -> dvb_register_media_device() ->
dvb_create_media_entity(), dvb->entity is allocated and initialized. If
the initialization fails, it frees the dvb->entity, and return an error
code. The caller takes the error code and handles the error by calling
dvb_media_device_free(), which unregisters the entity and frees the
field again if it is not NULL. As dvb->entity may not NULLed in
dvb_create_media_entity() when the allocation of dvbdev->pad fails, a
double free may occur. This may also cause an Use After free in
media_device_unregister_entity().
Fix this by storing NULL to dvb->entity when it is freed.
Fixes: fcd5ce4b3936 ("media: dvb-core: fix a memory leak bug")
Cc: stable(a)vger.kernel.org
Cc: Wenwen Wang <wenwen(a)cs.uga.edu>
Signed-off-by: Keita Suzuki <keitasuzuki.park(a)sslab.ics.keio.ac.jp>
---
drivers/media/dvb-core/dvbdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 675d877a67b2..4597af108f4d 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -332,6 +332,7 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev,
GFP_KERNEL);
if (!dvbdev->pads) {
kfree(dvbdev->entity);
+ dvbdev->entity = NULL;
return -ENOMEM;
}
}
--
2.25.1
Good day! I know this email might be a surprise to you, due to the
fact that we have never met before, I got your email contact from
WORLD TRADE UNION and I believed that you will be of help to this deal
I am proposing to you.
I am Mrs. Sharon Sanosy, I need your assistant to help me retrieve my
late husband’s Fund $500,000,000.00 which he deposited in a SECURITY
BANK. He was CEO of SANOSYL ENERGY, OIL & GAS. TEXAS. My husband Dr.
PAUL POLMAN SANOSY died last year of the COVID19 pandemic, I wish to
have a deal with you regarding the fund.
As a result of his sudden death his business associates are trying to
rip me off my late husband’s assets and heirlooms which he had left
for me before his painful demise. I want you to help me retrieve the
FUND from the Bank, as my late Husband’s Business partner.
l ready and willing to divulge more information to you upon your
positive response. Please let me know your thoughts . Kindly reply
through this email: info(a)sanosylenergy.com
Yours faithfully,
Mrs. Sharon Sanosy
--
This email has been checked for viruses by AVG.
https://www.avg.com
All creation paths except for O_TMPFILE handle umask in the vfs directly
if the filesystem doesn't support or enable POSIX ACLs. If the filesystem
does then umask handling is deferred until posix_acl_create().
Because, O_TMPFILE misses umask handling in the vfs it will not honor
umask settings. Fix this by adding the missing umask handling.
Fixes: 60545d0d4610 ("[O_TMPFILE] it's still short a few helpers, but infrastructure should be OK now...")
Cc: <stable(a)vger.kernel.org> # 4.19+
Reported-by: Christian Brauner (Microsoft) <brauner(a)kernel.org>
Acked-by: Christian Brauner (Microsoft) <brauner(a)kernel.org>
Reviewed-by: Darrick J. Wong <djwong(a)kernel.org>
Signed-off-by: Yang Xu <xuyang2018.jy(a)fujitsu.com>
---
fs/namei.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/namei.c b/fs/namei.c
index 509657fdf4f5..73646e28fae0 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3521,6 +3521,8 @@ struct dentry *vfs_tmpfile(struct user_namespace *mnt_userns,
child = d_alloc(dentry, &slash_name);
if (unlikely(!child))
goto out_err;
+ if (!IS_POSIXACL(dir))
+ mode &= ~current_umask();
error = dir->i_op->tmpfile(mnt_userns, dir, child, mode);
if (error)
goto out_err;
--
2.27.0