Patch "udf: Fix NULL pointer dereference in udf_symlink function" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    udf: Fix NULL pointer dereference in udf_symlink function

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     udf-fix-null-pointer-dereference-in-udf_symlink-func.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 49ece004abf4183f7f5a2dcf5ccef274086e55d6
Author: Arturo Giusti <koredump@xxxxxxxxxxxxxx>
Date:   Tue May 18 12:34:57 2021 +0200

    udf: Fix NULL pointer dereference in udf_symlink function
    
    [ Upstream commit fa236c2b2d4436d9f19ee4e5d5924e90ffd7bb43 ]
    
    In function udf_symlink, epos.bh is assigned with the value returned
    by udf_tgetblk. The function udf_tgetblk is defined in udf/misc.c
    and returns the value of sb_getblk function that could be NULL.
    Then, epos.bh is used without any check, causing a possible
    NULL pointer dereference when sb_getblk fails.
    
    This fix adds a check to validate the value of epos.bh.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=213083
    Signed-off-by: Arturo Giusti <koredump@xxxxxxxxxxxxxx>
    Signed-off-by: Jan Kara <jack@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 77b6d89b9bcd..3c3d3b20889c 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -933,6 +933,10 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
 				iinfo->i_location.partitionReferenceNum,
 				0);
 		epos.bh = udf_tgetblk(sb, block);
+		if (unlikely(!epos.bh)) {
+			err = -ENOMEM;
+			goto out_no_entry;
+		}
 		lock_buffer(epos.bh);
 		memset(epos.bh->b_data, 0x00, bsize);
 		set_buffer_uptodate(epos.bh);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux