Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-03 Thread Chengyu Song
Right. Should have checked the commit history ... this has been brought up before: > Peter Zijlstra - May 18, 2016, 5:02 p.m. > > > +struct task_struct *task_rcu_dereference(struct task_struct **ptask) > > +{ > > + struct task_struct *task; > > + struct sighand_struct *sighand; > > I think

Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized

2018-05-03 Thread Chengyu Song
Right. Should have checked the commit history ... this has been brought up before: > Peter Zijlstra - May 18, 2016, 5:02 p.m. > > > +struct task_struct *task_rcu_dereference(struct task_struct **ptask) > > +{ > > + struct task_struct *task; > > + struct sighand_struct *sighand; > > I think

Re: [LKP] [ocfs2] e2ac55b6a8e: ocfs2_init:1612 ERROR: Unable to create ocfs2 debugfs root

2015-04-20 Thread Chengyu Song
> On Apr 20, 2015, at 5:10 PM, Andrew Morton wrote: > > On Mon, 20 Apr 2015 13:50:38 -0700 Linus Torvalds > wrote: > >> On Sun, Apr 19, 2015 at 8:45 PM, Chengyu Song wrote: >>> >>> As suggested in the patch, -19 (-ENODEV) happens when debugfs is

Re: [LKP] [ocfs2] e2ac55b6a8e: ocfs2_init:1612 ERROR: Unable to create ocfs2 debugfs root

2015-04-20 Thread Chengyu Song
On Apr 20, 2015, at 5:10 PM, Andrew Morton a...@linux-foundation.org wrote: On Mon, 20 Apr 2015 13:50:38 -0700 Linus Torvalds torva...@linux-foundation.org wrote: On Sun, Apr 19, 2015 at 8:45 PM, Chengyu Song cson...@gatech.edu wrote: As suggested in the patch, -19 (-ENODEV) happens

Re: [LKP] [ocfs2] e2ac55b6a8e: ocfs2_init:1612 ERROR: Unable to create ocfs2 debugfs root

2015-04-19 Thread Chengyu Song
Hi Ying, As suggested in the patch, -19 (-ENODEV) happens when debugfs is not configured (see include/linux/debugfs.h). So if debugfs is necessary for the functionality, in Kconfig, we should either declare it as a dependency, or auto select it. Chengyu > On Apr 19, 2015, at 11:25 PM, Huang

Re: [LKP] [ocfs2] e2ac55b6a8e: ocfs2_init:1612 ERROR: Unable to create ocfs2 debugfs root

2015-04-19 Thread Chengyu Song
Hi Ying, As suggested in the patch, -19 (-ENODEV) happens when debugfs is not configured (see include/linux/debugfs.h). So if debugfs is necessary for the functionality, in Kconfig, we should either declare it as a dependency, or auto select it. Chengyu On Apr 19, 2015, at 11:25 PM, Huang

Re: [PATCH 1/1] nfsd: incorrect check for debugfs returns

2015-03-25 Thread Chengyu Song
Cool. Sent. > On Mar 25, 2015, at 4:09 PM, J. Bruce Fields wrote: > > On Wed, Mar 25, 2015 at 12:41:29PM -0400, Chengyu Song wrote: >> There may be a simpler solution, declare NFSD_FAULT_INJECTION has dependency >> on DEBUG_FS, or automatically select DEBUG_FS. &g

[PATCH 1/1] nfsd: NFSD_FAULT_INJECTION depends on DEBUG_FS

2015-03-25 Thread Chengyu Song
NFSD_FAULT_INJECTION depends on DEBUG_FS, otherwise the debugfs_create_* interface may return unexpected error -ENODEV, and cause system crash. Signed-off-by: Chengyu Song --- fs/nfsd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig

Re: [PATCH 1/1] cifs: potential missing check for posix_lock_file_wait

2015-03-25 Thread Chengyu Song
> On Mar 24, 2015, at 10:29 PM, Steve French wrote: > > On Tue, Mar 24, 2015 at 7:18 PM, Chengyu Song wrote: >> posix_lock_file_wait may fail under certain circumstances, and its result is >> usually checked/returned. But given the complexity of cifs, I'm not

Re: [PATCH 1/1] nfsd: incorrect check for debugfs returns

2015-03-25 Thread Chengyu Song
interface may change in the future. Does this sounds like a solution? If so, I can submit a patch for Kconfig. Best, Chengyu > On Mar 25, 2015, at 11:17 AM, J. Bruce Fields wrote: > > On Mon, Mar 23, 2015 at 10:58:05PM -0400, Chengyu Song wrote: >> debugfs_create_dir and debugfs_create_

Re: [PATCH 1/1] cifs: potential missing check for posix_lock_file_wait

2015-03-25 Thread Chengyu Song
On Mar 24, 2015, at 10:29 PM, Steve French smfre...@gmail.com wrote: On Tue, Mar 24, 2015 at 7:18 PM, Chengyu Song cson...@gatech.edu wrote: posix_lock_file_wait may fail under certain circumstances, and its result is usually checked/returned. But given the complexity of cifs, I'm not sure

Re: [PATCH 1/1] nfsd: incorrect check for debugfs returns

2015-03-25 Thread Chengyu Song
interface may change in the future. Does this sounds like a solution? If so, I can submit a patch for Kconfig. Best, Chengyu On Mar 25, 2015, at 11:17 AM, J. Bruce Fields bfie...@fieldses.org wrote: On Mon, Mar 23, 2015 at 10:58:05PM -0400, Chengyu Song wrote: debugfs_create_dir

[PATCH 1/1] nfsd: NFSD_FAULT_INJECTION depends on DEBUG_FS

2015-03-25 Thread Chengyu Song
NFSD_FAULT_INJECTION depends on DEBUG_FS, otherwise the debugfs_create_* interface may return unexpected error -ENODEV, and cause system crash. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/nfsd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/Kconfig b

Re: [PATCH 1/1] nfsd: incorrect check for debugfs returns

2015-03-25 Thread Chengyu Song
Cool. Sent. On Mar 25, 2015, at 4:09 PM, J. Bruce Fields bfie...@fieldses.org wrote: On Wed, Mar 25, 2015 at 12:41:29PM -0400, Chengyu Song wrote: There may be a simpler solution, declare NFSD_FAULT_INJECTION has dependency on DEBUG_FS, or automatically select DEBUG_FS. Oh, I forgot

[PATCH 1/1] ufs: missing check for block_truncate_page

2015-03-24 Thread Chengyu Song
block_truncate_page may fail under certain circumstances, so its result should be checked. Signed-off-by: Chengyu Song --- fs/ufs/truncate.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index f04f89f..8b41f07 100644 --- a/fs/ufs

[PATCH 1/1] hfsplus: incorrect return value

2015-03-24 Thread Chengyu Song
In case of memory allocation error, the return should be -ENOMEM, instead of -ENOSPC. Signed-off-by: Chengyu Song --- fs/hfsplus/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index f0235c1..3074609 100644 --- a/fs/hfsplus/dir.c

[PATCH 1/1] hfs: incorrect return values

2015-03-24 Thread Chengyu Song
In case of memory allocation error, the return should be -ENOMEM, instead of -ENOSPC. Signed-off-by: Chengyu Song --- fs/hfs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 1455668..36d1a6a 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs

[PATCH 1/1] cifs: potential missing check for posix_lock_file_wait

2015-03-24 Thread Chengyu Song
posix_lock_file_wait may fail under certain circumstances, and its result is usually checked/returned. But given the complexity of cifs, I'm not sure if the result is intentially left unchecked and always expected to succeed. Signed-off-by: Chengyu Song --- fs/cifs/file.c | 4 ++-- 1 file

[PATCH 1/1] logfs: incorrect check for read_cache_page return

2015-03-24 Thread Chengyu Song
read_cache_page returns -EIO on error, so the return should be checked against ERROR_VALUE instead of NULL. Signed-off-by: Chengyu Song --- fs/logfs/segment.c | 4 ++-- fs/logfs/super.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/logfs/segment.c b/fs/logfs

[PATCH 1/1] btrfs: incorrect handling for fiemap_fill_next_extent return

2015-03-24 Thread Chengyu Song
fiemap_fill_next_extent returns 0 on success, -errno on error, 1 if this was the last extent that will fit in user array. If 1 is returned, the return value may eventually returned to user space, which should not happen, according to manpage of ioctl. Signed-off-by: Chengyu Song --- fs/btrfs

[PATCH 1/1] btrfs: incorrect handling for fiemap_fill_next_extent return

2015-03-24 Thread Chengyu Song
fiemap_fill_next_extent returns 0 on success, -errno on error, 1 if this was the last extent that will fit in user array. If 1 is returned, the return value may eventually returned to user space, which should not happen, according to manpage of ioctl. Signed-off-by: Chengyu Song cson

[PATCH 1/1] logfs: incorrect check for read_cache_page return

2015-03-24 Thread Chengyu Song
read_cache_page returns -EIO on error, so the return should be checked against ERROR_VALUE instead of NULL. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/logfs/segment.c | 4 ++-- fs/logfs/super.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/logfs

[PATCH 1/1] cifs: potential missing check for posix_lock_file_wait

2015-03-24 Thread Chengyu Song
posix_lock_file_wait may fail under certain circumstances, and its result is usually checked/returned. But given the complexity of cifs, I'm not sure if the result is intentially left unchecked and always expected to succeed. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/cifs/file.c | 4

[PATCH 1/1] ufs: missing check for block_truncate_page

2015-03-24 Thread Chengyu Song
block_truncate_page may fail under certain circumstances, so its result should be checked. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/ufs/truncate.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index f04f89f..8b41f07

[PATCH 1/1] hfsplus: incorrect return value

2015-03-24 Thread Chengyu Song
In case of memory allocation error, the return should be -ENOMEM, instead of -ENOSPC. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/hfsplus/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index f0235c1..3074609 100644

[PATCH 1/1] hfs: incorrect return values

2015-03-24 Thread Chengyu Song
In case of memory allocation error, the return should be -ENOMEM, instead of -ENOSPC. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/hfs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 1455668..36d1a6a 100644 --- a/fs/hfs

[PATCH 1/1] ocfs2: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
with the same #ifdef CONFIG_DEBUG_FS. But I'm not sure if this would break any functionality, as only OCFS2_FS_STATS declares dependency on DEBUG_FS. Signed-off-by: Chengyu Song --- fs/ocfs2/cluster/heartbeat.c | 42 +++--- fs/ocfs2/dlmglue.c | 2 +- fs

[PATCH 1/1] nfsd: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
debugfs_create_dir and debugfs_create_file may return -ENODEV when debugfs is not configured, so the return value should be checked against ERROR_VALUE as well, otherwise the later dereference of the dentry pointer would crash the kernel. Signed-off-by: Chengyu Song --- fs/nfsd/fault_inject.c

[PATCH 1/1] gfs2: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
debugfs_create_dir and debugfs_create_file may return -ENODEV when debugfs is not configured, so the return value should be checked against ERROR_VALUE as well, otherwise the later dereference of the dentry pointer would crash the kernel. Signed-off-by: Chengyu Song --- fs/gfs2/glock.c | 47

[PATCH 1/1] dlm: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
debugfs_create_dir and debugfs_create_file may return -ENODEV when debugfs is not configured, so the return value should be checked against ERROR_VALUE as well, otherwise the later dereference of the dentry pointer would crash the kernel. Signed-off-by: Chengyu Song --- fs/dlm/debug_fs.c | 70

[PATCH 1/1] ocfs2: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
with the same #ifdef CONFIG_DEBUG_FS. But I'm not sure if this would break any functionality, as only OCFS2_FS_STATS declares dependency on DEBUG_FS. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/ocfs2/cluster/heartbeat.c | 42 +++--- fs/ocfs2/dlmglue.c

[PATCH 1/1] dlm: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
debugfs_create_dir and debugfs_create_file may return -ENODEV when debugfs is not configured, so the return value should be checked against ERROR_VALUE as well, otherwise the later dereference of the dentry pointer would crash the kernel. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs/dlm

[PATCH 1/1] gfs2: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
debugfs_create_dir and debugfs_create_file may return -ENODEV when debugfs is not configured, so the return value should be checked against ERROR_VALUE as well, otherwise the later dereference of the dentry pointer would crash the kernel. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs

[PATCH 1/1] nfsd: incorrect check for debugfs returns

2015-03-23 Thread Chengyu Song
debugfs_create_dir and debugfs_create_file may return -ENODEV when debugfs is not configured, so the return value should be checked against ERROR_VALUE as well, otherwise the later dereference of the dentry pointer would crash the kernel. Signed-off-by: Chengyu Song cson...@gatech.edu --- fs