| To: | "Geyslan G. Bem" <geyslan@xxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] xfs: fix possible NULL dereference |
| From: | Eric Sandeen <sandeen@xxxxxxxxxxx> |
| Date: | Mon, 21 Oct 2013 15:58:23 -0500 |
| Cc: | kernel-br@xxxxxxxxxxxxxxxx, Alex Elder <elder@xxxxxxxxxx>, Ben Myers <bpm@xxxxxxx>, open list <linux-kernel@xxxxxxxxxxxxxxx>, supporter:XFS FILESYSTEM <xfs@xxxxxxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1382380366-26540-1-git-send-email-geyslan@xxxxxxxxx> |
| References: | <1382380366-26540-1-git-send-email-geyslan@xxxxxxxxx> |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
On 10/21/13 1:32 PM, Geyslan G. Bem wrote:
> This patch puts a 'break' in the true branch, avoiding the 'icptr->ic_next'
> dereferencing.
Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>
Hm, yeah - cmn_err(CE_PANIC, " " ); used to BUG_ON, but the newer
xfs_emerg() doesn't.
Dave, was that intentional?
I wonder if there are more spots after xfs_emerg()'s which aren't
defensive, because the code used to just panic there.
-Eric
> Signed-off-by: Geyslan G. Bem <geyslan@xxxxxxxxx>
> ---
> fs/xfs/xfs_log.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index a2dea108..8cdeb7e 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -3703,8 +3703,10 @@ xlog_verify_iclog(
> spin_lock(&log->l_icloglock);
> icptr = log->l_iclog;
> for (i=0; i < log->l_iclog_bufs; i++) {
> - if (icptr == NULL)
> + if (!icptr) {
> xfs_emerg(log->l_mp, "%s: invalid ptr", __func__);
> + break;
> + }
> icptr = icptr->ic_next;
> }
> if (icptr != log->l_iclog)
>
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH V4 0/2] xfstests XFS: verify extended attributes after multi-stream xfsdump/xfsrestore are not lost, Rich Johnston |
|---|---|
| Next by Date: | [XFS updates] XFS development tree branch, master, updated. xfs-for-linus-v3.12-rc3-21-g865e944, xfs |
| Previous by Thread: | [PATCH] xfs: fix possible NULL dereference, Geyslan G. Bem |
| Next by Thread: | Re: [PATCH] xfs: fix possible NULL dereference, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |