All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: fix address fault during mapping fdt region
Date: Mon, 1 Aug 2016 14:31:20 +0100	[thread overview]
Message-ID: <20160801133120.GA14267@leverpostej> (raw)
In-Reply-To: <579F4BD5.9060300@zoho.com>

On Mon, Aug 01, 2016 at 09:17:09PM +0800, zijun_hu wrote:
> On 08/01/2016 07:24 PM, Mark Rutland wrote:
> > On Mon, Aug 01, 2016 at 06:59:50PM +0800, zijun_hu wrote:
> >> 2?it is more portable; we only need to call fdt_check_header() and don't
> >> care about fdt header filed layout; moreover,fdt module is another independent
> >> module and arm64 only uses it and should not depend on more details of fdt
> >> such as size and magic fields locate within the first MIN_FDT_ALIGN bytes;
> >> the decision whether a fdt header is corrupted should be left to fdt team
> > 
> > While it's true that we assume knowledge of the FDT format, and ideally
> > we'd leave this to common code, we do so regardless by requiring the
> > header size. So both approaches assume details regarding the FDT format.
> > 
> okay, the only thing my solution is depends on is the fdt header struct name
> which maybe remain unchanged in further fdt source modification
> regardless of fields layout or position or header size;
> 
> by the way, my solution only maps more one SWAPPER_BLOCK_SIZE at extreme condition
> (offset + sizeof(struct fdt_header)) > SWAPPER_BLOCK_SIZE, it can occurs very rarely,
> even it happens, it is no matter due to the fast mapping operations
> 
> That all said, ard.biesheuvel's can resolves address fault too, you can decide which
> solution to used, maybe ask fdt team for some advisements

As a member of the "fdt team" (at least for bindings and the spec), I'm
happy with Ard's patch. ;)

Regardless, many thanks for the report, and the proposed fix!

Thanks,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: zijun_hu <zijun_hu@zoho.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Laura Abbott <labbott@fedoraproject.org>,
	"Suzuki K. Poulose" <suzuki.poulose@arm.com>,
	Jeremy Linton <jeremy.linton@arm.com>,
	tj@kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	zijun_hu@htc.com
Subject: Re: [PATCH] arm64: fix address fault during mapping fdt region
Date: Mon, 1 Aug 2016 14:31:20 +0100	[thread overview]
Message-ID: <20160801133120.GA14267@leverpostej> (raw)
In-Reply-To: <579F4BD5.9060300@zoho.com>

On Mon, Aug 01, 2016 at 09:17:09PM +0800, zijun_hu wrote:
> On 08/01/2016 07:24 PM, Mark Rutland wrote:
> > On Mon, Aug 01, 2016 at 06:59:50PM +0800, zijun_hu wrote:
> >> 2,it is more portable; we only need to call fdt_check_header() and don't
> >> care about fdt header filed layout; moreover,fdt module is another independent
> >> module and arm64 only uses it and should not depend on more details of fdt
> >> such as size and magic fields locate within the first MIN_FDT_ALIGN bytes;
> >> the decision whether a fdt header is corrupted should be left to fdt team
> > 
> > While it's true that we assume knowledge of the FDT format, and ideally
> > we'd leave this to common code, we do so regardless by requiring the
> > header size. So both approaches assume details regarding the FDT format.
> > 
> okay, the only thing my solution is depends on is the fdt header struct name
> which maybe remain unchanged in further fdt source modification
> regardless of fields layout or position or header size;
> 
> by the way, my solution only maps more one SWAPPER_BLOCK_SIZE at extreme condition
> (offset + sizeof(struct fdt_header)) > SWAPPER_BLOCK_SIZE, it can occurs very rarely,
> even it happens, it is no matter due to the fast mapping operations
> 
> That all said, ard.biesheuvel's can resolves address fault too, you can decide which
> solution to used, maybe ask fdt team for some advisements

As a member of the "fdt team" (at least for bindings and the spec), I'm
happy with Ard's patch. ;)

Regardless, many thanks for the report, and the proposed fix!

Thanks,
Mark.

  reply	other threads:[~2016-08-01 13:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01  9:42 [PATCH] arm64: fix address fault during mapping fdt region zijun_hu
2016-08-01  9:42 ` zijun_hu
2016-08-01  9:50 ` Ard Biesheuvel
2016-08-01  9:50   ` Ard Biesheuvel
2016-08-01 10:59   ` zijun_hu
2016-08-01 10:59     ` zijun_hu
2016-08-01 11:24     ` Mark Rutland
2016-08-01 11:24       ` Mark Rutland
2016-08-01 13:17       ` zijun_hu
2016-08-01 13:17         ` zijun_hu
2016-08-01 13:31         ` Mark Rutland [this message]
2016-08-01 13:31           ` Mark Rutland
2016-08-01 11:06   ` Mark Rutland
2016-08-01 11:06     ` Mark Rutland
2016-08-01 12:24 ` Greg KH
2016-08-01 12:24   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160801133120.GA14267@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.