Merge 6.1.49 into android14-6.1-lts

Changes in 6.1.49
	objtool/x86: Fix SRSO mess
	Revert "f2fs: don't reset unchangable mount option in f2fs_remount()"
	Revert "f2fs: fix to set flush_merge opt and show noflush_merge"
	Revert "f2fs: fix to do sanity check on direct node in truncate_dnode()"
	Linux 6.1.49

Change-Id: I612c9fa3a7a3c5b8c47eac6404873b5955217716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2023-09-02 20:24:44 +00:00
commit d8c0666a03
9 changed files with 39 additions and 19 deletions

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 6
PATCHLEVEL = 1
SUBLEVEL = 48
SUBLEVEL = 49
EXTRAVERSION =
NAME = Curry Ramen

View File

@ -3432,6 +3432,7 @@ static inline bool __is_valid_data_blkaddr(block_t blkaddr)
* file.c
*/
int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync);
void f2fs_truncate_data_blocks(struct dnode_of_data *dn);
int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock);
int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock);
int f2fs_truncate(struct inode *inode);

View File

@ -627,6 +627,11 @@ void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count)
dn->ofs_in_node, nr_free);
}
void f2fs_truncate_data_blocks(struct dnode_of_data *dn)
{
f2fs_truncate_data_blocks_range(dn, ADDRS_PER_BLOCK(dn->inode));
}
static int truncate_partial_data_page(struct inode *inode, u64 from,
bool cache_only)
{

View File

@ -925,7 +925,6 @@ static int truncate_node(struct dnode_of_data *dn)
static int truncate_dnode(struct dnode_of_data *dn)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode);
struct page *page;
int err;
@ -933,25 +932,16 @@ static int truncate_dnode(struct dnode_of_data *dn)
return 1;
/* get direct node */
page = f2fs_get_node_page(sbi, dn->nid);
page = f2fs_get_node_page(F2FS_I_SB(dn->inode), dn->nid);
if (PTR_ERR(page) == -ENOENT)
return 1;
else if (IS_ERR(page))
return PTR_ERR(page);
if (IS_INODE(page) || ino_of_node(page) != dn->inode->i_ino) {
f2fs_err(sbi, "incorrect node reference, ino: %lu, nid: %u, ino_of_node: %u",
dn->inode->i_ino, dn->nid, ino_of_node(page));
set_sbi_flag(sbi, SBI_NEED_FSCK);
f2fs_handle_error(sbi, ERROR_INVALID_NODE_REFERENCE);
f2fs_put_page(page, 1);
return -EFSCORRUPTED;
}
/* Make dnode_of_data for parameter */
dn->node_page = page;
dn->ofs_in_node = 0;
f2fs_truncate_data_blocks_range(dn, ADDRS_PER_BLOCK(dn->inode));
f2fs_truncate_data_blocks(dn);
err = truncate_node(dn);
if (err) {
f2fs_put_page(page, 1);

View File

@ -103,7 +103,6 @@ enum f2fs_error {
ERROR_INCONSISTENT_SIT,
ERROR_CORRUPTED_VERITY_XATTR,
ERROR_CORRUPTED_XATTR,
ERROR_INVALID_NODE_REFERENCE,
ERROR_MAX,
};

View File

@ -796,8 +796,11 @@ bool arch_is_retpoline(struct symbol *sym)
bool arch_is_rethunk(struct symbol *sym)
{
return !strcmp(sym->name, "__x86_return_thunk") ||
!strcmp(sym->name, "srso_untrain_ret") ||
!strcmp(sym->name, "srso_safe_ret") ||
!strcmp(sym->name, "retbleed_return_thunk");
return !strcmp(sym->name, "__x86_return_thunk");
}
bool arch_is_embedded_insn(struct symbol *sym)
{
return !strcmp(sym->name, "retbleed_return_thunk") ||
!strcmp(sym->name, "srso_safe_ret");
}

View File

@ -1164,16 +1164,33 @@ static int add_ignore_alternatives(struct objtool_file *file)
return 0;
}
/*
* Symbols that replace INSN_CALL_DYNAMIC, every (tail) call to such a symbol
* will be added to the .retpoline_sites section.
*/
__weak bool arch_is_retpoline(struct symbol *sym)
{
return false;
}
/*
* Symbols that replace INSN_RETURN, every (tail) call to such a symbol
* will be added to the .return_sites section.
*/
__weak bool arch_is_rethunk(struct symbol *sym)
{
return false;
}
/*
* Symbols that are embedded inside other instructions, because sometimes crazy
* code exists. These are mostly ignored for validation purposes.
*/
__weak bool arch_is_embedded_insn(struct symbol *sym)
{
return false;
}
#define NEGATIVE_RELOC ((void *)-1L)
static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn)
@ -1437,7 +1454,7 @@ static int add_jump_destinations(struct objtool_file *file)
* middle of another instruction. Objtool only
* knows about the outer instruction.
*/
if (sym && sym->return_thunk) {
if (sym && sym->embedded_insn) {
add_return_call(file, insn, false);
continue;
}
@ -2327,6 +2344,9 @@ static int classify_symbols(struct objtool_file *file)
if (arch_is_rethunk(func))
func->return_thunk = true;
if (arch_is_embedded_insn(func))
func->embedded_insn = true;
if (!strcmp(func->name, "__fentry__"))
func->fentry = true;

View File

@ -90,6 +90,7 @@ int arch_decode_hint_reg(u8 sp_reg, int *base);
bool arch_is_retpoline(struct symbol *sym);
bool arch_is_rethunk(struct symbol *sym);
bool arch_is_embedded_insn(struct symbol *sym);
int arch_rewrite_retpolines(struct objtool_file *file);

View File

@ -60,6 +60,7 @@ struct symbol {
u8 return_thunk : 1;
u8 fentry : 1;
u8 profiling_func : 1;
u8 embedded_insn : 1;
struct list_head pv_target;
};